Commit f9d5681e authored by Matija Obreza's avatar Matija Obreza

Merge branch '359-upgrade-to-data-provider' into 'master'

Resolve "Upgrade to Data Provider"

Closes #359

See merge request genesys-pgr/genesys-server!260
parents 0f6e1048 8d8cca09
...@@ -24,10 +24,12 @@ import org.genesys.blocks.security.model.AclAwareModel; ...@@ -24,10 +24,12 @@ import org.genesys.blocks.security.model.AclAwareModel;
import org.genesys.catalog.model.traits.Descriptor; import org.genesys.catalog.model.traits.Descriptor;
import org.genesys.catalog.model.traits.DescriptorList; import org.genesys.catalog.model.traits.DescriptorList;
import org.genesys.catalog.model.vocab.ControlledVocabulary; import org.genesys.catalog.model.vocab.ControlledVocabulary;
import org.genesys2.server.model.impl.FaoInstitute;
import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Document;
import javax.persistence.*; import javax.persistence.*;
import java.net.URL; import java.net.URL;
import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -78,10 +80,9 @@ public class Partner extends UuidModel implements SelfCleaning, AclAwareModel { ...@@ -78,10 +80,9 @@ public class Partner extends UuidModel implements SelfCleaning, AclAwareModel {
private Set<URL> urls; private Set<URL> urls;
/// FAO WIEWS codes associated with this partner /// FAO WIEWS codes associated with this partner
@ElementCollection @JsonIgnore
@CollectionTable(name = "partner_wiews", joinColumns = @JoinColumn(name = "partnerId")) @OneToMany(mappedBy = "owner", fetch = FetchType.LAZY)
@Column(name = "wiews") private List<FaoInstitute> institutes;
private Set<String> wiewsCodes;
@ElementCollection @ElementCollection
@CollectionTable(name = "partner_country", joinColumns = @JoinColumn(name = "partnerId"), uniqueConstraints = { @UniqueConstraint(columnNames = { "partnerId", "code" }) }) @CollectionTable(name = "partner_country", joinColumns = @JoinColumn(name = "partnerId"), uniqueConstraints = { @UniqueConstraint(columnNames = { "partnerId", "code" }) })
...@@ -121,7 +122,7 @@ public class Partner extends UuidModel implements SelfCleaning, AclAwareModel { ...@@ -121,7 +122,7 @@ public class Partner extends UuidModel implements SelfCleaning, AclAwareModel {
* @param partner the partner * @param partner the partner
*/ */
public Partner(final Partner partner) { public Partner(final Partner partner) {
this(partner.getShortName(), partner.getName(), partner.getUrls(), partner.getWiewsCodes(), partner.getDescriptors(), partner.getVocabularies(), partner this(partner.getShortName(), partner.getName(), partner.getUrls(), partner.getInstitutes(), partner.getDescriptors(), partner.getVocabularies(), partner
.getDescriptorList()); .getDescriptorList());
} }
...@@ -131,20 +132,20 @@ public class Partner extends UuidModel implements SelfCleaning, AclAwareModel { ...@@ -131,20 +132,20 @@ public class Partner extends UuidModel implements SelfCleaning, AclAwareModel {
* @param shortName the short name * @param shortName the short name
* @param name the name * @param name the name
* @param urls the urls * @param urls the urls
* @param wiewsCodes the wiews codes * @param institutes the institutes
* @param descriptors the descriptors * @param descriptors the descriptors
* @param vocabularies the vocabularies * @param vocabularies the vocabularies
* @param descriptorList the descriptor list * @param descriptorList the descriptor list
*/ */
public Partner(final String shortName, final String name, final Set<URL> urls, final Set<String> wiewsCodes, final List<Descriptor> descriptors, public Partner(final String shortName, final String name, final Set<URL> urls, final List<FaoInstitute> institutes, final List<Descriptor> descriptors,
final List<ControlledVocabulary> vocabularies, final List<DescriptorList> descriptorList) { final List<ControlledVocabulary> vocabularies, final List<DescriptorList> descriptorList) {
this.shortName = shortName; this.shortName = shortName;
this.name = name; this.name = name;
if (urls != null) { if (urls != null) {
this.urls = new HashSet<>(urls); this.urls = new HashSet<>(urls);
} }
if (wiewsCodes != null) { if (institutes != null) {
this.wiewsCodes = new HashSet<>(wiewsCodes); this.institutes = new ArrayList<>(institutes);
} }
this.descriptors = descriptors; this.descriptors = descriptors;
this.vocabularies = vocabularies; this.vocabularies = vocabularies;
...@@ -223,22 +224,12 @@ public class Partner extends UuidModel implements SelfCleaning, AclAwareModel { ...@@ -223,22 +224,12 @@ public class Partner extends UuidModel implements SelfCleaning, AclAwareModel {
this.urls = urls; this.urls = urls;
} }
/** public List<FaoInstitute> getInstitutes() {
* Gets the wiews codes. return institutes;
*
* @return the wiewsCodes
*/
public Set<String> getWiewsCodes() {
return wiewsCodes;
} }
/** public void setInstitutes(List<FaoInstitute> institutes) {
* Sets the wiews codes. this.institutes = institutes;
*
* @param wiewsCodes the wiewsCodes to set
*/
public void setWiewsCodes(final Set<String> wiewsCodes) {
this.wiewsCodes = wiewsCodes;
} }
/** /**
......
...@@ -70,7 +70,7 @@ public class PartnerFilter extends UuidModelFilter<PartnerFilter, Partner> { ...@@ -70,7 +70,7 @@ public class PartnerFilter extends UuidModelFilter<PartnerFilter, Partner> {
and.and(description.buildQuery(partnerPath.description)); and.and(description.buildQuery(partnerPath.description));
} }
if (CollectionUtils.isNotEmpty(wiewsCodes)) { if (CollectionUtils.isNotEmpty(wiewsCodes)) {
and.and(partnerPath.wiewsCodes.any().in(wiewsCodes)); and.and(partnerPath.institutes.any().code.in(wiewsCodes));
} }
return and; return and;
} }
......
...@@ -17,9 +17,12 @@ package org.genesys.catalog.service; ...@@ -17,9 +17,12 @@ package org.genesys.catalog.service;
import org.genesys.catalog.model.Partner; import org.genesys.catalog.model.Partner;
import org.genesys.catalog.model.filters.PartnerFilter; import org.genesys.catalog.model.filters.PartnerFilter;
import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.service.filter.InstituteFilter;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import java.util.Set;
import java.util.UUID; import java.util.UUID;
/** /**
...@@ -61,6 +64,14 @@ public interface PartnerService { ...@@ -61,6 +64,14 @@ public interface PartnerService {
*/ */
Partner loadPartner(UUID uuid); Partner loadPartner(UUID uuid);
/**
* Load partners institutes by uuid of partner.
*
* @param uuid uuid of partner
* @return partners institutes
*/
Page<FaoInstitute> loadPartnerInstitutes(UUID uuid, InstituteFilter filter, Pageable page);
/** /**
* Load partner. * Load partner.
* *
...@@ -96,6 +107,25 @@ public interface PartnerService { ...@@ -96,6 +107,25 @@ public interface PartnerService {
*/ */
Page<Partner> listPartners(PartnerFilter partnerFilter, Pageable page); Page<Partner> listPartners(PartnerFilter partnerFilter, Pageable page);
/**
* Adds the institutes to partner
*
* @param partner the partner
* @param instituteCodes the institute codes
* @return the partner
*/
Partner addInstitutes(Partner partner, Set<String> instituteCodes);
/**
* Removes the institutes from partner
*
* @param partner the partner
* @param instituteCodes the institute codes
* @return the partner
*/
Partner removeInstitutes(Partner partner, Set<String> instituteCodes);
/** /**
* Method for copy values of source to target. * Method for copy values of source to target.
* *
......
...@@ -17,15 +17,24 @@ package org.genesys.catalog.service.impl; ...@@ -17,15 +17,24 @@ package org.genesys.catalog.service.impl;
import static org.genesys.catalog.model.QPartner.partner; import static org.genesys.catalog.model.QPartner.partner;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.HashSet; import java.util.HashSet;
import java.util.UUID; import java.util.UUID;
import org.genesys.blocks.security.service.CustomAclService;
import org.genesys.catalog.model.Partner; import org.genesys.catalog.model.Partner;
import org.genesys.catalog.model.filters.PartnerFilter; import org.genesys.catalog.model.filters.PartnerFilter;
import org.genesys.catalog.persistence.PartnerRepository; import org.genesys.catalog.persistence.PartnerRepository;
import org.genesys.catalog.service.PartnerService; import org.genesys.catalog.service.PartnerService;
import org.genesys2.server.exception.NotFoundElement;
import org.genesys2.server.model.UserRole; import org.genesys2.server.model.UserRole;
import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.model.impl.QFaoInstitute;
import org.genesys2.server.persistence.FaoInstituteRepository;
import org.genesys2.server.security.SecurityUtils; import org.genesys2.server.security.SecurityUtils;
import org.genesys2.server.service.filter.InstituteFilter;
import org.genesys2.util.JPAUtils; import org.genesys2.util.JPAUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -55,9 +64,15 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean { ...@@ -55,9 +64,15 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean {
@Autowired @Autowired
private PartnerRepository partnerRepository; private PartnerRepository partnerRepository;
@Autowired
private FaoInstituteRepository instituteRepository;
@Autowired @Autowired
private SecurityUtils securityUtils; private SecurityUtils securityUtils;
@Autowired
private CustomAclService aclService;
@Value("${partner.primary.uuid}") @Value("${partner.primary.uuid}")
private UUID primaryPartnerUuid; private UUID primaryPartnerUuid;
...@@ -163,14 +178,52 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean { ...@@ -163,14 +178,52 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean {
return new PageImpl<>(res.getContent(), page, res.getTotalElements()); return new PageImpl<>(res.getContent(), page, res.getTotalElements());
} }
@Override
@Transactional
@PreAuthorize("hasRole('ADMINISTRATOR')")
public Partner addInstitutes(Partner partner, Set<String> instituteCodes) {
final Partner savedPartner = loadPartner(partner.getUuid());
List<FaoInstitute> institutes = instituteRepository.findAllByCodes(instituteCodes);
institutes.forEach((inst) -> inst.setOwner(savedPartner));
institutes.forEach((institute -> aclService.createOrUpdatePermissions(institute)));
savedPartner.getInstitutes().addAll(institutes);
return lazyLoad(partnerRepository.save(savedPartner));
}
@Override
@Transactional
@PreAuthorize("hasRole('ADMINISTRATOR')")
public Partner removeInstitutes(Partner partner, Set<String> instituteCodes) {
partner = loadPartner(partner.getUuid());
List<FaoInstitute> institutesToRemove = instituteRepository.findAllByCodes(instituteCodes);
institutesToRemove.forEach((institute -> institute.setOwner(null)));
institutesToRemove.forEach((institute -> aclService.createOrUpdatePermissions(institute)));
instituteRepository.save(institutesToRemove);
partner.getInstitutes().removeAll(institutesToRemove);
return lazyLoad(partnerRepository.save(partner));
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public Partner loadPartner(final UUID uuid) { public Partner loadPartner(final UUID uuid) {
return lazyLoad(partnerRepository.findByUuid(uuid)); Partner partner = partnerRepository.findByUuid(uuid);
if (partner == null) {
throw new NotFoundElement("No partner with uuid=" + uuid);
}
return lazyLoad(partner);
} }
@Override
public Page<FaoInstitute> loadPartnerInstitutes(UUID uuid, InstituteFilter filter, Pageable page) {
return instituteRepository.findAll(QFaoInstitute.faoInstitute.owner.uuid.eq(uuid).and(filter.buildQuery()), page);
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
...@@ -197,9 +250,9 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean { ...@@ -197,9 +250,9 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean {
target.getUrls().addAll(source.getUrls()); target.getUrls().addAll(source.getUrls());
} }
target.setWiewsCodes(new HashSet<>()); target.setInstitutes(new ArrayList<>());
if (source.getWiewsCodes() != null) { if (source.getInstitutes() != null) {
target.getWiewsCodes().addAll(source.getWiewsCodes()); target.getInstitutes().addAll(source.getInstitutes());
} }
target.setCountryCodes(new HashSet<>()); target.setCountryCodes(new HashSet<>());
...@@ -236,8 +289,8 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean { ...@@ -236,8 +289,8 @@ public class PartnerServiceImpl implements PartnerService, InitializingBean {
if (partner.getUrls() != null) { if (partner.getUrls() != null) {
partner.getUrls().size(); partner.getUrls().size();
} }
if (partner.getWiewsCodes() != null) { if (partner.getInstitutes() != null) {
partner.getWiewsCodes().size(); partner.getInstitutes().size();
} }
if (partner.getCountryCodes() != null) { if (partner.getCountryCodes() != null) {
partner.getCountryCodes().size(); partner.getCountryCodes().size();
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package org.genesys2.server.api.v1; package org.genesys2.server.api.v1;
import java.io.IOException; import java.io.IOException;
import java.util.Set;
import java.util.UUID; import java.util.UUID;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -29,6 +30,8 @@ import org.genesys.catalog.service.ShortFilterService.FilterInfo; ...@@ -29,6 +30,8 @@ import org.genesys.catalog.service.ShortFilterService.FilterInfo;
import org.genesys2.server.api.ApiBaseController; import org.genesys2.server.api.ApiBaseController;
import org.genesys2.server.api.FilteredPage; import org.genesys2.server.api.FilteredPage;
import org.genesys2.server.api.Pagination; import org.genesys2.server.api.Pagination;
import org.genesys2.server.model.impl.FaoInstitute;
import org.genesys2.server.service.filter.InstituteFilter;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
...@@ -109,6 +112,36 @@ public class PartnerController { ...@@ -109,6 +112,36 @@ public class PartnerController {
return partnerService.updatePartner(source); return partnerService.updatePartner(source);
} }
/**
* Adds the institutes to the Partner with provided uuid. Existing
* {@link FaoInstitute#owner} is force-set to this partner.
*
* @param uuid the uuid
* @param instituteCodes the institute codes
* @return the partner
*/
@PreAuthorize("hasRole('ADMINISTRATOR')")
@PostMapping(value = "/addInstitutes/{UUID}")
public Partner addInstitutes(@PathVariable("UUID") UUID uuid, @RequestBody Set<String> instituteCodes) {
Partner partner = partnerService.loadPartner(uuid);
return partnerService.addInstitutes(partner, instituteCodes);
}
/**
* Removes the institutes from the Partner with provided uuid. Effectively this
* sets {@link FaoInstitute#owner} to null.
*
* @param uuid the uuid
* @param instituteCodes the institute codes
* @return the partner
*/
@PreAuthorize("hasRole('ADMINISTRATOR')")
@PostMapping(value = "/removeInstitutes/{UUID}")
public Partner removeInstitutes(@PathVariable("UUID") UUID uuid, @RequestBody Set<String> instituteCodes) {
Partner partner = partnerService.loadPartner(uuid);
return partnerService.removeInstitutes(partner, instituteCodes);
}
/** /**
* List partners. * List partners.
* *
...@@ -131,6 +164,18 @@ public class PartnerController { ...@@ -131,6 +164,18 @@ public class PartnerController {
return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, partnerService.listPartners(filterInfo.filter, page.toPageRequest(100))); return new FilteredPage<>(filterInfo.filterCode, filterInfo.filter, partnerService.listPartners(filterInfo.filter, page.toPageRequest(100)));
} }
/**
* Gets partners institutes.
*
* @param uuid the uuid
* @return the partner
*/
@PostMapping(value = "/{UUID}/institutes")
public Page<FaoInstitute> listInstitutes(@PathVariable("UUID") final UUID uuid,
@RequestBody(required = false) InstituteFilter filter, Pagination page) {
return partnerService.loadPartnerInstitutes(uuid, filter, page.toPageRequest(100));
}
/** /**
* My partners. * My partners.
* *
......
...@@ -64,7 +64,7 @@ public abstract class AccessionData extends AuditedVersionedModel implements IdU ...@@ -64,7 +64,7 @@ public abstract class AccessionData extends AuditedVersionedModel implements IdU
@MapsId @MapsId
@OneToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.EAGER, optional = false, orphanRemoval = false) @OneToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.EAGER, optional = false, orphanRemoval = false)
@JoinColumn(name = "id") @JoinColumn(name = "id")
@JsonUnwrapped @JsonUnwrapped
@Field(type=FieldType.Auto) @Field(type=FieldType.Auto)
private AccessionId accessionId; private AccessionId accessionId;
......
...@@ -25,24 +25,14 @@ import java.util.HashMap; ...@@ -25,24 +25,14 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.persistence.Cacheable; import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.MapKey;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.genesys.blocks.model.BasicModel; import org.genesys.blocks.model.BasicModel;
import org.genesys.blocks.model.EntityId; import org.genesys.blocks.model.EntityId;
import org.genesys.blocks.model.JsonViews; import org.genesys.blocks.model.JsonViews;
import org.genesys.blocks.security.model.AclAwareModel; import org.genesys.blocks.security.model.AclAwareModel;
import org.genesys.catalog.model.Partner;
import org.genesys.custom.elasticsearch.IgnoreField; import org.genesys.custom.elasticsearch.IgnoreField;
import org.genesys2.server.model.genesys.PDCIStatistics; import org.genesys2.server.model.genesys.PDCIStatistics;
import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.Field;
...@@ -118,6 +108,12 @@ public class FaoInstitute extends BasicModel implements GeoReferencedEntity, Acl ...@@ -118,6 +108,12 @@ public class FaoInstitute extends BasicModel implements GeoReferencedEntity, Acl
@Field(index = FieldIndex.not_analyzed, type = FieldType.String) @Field(index = FieldIndex.not_analyzed, type = FieldType.String)
private List<Organization> networks; private List<Organization> networks;
@ManyToOne(cascade = {})
@JoinColumn(name = "partnerId")
@JsonView({ JsonViews.Public.class })
private Partner owner;
private long accessionCount; private long accessionCount;
private boolean pgrActivity; private boolean pgrActivity;
private boolean maintainsCollection; private boolean maintainsCollection;
...@@ -132,6 +128,12 @@ public class FaoInstitute extends BasicModel implements GeoReferencedEntity, Acl ...@@ -132,6 +128,12 @@ public class FaoInstitute extends BasicModel implements GeoReferencedEntity, Acl
@Column(name = "pdciHistogram") @Column(name = "pdciHistogram")
private String pdciHistogram; private String pdciHistogram;
@Override
public AclAwareModel aclParentObject(){
return this.owner;
}
public FaoInstitute() { public FaoInstitute() {
} }
...@@ -340,6 +342,14 @@ public class FaoInstitute extends BasicModel implements GeoReferencedEntity, Acl ...@@ -340,6 +342,14 @@ public class FaoInstitute extends BasicModel implements GeoReferencedEntity, Acl
this.pdciHistogram = pdciHistogram; this.pdciHistogram = pdciHistogram;
} }
public Partner getOwner() {
return owner;
}
public void setOwner(Partner owner) {
this.owner = owner;
}
public PDCIStatistics getStatisticsPDCI() { public PDCIStatistics getStatisticsPDCI() {
if (this.pdciMin == null || this.pdciMax == null || this.pdciAvg == null) { if (this.pdciMin == null || this.pdciMax == null || this.pdciAvg == null) {
return null; return null;
......
...@@ -4468,6 +4468,56 @@ databaseChangeLog: ...@@ -4468,6 +4468,56 @@ databaseChangeLog:
referencedColumnNames: id referencedColumnNames: id
- changeSet:
id: 1539274052727-1
author: vpavlov
comment: partnerId to faoinstitute
changes:
- addColumn:
columns:
- column:
name: partnerId
type: bigint(20)
tableName: faoinstitute
- changeSet:
id: 1539274052727-2
author: vpavlov
comment: added foreign key faoinstitute(partnerId)-partner(id)
changes:
- addForeignKeyConstraint:
baseColumnNames: partnerId
baseTableName: faoinstitute
constraintName: FK_103537ceb0f6f88fee69bbf23
deferrable: false
initiallyDeferred: false
onDelete: NO ACTION
onUpdate: NO ACTION
referencedColumnNames: id
referencedTableName: partner
- changeSet:
id: 1539274052727-3
author: vpavlov
comment: Migrate data from partner_wiews to faoinstitute (partnerId)
changes:
- sql:
sql: >-
update faoinstitute f
inner join partner_wiews pw on
f.code = pw.wiews
set f.partnerId = pw.partnerId;
- changeSet:
id: 1539274052727-4
author: vpavlov
comment: drop partner_wiews
changes:
- dropTable:
tableName: partner_wiews
# ENABLE AFTER SOME TIME # ENABLE AFTER SOME TIME
# - changeSet: # - changeSet:
# id: 1537463144763-folder # id: 1537463144763-folder
......
...@@ -17,6 +17,7 @@ package org.genesys.test.base; ...@@ -17,6 +17,7 @@ package org.genesys.test.base;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration; import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.UUID; import java.util.UUID;
...@@ -121,7 +122,7 @@ public abstract class AbstractApiTest extends AbstractTest { ...@@ -121,7 +122,7 @@ public abstract class AbstractApiTest extends AbstractTest {
partner.setActive(isActive); partner.setActive(isActive);
partner.setShortName(shortName); partner.setShortName(shortName);
partner.setUuid(uuid); partner.setUuid(uuid);
partner.setWiewsCodes(new HashSet<>()); partner.setInstitutes(new ArrayList<>());
partner.setUrls(new HashSet<>()); partner.setUrls(new HashSet<>());
return partnerRepository.save(partner); return partnerRepository.save(partner);
} }
......
...@@ -17,6 +17,7 @@ package org.genesys.test.catalog.services; ...@@ -17,6 +17,7 @@ package org.genesys.test.catalog.services;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -85,6 +86,12 @@ public abstract class CatalogServiceTest extends AbstractServiceTest { ...@@ -85,6 +86,12 @@ public abstract class CatalogServiceTest extends AbstractServiceTest {
@Autowired @Autowired
protected PartnerRepository partnerRepository; protected PartnerRepository partnerRepository;
@Autowired
protected InstituteService instituteService;
@Autowired
protected FaoInstituteRepository instituteRepository;
@Autowired @Autowired
protected DescriptorListService descriptorListService; protected DescriptorListService descriptorListService;
...@@ -109,18 +116,12 @@ public abstract class CatalogServiceTest extends AbstractServiceTest { ...@@ -109,18 +116,12 @@ public abstract class CatalogServiceTest extends AbstractServiceTest {
@Autowired @Autowired
protected ShortFilterRepository shortFilterRepository; protected ShortFilterRepository shortFilterRepository;
@Autowired
private InstituteService instituteService;
@Autowired @Autowired
private AccessionUploader accessionUploader; private AccessionUploader accessionUploader;
@Autowired @Autowired
protected AccessionRepository accessionRepository; protected AccessionRepository accessionRepository;
@Autowired
protected FaoInstituteRepository instituteRepository;
protected Partner partner; protected Partner partner;
protected Partner partner2; protected Partner partner2;