diff --git a/pom.xml b/pom.xml index 0e7465286..f4cc7bd58 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,6 @@ 0.8.2 - 1.19.4 2.27.2 4.2.0 @@ -256,34 +255,6 @@ - - org.testcontainers - testcontainers - ${testcontainers.version} - test - - - - org.testcontainers - junit-jupiter - ${testcontainers.version} - test - - - - org.testcontainers - kafka - ${testcontainers.version} - test - - - - org.testcontainers - postgresql - ${testcontainers.version} - test - - org.awaitility awaitility @@ -300,9 +271,8 @@ org.folio - folio-service-tools-spring-test - ${folio-service-tools.version} - test + folio-spring-testing + ${folio-spring-support.version} diff --git a/src/main/java/org/folio/search/repository/classification/InstanceClassificationEntity.java b/src/main/java/org/folio/search/repository/classification/InstanceClassificationEntity.java new file mode 100644 index 000000000..ed88bc5f0 --- /dev/null +++ b/src/main/java/org/folio/search/repository/classification/InstanceClassificationEntity.java @@ -0,0 +1,59 @@ +package org.folio.search.repository.classification; + +import java.util.Objects; +import lombok.Builder; + +public record InstanceClassificationEntity( + Id id, + boolean shared +) { + + public InstanceClassificationEntity { + Objects.requireNonNull(id); + } + + public String type() { + return id().type(); + } + + public String number() { + return id().number(); + } + + public String instanceId() { + return id().instanceId(); + } + + public String tenantId() { + return id().tenantId(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InstanceClassificationEntity that = (InstanceClassificationEntity) o; + return Objects.equals(id, that.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Builder + public record Id(String type, + String number, + String instanceId, + String tenantId) { + public Id { + Objects.requireNonNull(number); + Objects.requireNonNull(instanceId); + Objects.requireNonNull(tenantId); + } + } +} diff --git a/src/main/java/org/folio/search/repository/classification/InstanceClassificationEntityAgg.java b/src/main/java/org/folio/search/repository/classification/InstanceClassificationEntityAgg.java new file mode 100644 index 000000000..a76af3a0a --- /dev/null +++ b/src/main/java/org/folio/search/repository/classification/InstanceClassificationEntityAgg.java @@ -0,0 +1,12 @@ +package org.folio.search.repository.classification; + +import java.util.List; +import org.folio.search.model.index.InstanceSubResource; + +public record InstanceClassificationEntityAgg( + String type, + String number, + List instances +) { + +} diff --git a/src/main/java/org/folio/search/repository/classification/InstanceClassificationJdbcRepository.java b/src/main/java/org/folio/search/repository/classification/InstanceClassificationJdbcRepository.java new file mode 100644 index 000000000..2699c715a --- /dev/null +++ b/src/main/java/org/folio/search/repository/classification/InstanceClassificationJdbcRepository.java @@ -0,0 +1,187 @@ +package org.folio.search.repository.classification; + +import static org.folio.search.utils.JdbcUtils.getQuestionMarkPlaceholder; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.sql.PreparedStatement; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.folio.search.model.index.InstanceSubResource; +import org.folio.search.utils.JdbcUtils; +import org.folio.spring.FolioExecutionContext; +import org.jetbrains.annotations.NotNull; +import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.stereotype.Repository; + +@Log4j2 +@Repository +@RequiredArgsConstructor +public class InstanceClassificationJdbcRepository implements InstanceClassificationRepository { + + private static final String INSTANCE_CLASSIFICATION_TABLE_NAME = "instance_classification"; + private static final String CLASSIFICATION_TYPE_COLUMN = "classification_type"; + private static final String CLASSIFICATION_NUMBER_COLUMN = "classification_number"; + private static final String TENANT_ID_COLUMN = "tenant_id"; + private static final String INSTANCE_ID_COLUMN = "instance_id"; + private static final String SHARED_COLUMN = "shared"; + private static final String CLASSIFICATION_TYPE_DEFAULT = ""; + + private static final String SELECT_ALL_SQL = "SELECT * FROM %s;"; + private static final String SELECT_ALL_BY_INSTANCE_ID_AGG = """ + SELECT + t1.classification_number, + t1.classification_type, + json_agg(json_build_object( + 'instanceId', t1.instance_id, + 'shared', t1.shared, + 'tenantId', t1.tenant_id + )) AS instances + FROM %1$s t1 + INNER JOIN %1$s t2 ON t1.classification_number = t2.classification_number + AND t1.classification_type = t2.classification_type + AND t2.instance_id IN (%2$s) + GROUP BY t1.classification_number, t1.classification_type; + """; + private static final String INSERT_SQL; + private static final String DELETE_SQL; + private static final int BATCH_SIZE = 100; + private static final TypeReference> VALUE_TYPE_REF = new TypeReference<>() { }; + + static { + var allColumns = new ArrayList<>(Arrays.asList( + CLASSIFICATION_TYPE_COLUMN, + CLASSIFICATION_NUMBER_COLUMN, + TENANT_ID_COLUMN, + INSTANCE_ID_COLUMN, + SHARED_COLUMN + )); + + var pkColumns = new ArrayList<>(Arrays.asList( + CLASSIFICATION_TYPE_COLUMN, + CLASSIFICATION_NUMBER_COLUMN, + TENANT_ID_COLUMN, + INSTANCE_ID_COLUMN + )); + + INSERT_SQL = "INSERT INTO %s (" + String.join(",", allColumns) + ") " + + "VALUES (?, ?, ?, ?, ?) " + + "ON CONFLICT (" + String.join(",", pkColumns) + ") " + + "DO UPDATE SET " + SHARED_COLUMN + " = EXCLUDED." + SHARED_COLUMN + ";"; + + DELETE_SQL = "DELETE FROM %s " + + "WHERE " + CLASSIFICATION_TYPE_COLUMN + " = ? AND " + + CLASSIFICATION_NUMBER_COLUMN + " = ? AND " + + TENANT_ID_COLUMN + " = ? AND " + + INSTANCE_ID_COLUMN + " = ?;"; + + } + + private final FolioExecutionContext context; + private final JdbcTemplate jdbcTemplate; + private final ObjectMapper objectMapper; + + public void saveAll(List classifications) { + log.debug("saveAll::instance classifications [entities: {}]", classifications); + + if (classifications == null || classifications.isEmpty()) { + return; + } + + var uniqueEntities = classifications.stream().distinct().toList(); + + jdbcTemplate.batchUpdate( + INSERT_SQL.formatted(getTableName()), + uniqueEntities, + BATCH_SIZE, + (PreparedStatement ps, InstanceClassificationEntity item) -> { + var id = item.id(); + ps.setString(1, itemTypeToDatabaseValue(id)); + ps.setString(2, id.number()); + ps.setString(3, id.tenantId()); + ps.setString(4, id.instanceId()); + ps.setBoolean(5, item.shared()); + }); + } + + @Override + public void deleteAll(List classifications) { + log.debug("deleteAll::instance classifications [entities: {}]", classifications); + + if (classifications == null || classifications.isEmpty()) { + return; + } + + jdbcTemplate.batchUpdate( + DELETE_SQL.formatted(getTableName()), + classifications, + BATCH_SIZE, + (PreparedStatement ps, InstanceClassificationEntity item) -> { + var id = item.id(); + ps.setString(1, itemTypeToDatabaseValue(id)); + ps.setString(2, id.number()); + ps.setString(3, id.tenantId()); + ps.setString(4, id.instanceId()); + }); + + } + + @Override + public List findAll() { + log.debug("findAll::instance classifications"); + return jdbcTemplate.query(SELECT_ALL_SQL.formatted(getTableName()), instanceClassificationRowMapper()); + } + + @Override + public List findAllByInstanceIds(List instanceIds) { + log.debug("findAllByInstanceIds::instance classifications [instanceIds: {}]", instanceIds); + return jdbcTemplate.query( + SELECT_ALL_BY_INSTANCE_ID_AGG.formatted(getTableName(), getQuestionMarkPlaceholder(instanceIds.size())), + instanceClassificationAggRowMapper(), + instanceIds.toArray()); + } + + @NotNull + private RowMapper instanceClassificationRowMapper() { + return (rs, rowNum) -> { + var builder = InstanceClassificationEntity.Id.builder(); + var typeVal = rs.getString(CLASSIFICATION_TYPE_COLUMN); + builder.type(CLASSIFICATION_TYPE_DEFAULT.equals(typeVal) ? null : typeVal); + builder.number(rs.getString(CLASSIFICATION_NUMBER_COLUMN)); + builder.instanceId(rs.getString(INSTANCE_ID_COLUMN)); + builder.tenantId(rs.getString(TENANT_ID_COLUMN)); + var shared = rs.getBoolean(SHARED_COLUMN); + return new InstanceClassificationEntity(builder.build(), shared); + }; + } + + @NotNull + private RowMapper instanceClassificationAggRowMapper() { + return (rs, rowNum) -> { + var typeVal = rs.getString(CLASSIFICATION_TYPE_COLUMN); + var type = CLASSIFICATION_TYPE_DEFAULT.equals(typeVal) ? null : typeVal; + var number = rs.getString(CLASSIFICATION_NUMBER_COLUMN); + var instancesJson = rs.getString("instances"); + List instanceSubResources; + try { + instanceSubResources = objectMapper.readValue(instancesJson, VALUE_TYPE_REF); + } catch (JsonProcessingException e) { + throw new IllegalArgumentException(e); + } + return new InstanceClassificationEntityAgg(type, number, instanceSubResources); + }; + } + + private String getTableName() { + return JdbcUtils.getFullTableName(context, INSTANCE_CLASSIFICATION_TABLE_NAME); + } + + private String itemTypeToDatabaseValue(InstanceClassificationEntity.Id id) { + return id.type() == null ? CLASSIFICATION_TYPE_DEFAULT : id.type(); + } +} diff --git a/src/main/java/org/folio/search/repository/classification/InstanceClassificationRepository.java b/src/main/java/org/folio/search/repository/classification/InstanceClassificationRepository.java new file mode 100644 index 000000000..113880081 --- /dev/null +++ b/src/main/java/org/folio/search/repository/classification/InstanceClassificationRepository.java @@ -0,0 +1,14 @@ +package org.folio.search.repository.classification; + +import java.util.List; + +public interface InstanceClassificationRepository { + + void saveAll(List classifications); + + void deleteAll(List classifications); + + List findAll(); + + List findAllByInstanceIds(List instanceId); +} diff --git a/src/main/java/org/folio/search/service/consortium/ConsortiumInstanceRepository.java b/src/main/java/org/folio/search/service/consortium/ConsortiumInstanceRepository.java index 68b14fe96..7feee85cd 100644 --- a/src/main/java/org/folio/search/service/consortium/ConsortiumInstanceRepository.java +++ b/src/main/java/org/folio/search/service/consortium/ConsortiumInstanceRepository.java @@ -1,6 +1,7 @@ package org.folio.search.service.consortium; -import static java.util.Collections.nCopies; +import static org.folio.search.utils.JdbcUtils.getFullTableName; +import static org.folio.search.utils.JdbcUtils.getQuestionMarkPlaceholder; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -21,7 +22,7 @@ @RequiredArgsConstructor public class ConsortiumInstanceRepository { - private static final String CONSORTIUM_INSTANCE_TABLE_NAME = "consortium_instance"; + static final String CONSORTIUM_INSTANCE_TABLE_NAME = "consortium_instance"; private static final String SELECT_BY_ID_SQL = "SELECT * FROM %s WHERE instance_id IN (%s)"; private static final String DELETE_BY_TENANT_AND_ID_SQL = "DELETE FROM %s WHERE tenant_id = ? AND instance_id = ?;"; private static final String UPSERT_SQL = """ @@ -40,7 +41,7 @@ ON CONFLICT (tenant_id, instance_id) public List fetch(List instanceIds) { log.debug("fetch::consortium instances by [ids: {}]", instanceIds); return jdbcTemplate.query( - SELECT_BY_ID_SQL.formatted(getFullTableName(), String.join(",", nCopies(instanceIds.size(), "?"))), + SELECT_BY_ID_SQL.formatted(getTableName(), getQuestionMarkPlaceholder(instanceIds.size())), (rs, rowNum) -> toConsortiumInstance(rs), instanceIds.toArray()); } @@ -48,7 +49,7 @@ public List fetch(List instanceIds) { public void save(List instances) { log.debug("save::consortium instances [number: {}]", instances.size()); jdbcTemplate.batchUpdate( - UPSERT_SQL.formatted(getFullTableName()), + UPSERT_SQL.formatted(getTableName()), instances, 100, (PreparedStatement ps, ConsortiumInstance item) -> { @@ -63,7 +64,7 @@ public void save(List instances) { public void delete(Set instanceIds) { log.debug("delete::consortium instances [tenant-instanceIds: {}]", instanceIds); jdbcTemplate.batchUpdate( - DELETE_BY_TENANT_AND_ID_SQL.formatted(getFullTableName()), + DELETE_BY_TENANT_AND_ID_SQL.formatted(getTableName()), instanceIds, 100, (PreparedStatement ps, ConsortiumInstanceId id) -> { @@ -78,8 +79,7 @@ private ConsortiumInstance toConsortiumInstance(ResultSet rs) throws SQLExceptio return new ConsortiumInstance(id, rs.getString(JSON_COLUMN)); } - private String getFullTableName() { - var dbSchemaName = context.getFolioModuleMetadata().getDBSchemaName(context.getTenantId()); - return dbSchemaName + "." + CONSORTIUM_INSTANCE_TABLE_NAME; + private String getTableName() { + return getFullTableName(context, CONSORTIUM_INSTANCE_TABLE_NAME); } } diff --git a/src/main/java/org/folio/search/service/converter/MultiTenantSearchDocumentConverter.java b/src/main/java/org/folio/search/service/converter/MultiTenantSearchDocumentConverter.java index e3a1b7953..4c227393f 100644 --- a/src/main/java/org/folio/search/service/converter/MultiTenantSearchDocumentConverter.java +++ b/src/main/java/org/folio/search/service/converter/MultiTenantSearchDocumentConverter.java @@ -78,7 +78,7 @@ private Stream populateResourceEvents(ResourceEvent event) { .map(ResourceDescription::getIndexingConfiguration) .map(ResourceIndexingConfiguration::getEventPreProcessor) .map(eventPreProcessorBeans::get) - .map(eventPreProcessor -> eventPreProcessor.process(event)) + .map(eventPreProcessor -> eventPreProcessor.preProcess(event)) .map(Collection::stream) .orElseGet(() -> Stream.of(event)); } diff --git a/src/main/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessor.java b/src/main/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessor.java index 4037fc796..3c05d9cec 100644 --- a/src/main/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessor.java +++ b/src/main/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessor.java @@ -65,7 +65,7 @@ public void init() { * @return list with divided authority event objects */ @Override - public List process(ResourceEvent event) { + public List preProcess(ResourceEvent event) { log.debug("process:: by [id: {}, tenant: {}, resourceType: {}]", event.getId(), event.getTenant(), event.getType()); diff --git a/src/main/java/org/folio/search/service/converter/preprocessor/EventPreProcessor.java b/src/main/java/org/folio/search/service/converter/preprocessor/EventPreProcessor.java index 943b2f3ec..024f462c6 100644 --- a/src/main/java/org/folio/search/service/converter/preprocessor/EventPreProcessor.java +++ b/src/main/java/org/folio/search/service/converter/preprocessor/EventPreProcessor.java @@ -13,5 +13,5 @@ public interface EventPreProcessor { * @return list with resource events, where key is the resource name and value is the {@link List} with generated * {@link ResourceEvent} objects */ - List process(ResourceEvent event); + List preProcess(ResourceEvent event); } diff --git a/src/main/java/org/folio/search/service/converter/preprocessor/InstanceEventPreProcessor.java b/src/main/java/org/folio/search/service/converter/preprocessor/InstanceEventPreProcessor.java new file mode 100644 index 000000000..076e178ab --- /dev/null +++ b/src/main/java/org/folio/search/service/converter/preprocessor/InstanceEventPreProcessor.java @@ -0,0 +1,116 @@ +package org.folio.search.service.converter.preprocessor; + +import static java.util.Collections.emptyList; +import static java.util.Collections.emptySet; +import static org.apache.commons.collections4.MapUtils.getObject; +import static org.apache.commons.lang3.StringUtils.startsWith; +import static org.folio.search.utils.CollectionUtils.subtract; +import static org.folio.search.utils.SearchConverterUtils.getNewAsMap; +import static org.folio.search.utils.SearchConverterUtils.getOldAsMap; +import static org.folio.search.utils.SearchConverterUtils.getResourceEventId; +import static org.folio.search.utils.SearchConverterUtils.getResourceSource; +import static org.folio.search.utils.SearchUtils.CLASSIFICATIONS_FIELD; +import static org.folio.search.utils.SearchUtils.CLASSIFICATION_NUMBER_FIELD; +import static org.folio.search.utils.SearchUtils.CLASSIFICATION_TYPE_FIELD; +import static org.folio.search.utils.SearchUtils.SOURCE_CONSORTIUM_PREFIX; + +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import lombok.RequiredArgsConstructor; +import lombok.extern.log4j.Log4j2; +import org.apache.commons.collections4.MapUtils; +import org.folio.search.domain.dto.ResourceEvent; +import org.folio.search.domain.dto.TenantConfiguredFeature; +import org.folio.search.repository.classification.InstanceClassificationEntity; +import org.folio.search.repository.classification.InstanceClassificationRepository; +import org.folio.search.service.FeatureConfigService; +import org.folio.search.service.consortium.ConsortiumTenantService; +import org.jetbrains.annotations.NotNull; +import org.springframework.stereotype.Component; + +@Log4j2 +@Component +@RequiredArgsConstructor +public class InstanceEventPreProcessor implements EventPreProcessor { + + private final FeatureConfigService featureConfigService; + private final ConsortiumTenantService consortiumTenantService; + private final InstanceClassificationRepository instanceClassificationRepository; + + @Override + public List preProcess(ResourceEvent event) { + log.info("preProcess::Starting instance event pre-processing"); + if (log.isDebugEnabled()) { + log.debug("preProcess::Starting instance event pre-processing [{}]", event); + } + if (startsWith(getResourceSource(event), SOURCE_CONSORTIUM_PREFIX)) { + log.info("preProcess::Finished instance event pre-processing. No additional events created for shadow instance."); + return List.of(event); + } + + var events = processClassifications(event); + + log.info("preProcess::Finished instance event pre-processing"); + if (log.isDebugEnabled()) { + log.debug("preProcess::Finished instance event pre-processing. Events after: [{}], ", events); + } + return events; + } + + private List processClassifications(ResourceEvent event) { + if (!featureConfigService.isEnabled(TenantConfiguredFeature.BROWSE_CLASSIFICATIONS)) { + return List.of(event); + } + + var oldClassifications = getClassifications(getOldAsMap(event)); + var newClassifications = getClassifications(getNewAsMap(event)); + + if (oldClassifications.equals(newClassifications)) { + return List.of(event); + } + + var tenant = event.getTenant(); + var instanceId = getResourceEventId(event); + var shared = isShared(tenant); + + var classificationsForCreate = subtract(newClassifications, oldClassifications); + var classificationsForDelete = subtract(oldClassifications, newClassifications); + + instanceClassificationRepository.saveAll(toEntities(classificationsForCreate, instanceId, tenant, shared)); + instanceClassificationRepository.deleteAll(toEntities(classificationsForDelete, instanceId, tenant, shared)); + + return List.of(event); + } + + @NotNull + private static List toEntities( + Set> subtract, String instanceId, String tenantId, boolean shared) { + return subtract.stream() + .map(map -> { + var classificationId = InstanceClassificationEntity.Id.builder() + .number(MapUtils.getString(map, CLASSIFICATION_NUMBER_FIELD)) + .type(MapUtils.getString(map, CLASSIFICATION_TYPE_FIELD)) + .instanceId(instanceId) + .tenantId(tenantId) + .build(); + return new InstanceClassificationEntity(classificationId, shared); + }) + .toList(); + } + + @SuppressWarnings("unchecked") + private Set> getClassifications(Map event) { + var object = getObject(event, CLASSIFICATIONS_FIELD, emptyList()); + if (object == null) { + return emptySet(); + } + return new HashSet<>((List>) object); + } + + private boolean isShared(String tenantId) { + var centralTenant = consortiumTenantService.getCentralTenant(tenantId); + return centralTenant.isPresent() && centralTenant.get().equals(tenantId); + } +} diff --git a/src/main/java/org/folio/search/utils/JdbcUtils.java b/src/main/java/org/folio/search/utils/JdbcUtils.java new file mode 100644 index 000000000..ed5cb1fad --- /dev/null +++ b/src/main/java/org/folio/search/utils/JdbcUtils.java @@ -0,0 +1,19 @@ +package org.folio.search.utils; + +import static java.util.Collections.nCopies; + +import lombok.experimental.UtilityClass; +import org.folio.spring.FolioExecutionContext; + +@UtilityClass +public class JdbcUtils { + + public static String getFullTableName(FolioExecutionContext context, String tableName) { + var dbSchemaName = context.getFolioModuleMetadata().getDBSchemaName(context.getTenantId()); + return dbSchemaName + "." + tableName; + } + + public static String getQuestionMarkPlaceholder(int size) { + return String.join(",", nCopies(size, "?")); + } +} diff --git a/src/main/java/org/folio/search/utils/SearchUtils.java b/src/main/java/org/folio/search/utils/SearchUtils.java index a3beac360..b9579b3d7 100644 --- a/src/main/java/org/folio/search/utils/SearchUtils.java +++ b/src/main/java/org/folio/search/utils/SearchUtils.java @@ -48,6 +48,9 @@ public class SearchUtils { public static final String CONTRIBUTOR_BROWSING_FIELD = "name"; public static final String AUTHORITY_BROWSING_FIELD = "headingRef"; public static final String AUTHORITY_ID_FIELD = "authorityId"; + public static final String CLASSIFICATIONS_FIELD = "classifications"; + public static final String CLASSIFICATION_NUMBER_FIELD = "classificationNumber"; + public static final String CLASSIFICATION_TYPE_FIELD = "classificationTypeId"; public static final String SUBJECT_AGGREGATION_NAME = "subjects.value"; public static final String SOURCE_CONSORTIUM_PREFIX = "CONSORTIUM-"; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b4cbe7452..4d511747d 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -36,6 +36,9 @@ spring: username: ${DB_USERNAME:postgres} password: ${DB_PASSWORD:postgres} url: jdbc:postgresql://${DB_HOST:postgres}:${DB_PORT:5432}/${DB_DATABASE:okapi_modules} + hikari: + data-source-properties: + reWriteBatchedInserts: true liquibase: change-log: classpath:changelog/changelog-master.xml cache: @@ -62,6 +65,7 @@ folio: search-all-fields: ${SEARCH_BY_ALL_FIELDS_ENABLED:false} browse-cn-intermediate-values: ${BROWSE_CN_INTERMEDIATE_VALUES_ENABLED:true} browse-cn-intermediate-remove-duplicates: ${BROWSE_CN_INTERMEDIATE_REMOVE_DUPLICATES:true} + browse-classifications: false indexing: instance-subjects: retry-attempts: ${INSTANCE_SUBJECTS_INDEXING_RETRY_ATTEMPTS:3} diff --git a/src/main/resources/changelog/changelog-master.xml b/src/main/resources/changelog/changelog-master.xml index 5cbe6655d..e8e346130 100644 --- a/src/main/resources/changelog/changelog-master.xml +++ b/src/main/resources/changelog/changelog-master.xml @@ -7,4 +7,5 @@ + diff --git a/src/main/resources/changelog/changes/v3.2/create_instance_classification_table.xml b/src/main/resources/changelog/changes/v3.2/create_instance_classification_table.xml new file mode 100644 index 000000000..435639fa8 --- /dev/null +++ b/src/main/resources/changelog/changes/v3.2/create_instance_classification_table.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + Create instance_classification table + + + + + + + + + + + + + + + + + + + + + + + + + + Create idx_instance_classification_number_and_type index + + + + + + + + + + + + + + + Create idx_instance_classification_number_and_type index + + + + + + + diff --git a/src/main/resources/model/instance.json b/src/main/resources/model/instance.json index 234bf7e9a..009e1b015 100644 --- a/src/main/resources/model/instance.json +++ b/src/main/resources/model/instance.json @@ -3,6 +3,9 @@ "eventBodyJavaClass": "org.folio.search.domain.dto.Instance", "reindexSupported": true, "languageSourcePaths": [ "$.languages" ], + "indexingConfiguration": { + "eventPreProcessor": "instanceEventPreProcessor" + }, "searchFieldModifiers": [ "itemSearchFieldModifier" ], diff --git a/src/main/resources/swagger.api/mod-search.yaml b/src/main/resources/swagger.api/mod-search.yaml index 881a99257..fa45060ad 100644 --- a/src/main/resources/swagger.api/mod-search.yaml +++ b/src/main/resources/swagger.api/mod-search.yaml @@ -704,6 +704,7 @@ components: - search.all.fields - browse.cn.intermediate.values - browse.cn.intermediate.remove.duplicates + - browse.classifications x-okapi-tenant-header: name: x-okapi-tenant in: header diff --git a/src/main/resources/swagger.api/schemas/instance.json b/src/main/resources/swagger.api/schemas/instance.json index 244c436f3..d0bdd05d1 100644 --- a/src/main/resources/swagger.api/schemas/instance.json +++ b/src/main/resources/swagger.api/schemas/instance.json @@ -160,6 +160,10 @@ "classificationNumber": { "type": "string", "description": "Classification (e.g. classification scheme, classification schedule)" + }, + "classificationTypeId": { + "type": "string", + "description": "Classification type ID" } } } diff --git a/src/main/resources/swagger.api/schemas/tenantConfiguredFeature.json b/src/main/resources/swagger.api/schemas/tenantConfiguredFeature.json index f7d8e31db..1bccc2dae 100644 --- a/src/main/resources/swagger.api/schemas/tenantConfiguredFeature.json +++ b/src/main/resources/swagger.api/schemas/tenantConfiguredFeature.json @@ -5,6 +5,7 @@ "enum": [ "search.all.fields", "browse.cn.intermediate.values", - "browse.cn.intermediate.remove.duplicates" + "browse.cn.intermediate.remove.duplicates", + "browse.classifications" ] } diff --git a/src/test/java/org/folio/search/client/cql/CqlQueryTest.java b/src/test/java/org/folio/search/client/cql/CqlQueryTest.java index 4383fed79..bd7163e05 100644 --- a/src/test/java/org/folio/search/client/cql/CqlQueryTest.java +++ b/src/test/java/org/folio/search/client/cql/CqlQueryTest.java @@ -6,7 +6,7 @@ import java.util.List; import org.folio.search.model.client.CqlQueryParam; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/configuration/CacheConfigurationTest.java b/src/test/java/org/folio/search/configuration/CacheConfigurationTest.java index 45d2cb50e..33c0e90df 100644 --- a/src/test/java/org/folio/search/configuration/CacheConfigurationTest.java +++ b/src/test/java/org/folio/search/configuration/CacheConfigurationTest.java @@ -4,7 +4,7 @@ import static org.mockito.Mockito.when; import org.folio.search.configuration.properties.SearchCacheConfigurationProperties; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/configuration/FeignRequestInterceptorTest.java b/src/test/java/org/folio/search/configuration/FeignRequestInterceptorTest.java index 7c3096013..d561395d9 100644 --- a/src/test/java/org/folio/search/configuration/FeignRequestInterceptorTest.java +++ b/src/test/java/org/folio/search/configuration/FeignRequestInterceptorTest.java @@ -8,7 +8,7 @@ import feign.RequestTemplate; import org.folio.spring.FolioExecutionContext; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/configuration/KafkaConfigurationTest.java b/src/test/java/org/folio/search/configuration/KafkaConfigurationTest.java index 1a857d2f3..bd4ff875c 100644 --- a/src/test/java/org/folio/search/configuration/KafkaConfigurationTest.java +++ b/src/test/java/org/folio/search/configuration/KafkaConfigurationTest.java @@ -4,7 +4,7 @@ import static org.mockito.Mockito.when; import java.util.Collections; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.folio.spring.tools.kafka.FolioKafkaProperties; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/configuration/OpensearchRestClientConfigurationTest.java b/src/test/java/org/folio/search/configuration/OpensearchRestClientConfigurationTest.java index bfe9b6a92..dbdf06f94 100644 --- a/src/test/java/org/folio/search/configuration/OpensearchRestClientConfigurationTest.java +++ b/src/test/java/org/folio/search/configuration/OpensearchRestClientConfigurationTest.java @@ -8,7 +8,7 @@ import java.util.stream.Stream; import org.folio.search.configuration.opensearch.RestClientBuilderCustomizer; import org.folio.search.configuration.properties.OpensearchProperties; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/configuration/RetryTemplateConfigurationTest.java b/src/test/java/org/folio/search/configuration/RetryTemplateConfigurationTest.java index 1f0f2f5f6..7eb0e3923 100644 --- a/src/test/java/org/folio/search/configuration/RetryTemplateConfigurationTest.java +++ b/src/test/java/org/folio/search/configuration/RetryTemplateConfigurationTest.java @@ -4,7 +4,7 @@ import static org.mockito.Mockito.when; import org.folio.search.configuration.properties.StreamIdsProperties; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.folio.spring.tools.kafka.FolioKafkaProperties; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/controller/BrowseAroundCallNumberIT.java b/src/test/java/org/folio/search/controller/BrowseAroundCallNumberIT.java index d95006151..886cbcc01 100644 --- a/src/test/java/org/folio/search/controller/BrowseAroundCallNumberIT.java +++ b/src/test/java/org/folio/search/controller/BrowseAroundCallNumberIT.java @@ -20,7 +20,7 @@ import org.folio.search.domain.dto.Item; import org.folio.search.domain.dto.ItemEffectiveCallNumberComponents; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/BrowseAuthorityIT.java b/src/test/java/org/folio/search/controller/BrowseAuthorityIT.java index e0d0ac66a..b0ad0e12e 100644 --- a/src/test/java/org/folio/search/controller/BrowseAuthorityIT.java +++ b/src/test/java/org/folio/search/controller/BrowseAuthorityIT.java @@ -14,7 +14,7 @@ import org.folio.search.domain.dto.AuthorityBrowseItem; import org.folio.search.domain.dto.AuthorityBrowseResult; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/org/folio/search/controller/BrowseCallNumberIT.java b/src/test/java/org/folio/search/controller/BrowseCallNumberIT.java index b6284515b..7490db75c 100644 --- a/src/test/java/org/folio/search/controller/BrowseCallNumberIT.java +++ b/src/test/java/org/folio/search/controller/BrowseCallNumberIT.java @@ -23,7 +23,7 @@ import org.folio.search.domain.dto.Item; import org.folio.search.domain.dto.ItemEffectiveCallNumberComponents; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/org/folio/search/controller/BrowseCallNumberOtherIT.java b/src/test/java/org/folio/search/controller/BrowseCallNumberOtherIT.java index b91722bb4..ccb088281 100644 --- a/src/test/java/org/folio/search/controller/BrowseCallNumberOtherIT.java +++ b/src/test/java/org/folio/search/controller/BrowseCallNumberOtherIT.java @@ -24,7 +24,7 @@ import org.folio.search.domain.dto.ItemEffectiveCallNumberComponents; import org.folio.search.support.base.BaseIntegrationTest; import org.folio.search.utils.TestUtils; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/BrowseContributorConsortiumIT.java b/src/test/java/org/folio/search/controller/BrowseContributorConsortiumIT.java index a905a4765..58bf45bf5 100644 --- a/src/test/java/org/folio/search/controller/BrowseContributorConsortiumIT.java +++ b/src/test/java/org/folio/search/controller/BrowseContributorConsortiumIT.java @@ -37,7 +37,7 @@ import org.folio.search.domain.dto.RecordType; import org.folio.search.support.base.BaseConsortiumIntegrationTest; import org.folio.search.utils.SearchUtils; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/BrowseContributorIT.java b/src/test/java/org/folio/search/controller/BrowseContributorIT.java index dd3d8188f..1e347216a 100644 --- a/src/test/java/org/folio/search/controller/BrowseContributorIT.java +++ b/src/test/java/org/folio/search/controller/BrowseContributorIT.java @@ -33,7 +33,7 @@ import org.folio.search.domain.dto.RecordType; import org.folio.search.support.base.BaseIntegrationTest; import org.folio.search.utils.SearchUtils; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/org/folio/search/controller/BrowseControllerTest.java b/src/test/java/org/folio/search/controller/BrowseControllerTest.java index fe191abff..25811d4df 100644 --- a/src/test/java/org/folio/search/controller/BrowseControllerTest.java +++ b/src/test/java/org/folio/search/controller/BrowseControllerTest.java @@ -34,7 +34,7 @@ import org.folio.search.service.consortium.TenantProvider; import org.folio.search.service.setter.SearchResponsePostProcessor; import org.folio.spring.integration.XOkapiHeaders; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mock; diff --git a/src/test/java/org/folio/search/controller/BrowseSubjectConsortiumIT.java b/src/test/java/org/folio/search/controller/BrowseSubjectConsortiumIT.java index 4d865a2fe..62e0c4488 100644 --- a/src/test/java/org/folio/search/controller/BrowseSubjectConsortiumIT.java +++ b/src/test/java/org/folio/search/controller/BrowseSubjectConsortiumIT.java @@ -38,7 +38,7 @@ import org.folio.search.model.Pair; import org.folio.search.support.base.BaseConsortiumIntegrationTest; import org.folio.search.utils.SearchUtils; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/org/folio/search/controller/BrowseSubjectIT.java b/src/test/java/org/folio/search/controller/BrowseSubjectIT.java index 1d8d5b954..ab61ed427 100644 --- a/src/test/java/org/folio/search/controller/BrowseSubjectIT.java +++ b/src/test/java/org/folio/search/controller/BrowseSubjectIT.java @@ -27,7 +27,7 @@ import org.folio.search.model.Pair; import org.folio.search.support.base.BaseIntegrationTest; import org.folio.search.utils.SearchUtils; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/org/folio/search/controller/BrowseTypedCallNumberIT.java b/src/test/java/org/folio/search/controller/BrowseTypedCallNumberIT.java index 73ae15ae9..7b4b0d57b 100644 --- a/src/test/java/org/folio/search/controller/BrowseTypedCallNumberIT.java +++ b/src/test/java/org/folio/search/controller/BrowseTypedCallNumberIT.java @@ -31,7 +31,7 @@ import org.folio.search.domain.dto.ItemEffectiveCallNumberComponents; import org.folio.search.support.base.BaseIntegrationTest; import org.folio.spring.integration.XOkapiHeaders; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/BrowseTypedCallNumberIrrelevantResultIT.java b/src/test/java/org/folio/search/controller/BrowseTypedCallNumberIrrelevantResultIT.java index f6669ca25..7faa6708a 100644 --- a/src/test/java/org/folio/search/controller/BrowseTypedCallNumberIrrelevantResultIT.java +++ b/src/test/java/org/folio/search/controller/BrowseTypedCallNumberIrrelevantResultIT.java @@ -26,7 +26,7 @@ import org.folio.search.model.service.BrowseContext; import org.folio.search.support.base.BaseIntegrationTest; import org.folio.search.utils.CallNumberUtils; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/ConfigControllerTest.java b/src/test/java/org/folio/search/controller/ConfigControllerTest.java index 21b415721..1d71e1fc2 100644 --- a/src/test/java/org/folio/search/controller/ConfigControllerTest.java +++ b/src/test/java/org/folio/search/controller/ConfigControllerTest.java @@ -28,7 +28,7 @@ import org.folio.search.service.consortium.LanguageConfigServiceDecorator; import org.folio.search.support.base.ApiEndpoints; import org.folio.spring.integration.XOkapiHeaders; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; diff --git a/src/test/java/org/folio/search/controller/ConfigIT.java b/src/test/java/org/folio/search/controller/ConfigIT.java index d238f26b5..11dd1a89e 100644 --- a/src/test/java/org/folio/search/controller/ConfigIT.java +++ b/src/test/java/org/folio/search/controller/ConfigIT.java @@ -29,7 +29,7 @@ import org.folio.search.support.base.ApiEndpoints; import org.folio.search.support.base.BaseIntegrationTest; import org.folio.search.utils.TestUtils; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/org/folio/search/controller/DisabledSystemUserIT.java b/src/test/java/org/folio/search/controller/DisabledSystemUserIT.java index e5b761c7d..3a7b5540f 100644 --- a/src/test/java/org/folio/search/controller/DisabledSystemUserIT.java +++ b/src/test/java/org/folio/search/controller/DisabledSystemUserIT.java @@ -11,7 +11,7 @@ import org.folio.spring.client.AuthnClient; import org.folio.spring.client.PermissionsClient; import org.folio.spring.client.UsersClient; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/FacetsControllerTest.java b/src/test/java/org/folio/search/controller/FacetsControllerTest.java index 1d6fc95e0..cdafc8f05 100644 --- a/src/test/java/org/folio/search/controller/FacetsControllerTest.java +++ b/src/test/java/org/folio/search/controller/FacetsControllerTest.java @@ -24,7 +24,7 @@ import org.folio.search.service.FacetService; import org.folio.search.service.consortium.TenantProvider; import org.folio.spring.integration.XOkapiHeaders; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/controller/IndexManagementControllerTest.java b/src/test/java/org/folio/search/controller/IndexManagementControllerTest.java index 510f2cfc6..8c1fcdd51 100644 --- a/src/test/java/org/folio/search/controller/IndexManagementControllerTest.java +++ b/src/test/java/org/folio/search/controller/IndexManagementControllerTest.java @@ -32,7 +32,7 @@ import org.folio.search.service.IndexService; import org.folio.search.service.ResourceService; import org.folio.spring.integration.XOkapiHeaders; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.hibernate.validator.internal.engine.ConstraintViolationImpl; import org.hibernate.validator.internal.engine.path.PathImpl; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/IndexManagementIT.java b/src/test/java/org/folio/search/controller/IndexManagementIT.java index d473a5dd3..16e76604e 100644 --- a/src/test/java/org/folio/search/controller/IndexManagementIT.java +++ b/src/test/java/org/folio/search/controller/IndexManagementIT.java @@ -16,7 +16,7 @@ import org.folio.search.support.base.ApiEndpoints; import org.folio.search.support.base.BaseIntegrationTest; import org.folio.spring.integration.XOkapiHeaders; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/RecordsIndexingIT.java b/src/test/java/org/folio/search/controller/RecordsIndexingIT.java index 85fab8b9f..d3e422279 100644 --- a/src/test/java/org/folio/search/controller/RecordsIndexingIT.java +++ b/src/test/java/org/folio/search/controller/RecordsIndexingIT.java @@ -43,7 +43,7 @@ import org.folio.search.support.base.ApiEndpoints; import org.folio.search.support.base.BaseIntegrationTest; import org.folio.spring.integration.XOkapiHeaders; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/ResourcesIdsControllerTest.java b/src/test/java/org/folio/search/controller/ResourcesIdsControllerTest.java index ce4b6fe13..eb01ebd17 100644 --- a/src/test/java/org/folio/search/controller/ResourcesIdsControllerTest.java +++ b/src/test/java/org/folio/search/controller/ResourcesIdsControllerTest.java @@ -31,7 +31,7 @@ import org.folio.search.service.ResourceIdsStreamHelper; import org.folio.search.service.consortium.ConsortiumTenantExecutor; import org.folio.spring.integration.XOkapiHeaders; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; diff --git a/src/test/java/org/folio/search/controller/SearchAuthorityFilterIT.java b/src/test/java/org/folio/search/controller/SearchAuthorityFilterIT.java index 57e6efb66..8dc7cd02c 100644 --- a/src/test/java/org/folio/search/controller/SearchAuthorityFilterIT.java +++ b/src/test/java/org/folio/search/controller/SearchAuthorityFilterIT.java @@ -25,7 +25,7 @@ import org.folio.search.domain.dto.Metadata; import org.folio.search.domain.dto.RecordType; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/org/folio/search/controller/SearchAuthorityIT.java b/src/test/java/org/folio/search/controller/SearchAuthorityIT.java index 9b4470866..265a209d2 100644 --- a/src/test/java/org/folio/search/controller/SearchAuthorityIT.java +++ b/src/test/java/org/folio/search/controller/SearchAuthorityIT.java @@ -23,7 +23,7 @@ import org.folio.search.domain.dto.SeriesItem; import org.folio.search.domain.dto.Subject; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/org/folio/search/controller/SearchByAllFieldsIT.java b/src/test/java/org/folio/search/controller/SearchByAllFieldsIT.java index ba3f5ca38..bfa57d4ac 100644 --- a/src/test/java/org/folio/search/controller/SearchByAllFieldsIT.java +++ b/src/test/java/org/folio/search/controller/SearchByAllFieldsIT.java @@ -8,7 +8,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/controller/SearchByEmptyValuesIT.java b/src/test/java/org/folio/search/controller/SearchByEmptyValuesIT.java index 3908175d4..211dbc3e7 100644 --- a/src/test/java/org/folio/search/controller/SearchByEmptyValuesIT.java +++ b/src/test/java/org/folio/search/controller/SearchByEmptyValuesIT.java @@ -11,7 +11,7 @@ import org.folio.search.domain.dto.Contributor; import org.folio.search.domain.dto.Instance; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/controller/SearchControllerTest.java b/src/test/java/org/folio/search/controller/SearchControllerTest.java index 323f269b8..792566f89 100644 --- a/src/test/java/org/folio/search/controller/SearchControllerTest.java +++ b/src/test/java/org/folio/search/controller/SearchControllerTest.java @@ -22,7 +22,7 @@ import org.folio.search.service.SearchService; import org.folio.search.service.consortium.TenantProvider; import org.folio.spring.integration.XOkapiHeaders; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.opensearch.OpenSearchException; diff --git a/src/test/java/org/folio/search/controller/SearchHoldingsIT.java b/src/test/java/org/folio/search/controller/SearchHoldingsIT.java index 4e7319735..bd2895dfb 100644 --- a/src/test/java/org/folio/search/controller/SearchHoldingsIT.java +++ b/src/test/java/org/folio/search/controller/SearchHoldingsIT.java @@ -9,7 +9,7 @@ import java.util.List; import org.folio.search.domain.dto.Instance; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/SearchInstanceConsortiumIT.java b/src/test/java/org/folio/search/controller/SearchInstanceConsortiumIT.java index 4ae9affb2..c40c9e551 100644 --- a/src/test/java/org/folio/search/controller/SearchInstanceConsortiumIT.java +++ b/src/test/java/org/folio/search/controller/SearchInstanceConsortiumIT.java @@ -21,7 +21,7 @@ import org.folio.search.domain.dto.ItemEffectiveCallNumberComponents; import org.folio.search.model.service.ResultList; import org.folio.search.support.base.BaseConsortiumIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -106,6 +106,7 @@ private static Item removeUnexpectedProperties(Item item) { private static Instance removeUnexpectedProperties(Instance instance) { instance.getElectronicAccess().forEach(e -> e.setMaterialsSpecification(null)); + instance.getClassifications().forEach(c -> c.setClassificationTypeId(null)); instance.setTenantId(null); instance.setShared(null); return instance.staffSuppress(false).discoverySuppress(false).items(null).holdings(null); diff --git a/src/test/java/org/folio/search/controller/SearchInstanceFilterIT.java b/src/test/java/org/folio/search/controller/SearchInstanceFilterIT.java index 926e251df..8d78edbc0 100644 --- a/src/test/java/org/folio/search/controller/SearchInstanceFilterIT.java +++ b/src/test/java/org/folio/search/controller/SearchInstanceFilterIT.java @@ -32,7 +32,7 @@ import org.folio.search.domain.dto.RecordType; import org.folio.search.domain.dto.Tags; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/org/folio/search/controller/SearchInstanceIT.java b/src/test/java/org/folio/search/controller/SearchInstanceIT.java index 1d6dee1a1..6f77b096c 100644 --- a/src/test/java/org/folio/search/controller/SearchInstanceIT.java +++ b/src/test/java/org/folio/search/controller/SearchInstanceIT.java @@ -27,7 +27,7 @@ import org.folio.spring.client.AuthnClient; import org.folio.spring.client.PermissionsClient; import org.folio.spring.client.UsersClient; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.hamcrest.Matchers; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -175,6 +175,7 @@ private static Item removeUnexpectedProperties(Item item) { private static Instance removeUnexpectedProperties(Instance instance) { instance.getElectronicAccess().forEach(e -> e.setMaterialsSpecification(null)); + instance.getClassifications().forEach(c -> c.setClassificationTypeId(null)); instance.setTenantId(null); instance.setShared(null); return instance.staffSuppress(false).discoverySuppress(false).items(null).holdings(null); diff --git a/src/test/java/org/folio/search/controller/SearchItemIT.java b/src/test/java/org/folio/search/controller/SearchItemIT.java index ffa9f6f12..59ce7f87b 100644 --- a/src/test/java/org/folio/search/controller/SearchItemIT.java +++ b/src/test/java/org/folio/search/controller/SearchItemIT.java @@ -7,7 +7,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/controller/SortAuthorityIT.java b/src/test/java/org/folio/search/controller/SortAuthorityIT.java index 95d4a86e6..ed5a771d2 100644 --- a/src/test/java/org/folio/search/controller/SortAuthorityIT.java +++ b/src/test/java/org/folio/search/controller/SortAuthorityIT.java @@ -11,7 +11,7 @@ import java.util.stream.IntStream; import org.folio.search.domain.dto.Authority; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/SortInstanceByTitleIT.java b/src/test/java/org/folio/search/controller/SortInstanceByTitleIT.java index e6db98e21..776330469 100644 --- a/src/test/java/org/folio/search/controller/SortInstanceByTitleIT.java +++ b/src/test/java/org/folio/search/controller/SortInstanceByTitleIT.java @@ -7,7 +7,7 @@ import java.util.List; import org.folio.search.domain.dto.Instance; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/SortInstanceIT.java b/src/test/java/org/folio/search/controller/SortInstanceIT.java index 8df70c464..f5048e802 100644 --- a/src/test/java/org/folio/search/controller/SortInstanceIT.java +++ b/src/test/java/org/folio/search/controller/SortInstanceIT.java @@ -12,7 +12,7 @@ import org.folio.search.domain.dto.Contributor; import org.folio.search.domain.dto.Instance; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/controller/SortItemIT.java b/src/test/java/org/folio/search/controller/SortItemIT.java index 1c1449198..bc98b2b4e 100644 --- a/src/test/java/org/folio/search/controller/SortItemIT.java +++ b/src/test/java/org/folio/search/controller/SortItemIT.java @@ -15,7 +15,7 @@ import org.folio.search.domain.dto.Item; import org.folio.search.domain.dto.ItemStatus; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/org/folio/search/controller/StreamResourceIdsIT.java b/src/test/java/org/folio/search/controller/StreamResourceIdsIT.java index bf67737aa..7c148aea8 100644 --- a/src/test/java/org/folio/search/controller/StreamResourceIdsIT.java +++ b/src/test/java/org/folio/search/controller/StreamResourceIdsIT.java @@ -27,7 +27,7 @@ import org.folio.search.domain.dto.ResourceIdsJob.EntityTypeEnum; import org.folio.search.support.base.ApiEndpoints; import org.folio.search.support.base.BaseIntegrationTest; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; diff --git a/src/test/java/org/folio/search/cql/CallNumberSearchTermProcessorTest.java b/src/test/java/org/folio/search/cql/CallNumberSearchTermProcessorTest.java index e301245e6..56bc75560 100644 --- a/src/test/java/org/folio/search/cql/CallNumberSearchTermProcessorTest.java +++ b/src/test/java/org/folio/search/cql/CallNumberSearchTermProcessorTest.java @@ -2,7 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; diff --git a/src/test/java/org/folio/search/cql/CqlQueryParserTest.java b/src/test/java/org/folio/search/cql/CqlQueryParserTest.java index b3b49e3c8..50a379f74 100644 --- a/src/test/java/org/folio/search/cql/CqlQueryParserTest.java +++ b/src/test/java/org/folio/search/cql/CqlQueryParserTest.java @@ -5,7 +5,7 @@ import static org.folio.search.utils.TestConstants.RESOURCE_NAME; import org.folio.search.exception.SearchServiceException; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.z3950.zing.cql.CQLRelation; import org.z3950.zing.cql.CQLTermNode; diff --git a/src/test/java/org/folio/search/cql/CqlSearchQueryConverterTest.java b/src/test/java/org/folio/search/cql/CqlSearchQueryConverterTest.java index 48d664535..34f8b590d 100644 --- a/src/test/java/org/folio/search/cql/CqlSearchQueryConverterTest.java +++ b/src/test/java/org/folio/search/cql/CqlSearchQueryConverterTest.java @@ -41,7 +41,7 @@ import org.folio.search.service.consortium.ConsortiumTenantService; import org.folio.search.service.metadata.LocalSearchFieldProvider; import org.folio.spring.FolioExecutionContext; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/cql/CqlSortProviderTest.java b/src/test/java/org/folio/search/cql/CqlSortProviderTest.java index cb1fdb18a..1df3b6fc3 100644 --- a/src/test/java/org/folio/search/cql/CqlSortProviderTest.java +++ b/src/test/java/org/folio/search/cql/CqlSortProviderTest.java @@ -23,7 +23,7 @@ import org.folio.search.model.metadata.SortDescription; import org.folio.search.model.types.SortFieldType; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/cql/CqlTermQueryConverterTest.java b/src/test/java/org/folio/search/cql/CqlTermQueryConverterTest.java index 73afe6b6a..d4c4b786c 100644 --- a/src/test/java/org/folio/search/cql/CqlTermQueryConverterTest.java +++ b/src/test/java/org/folio/search/cql/CqlTermQueryConverterTest.java @@ -27,7 +27,7 @@ import org.folio.search.exception.RequestValidationException; import org.folio.search.exception.ValidationException; import org.folio.search.service.metadata.LocalSearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/cql/EffectiveShelvingOrderTermProcessorTest.java b/src/test/java/org/folio/search/cql/EffectiveShelvingOrderTermProcessorTest.java index 99f65a1bd..17e057776 100644 --- a/src/test/java/org/folio/search/cql/EffectiveShelvingOrderTermProcessorTest.java +++ b/src/test/java/org/folio/search/cql/EffectiveShelvingOrderTermProcessorTest.java @@ -6,7 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.List; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; diff --git a/src/test/java/org/folio/search/cql/IsbnSearchTermProcessorTest.java b/src/test/java/org/folio/search/cql/IsbnSearchTermProcessorTest.java index 7978f0f0e..90728c2d6 100644 --- a/src/test/java/org/folio/search/cql/IsbnSearchTermProcessorTest.java +++ b/src/test/java/org/folio/search/cql/IsbnSearchTermProcessorTest.java @@ -5,7 +5,7 @@ import java.util.List; import org.folio.search.service.setter.instance.IsbnProcessor; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/cql/ItemSearchFieldModifierTest.java b/src/test/java/org/folio/search/cql/ItemSearchFieldModifierTest.java index f49e9cdc2..bc3f01ffb 100644 --- a/src/test/java/org/folio/search/cql/ItemSearchFieldModifierTest.java +++ b/src/test/java/org/folio/search/cql/ItemSearchFieldModifierTest.java @@ -2,7 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/cql/OclcSearchTermProcessorTest.java b/src/test/java/org/folio/search/cql/OclcSearchTermProcessorTest.java index 79186d09f..20efdde90 100644 --- a/src/test/java/org/folio/search/cql/OclcSearchTermProcessorTest.java +++ b/src/test/java/org/folio/search/cql/OclcSearchTermProcessorTest.java @@ -4,7 +4,7 @@ import static org.mockito.Mockito.when; import org.folio.search.service.setter.instance.OclcProcessor; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/cql/builders/AllTermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/AllTermQueryBuilderTest.java index 51a05e9e8..d4647d3a0 100644 --- a/src/test/java/org/folio/search/cql/builders/AllTermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/AllTermQueryBuilderTest.java @@ -15,7 +15,7 @@ import java.util.Optional; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/cql/builders/AnyTermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/AnyTermQueryBuilderTest.java index 1f7da2455..4f5f1f637 100644 --- a/src/test/java/org/folio/search/cql/builders/AnyTermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/AnyTermQueryBuilderTest.java @@ -12,7 +12,7 @@ import java.util.Optional; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/cql/builders/EqualTermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/EqualTermQueryBuilderTest.java index 5c79f72a3..4df6f3e6d 100644 --- a/src/test/java/org/folio/search/cql/builders/EqualTermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/EqualTermQueryBuilderTest.java @@ -16,7 +16,7 @@ import java.util.Optional; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/cql/builders/ExactTermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/ExactTermQueryBuilderTest.java index 2507e61fb..e868f36ac 100644 --- a/src/test/java/org/folio/search/cql/builders/ExactTermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/ExactTermQueryBuilderTest.java @@ -16,7 +16,7 @@ import java.util.List; import java.util.Optional; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/cql/builders/GtTermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/GtTermQueryBuilderTest.java index c278ef412..059b20c5e 100644 --- a/src/test/java/org/folio/search/cql/builders/GtTermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/GtTermQueryBuilderTest.java @@ -7,7 +7,7 @@ import static org.folio.search.utils.TestConstants.RESOURCE_NAME; import static org.opensearch.index.query.QueryBuilders.rangeQuery; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/cql/builders/GteTermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/GteTermQueryBuilderTest.java index a596084c9..d1af252a6 100644 --- a/src/test/java/org/folio/search/cql/builders/GteTermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/GteTermQueryBuilderTest.java @@ -7,7 +7,7 @@ import static org.folio.search.utils.TestConstants.RESOURCE_NAME; import static org.opensearch.index.query.QueryBuilders.rangeQuery; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/cql/builders/LtTermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/LtTermQueryBuilderTest.java index 176dca739..abd920803 100644 --- a/src/test/java/org/folio/search/cql/builders/LtTermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/LtTermQueryBuilderTest.java @@ -7,7 +7,7 @@ import static org.folio.search.utils.TestConstants.RESOURCE_NAME; import static org.opensearch.index.query.QueryBuilders.rangeQuery; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/cql/builders/LteTermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/LteTermQueryBuilderTest.java index f1d9dcf3e..ebafc6565 100644 --- a/src/test/java/org/folio/search/cql/builders/LteTermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/LteTermQueryBuilderTest.java @@ -7,7 +7,7 @@ import static org.folio.search.utils.TestConstants.RESOURCE_NAME; import static org.opensearch.index.query.QueryBuilders.rangeQuery; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/cql/builders/NotEqualToTermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/NotEqualToTermQueryBuilderTest.java index 4ba8c652e..c2edcc6d2 100644 --- a/src/test/java/org/folio/search/cql/builders/NotEqualToTermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/NotEqualToTermQueryBuilderTest.java @@ -14,7 +14,7 @@ import java.util.Optional; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/cql/builders/TermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/TermQueryBuilderTest.java index 625d2a39f..4fba9527e 100644 --- a/src/test/java/org/folio/search/cql/builders/TermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/TermQueryBuilderTest.java @@ -7,7 +7,7 @@ import static org.folio.search.utils.TestConstants.RESOURCE_NAME; import java.util.Set; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/cql/builders/WildcardTermQueryBuilderTest.java b/src/test/java/org/folio/search/cql/builders/WildcardTermQueryBuilderTest.java index 4568384f7..fd88879ea 100644 --- a/src/test/java/org/folio/search/cql/builders/WildcardTermQueryBuilderTest.java +++ b/src/test/java/org/folio/search/cql/builders/WildcardTermQueryBuilderTest.java @@ -11,7 +11,7 @@ import static org.opensearch.index.query.QueryBuilders.boolQuery; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/exception/ResourceDescriptionExceptionTest.java b/src/test/java/org/folio/search/exception/ResourceDescriptionExceptionTest.java index e02038576..bf4325575 100644 --- a/src/test/java/org/folio/search/exception/ResourceDescriptionExceptionTest.java +++ b/src/test/java/org/folio/search/exception/ResourceDescriptionExceptionTest.java @@ -2,7 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/exception/SearchOperationExceptionTest.java b/src/test/java/org/folio/search/exception/SearchOperationExceptionTest.java index 946755e25..006528d69 100644 --- a/src/test/java/org/folio/search/exception/SearchOperationExceptionTest.java +++ b/src/test/java/org/folio/search/exception/SearchOperationExceptionTest.java @@ -3,7 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import org.folio.search.model.types.ErrorCode; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/exception/SearchServiceExceptionTest.java b/src/test/java/org/folio/search/exception/SearchServiceExceptionTest.java index f18de5f3a..659d5d975 100644 --- a/src/test/java/org/folio/search/exception/SearchServiceExceptionTest.java +++ b/src/test/java/org/folio/search/exception/SearchServiceExceptionTest.java @@ -3,7 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import org.folio.search.model.types.ErrorCode; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/integration/FolioMessageBatchProcessorTest.java b/src/test/java/org/folio/search/integration/FolioMessageBatchProcessorTest.java index 69b77790a..ee3315e05 100644 --- a/src/test/java/org/folio/search/integration/FolioMessageBatchProcessorTest.java +++ b/src/test/java/org/folio/search/integration/FolioMessageBatchProcessorTest.java @@ -14,7 +14,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; import org.folio.search.model.Pair; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; diff --git a/src/test/java/org/folio/search/integration/KafkaMessageListenerIT.java b/src/test/java/org/folio/search/integration/KafkaMessageListenerIT.java index 52f29a487..38d22d5f7 100644 --- a/src/test/java/org/folio/search/integration/KafkaMessageListenerIT.java +++ b/src/test/java/org/folio/search/integration/KafkaMessageListenerIT.java @@ -47,8 +47,8 @@ import org.folio.spring.DefaultFolioExecutionContext; import org.folio.spring.FolioExecutionContext; import org.folio.spring.service.SystemUserScopedExecutionService; -import org.folio.spring.test.extension.EnableKafka; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.extension.EnableKafka; +import org.folio.spring.testing.type.IntegrationTest; import org.folio.spring.tools.kafka.FolioKafkaProperties; import org.folio.spring.tools.kafka.KafkaAdminService; import org.hibernate.exception.SQLGrammarException; diff --git a/src/test/java/org/folio/search/integration/KafkaMessageListenerTest.java b/src/test/java/org/folio/search/integration/KafkaMessageListenerTest.java index 9e22e3fb0..1ed9af308 100644 --- a/src/test/java/org/folio/search/integration/KafkaMessageListenerTest.java +++ b/src/test/java/org/folio/search/integration/KafkaMessageListenerTest.java @@ -48,7 +48,7 @@ import org.folio.search.service.ResourceService; import org.folio.search.utils.JsonConverter; import org.folio.spring.service.SystemUserScopedExecutionService; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/integration/KafkaMessageProducerTest.java b/src/test/java/org/folio/search/integration/KafkaMessageProducerTest.java index 4d4a63032..e15913e08 100644 --- a/src/test/java/org/folio/search/integration/KafkaMessageProducerTest.java +++ b/src/test/java/org/folio/search/integration/KafkaMessageProducerTest.java @@ -21,7 +21,7 @@ import org.folio.search.domain.dto.ResourceEvent; import org.folio.search.service.consortium.ConsortiumTenantService; import org.folio.search.utils.JsonConverter; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/integration/ReferenceDataServiceTest.java b/src/test/java/org/folio/search/integration/ReferenceDataServiceTest.java index 6cccacd09..556cfd8cf 100644 --- a/src/test/java/org/folio/search/integration/ReferenceDataServiceTest.java +++ b/src/test/java/org/folio/search/integration/ReferenceDataServiceTest.java @@ -33,7 +33,7 @@ import org.folio.search.model.service.ResultList; import org.folio.spring.DefaultFolioExecutionContext; import org.folio.spring.FolioExecutionContext; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/test/java/org/folio/search/integration/ResourceChangeFilterStrategyTest.java b/src/test/java/org/folio/search/integration/ResourceChangeFilterStrategyTest.java index beafa54af..62e1b8c98 100644 --- a/src/test/java/org/folio/search/integration/ResourceChangeFilterStrategyTest.java +++ b/src/test/java/org/folio/search/integration/ResourceChangeFilterStrategyTest.java @@ -9,7 +9,7 @@ import org.folio.search.domain.dto.ResourceDeleteEventSubType; import org.folio.search.domain.dto.ResourceEvent; import org.folio.search.domain.dto.ResourceEventType; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/integration/ResourceFetchServiceTest.java b/src/test/java/org/folio/search/integration/ResourceFetchServiceTest.java index 8a8d57480..1d1a55916 100644 --- a/src/test/java/org/folio/search/integration/ResourceFetchServiceTest.java +++ b/src/test/java/org/folio/search/integration/ResourceFetchServiceTest.java @@ -32,7 +32,7 @@ import org.folio.search.model.client.CqlQueryParam; import org.folio.search.model.service.ResultList; import org.folio.spring.FolioExecutionContext; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/model/metadata/PostProcessResourceDescriptionConverterTest.java b/src/test/java/org/folio/search/model/metadata/PostProcessResourceDescriptionConverterTest.java index e2f818066..82efad42f 100644 --- a/src/test/java/org/folio/search/model/metadata/PostProcessResourceDescriptionConverterTest.java +++ b/src/test/java/org/folio/search/model/metadata/PostProcessResourceDescriptionConverterTest.java @@ -11,7 +11,7 @@ import static org.hamcrest.Matchers.is; import org.folio.search.utils.TestUtils; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/repository/IndexRepositoryTest.java b/src/test/java/org/folio/search/repository/IndexRepositoryTest.java index 11f4c151b..37a50836c 100644 --- a/src/test/java/org/folio/search/repository/IndexRepositoryTest.java +++ b/src/test/java/org/folio/search/repository/IndexRepositoryTest.java @@ -17,7 +17,7 @@ import java.io.IOException; import java.util.List; import org.folio.search.exception.SearchOperationException; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; diff --git a/src/test/java/org/folio/search/repository/InstanceContributorsRepositoryTest.java b/src/test/java/org/folio/search/repository/InstanceContributorsRepositoryTest.java index 562d9a490..eee5d1030 100644 --- a/src/test/java/org/folio/search/repository/InstanceContributorsRepositoryTest.java +++ b/src/test/java/org/folio/search/repository/InstanceContributorsRepositoryTest.java @@ -29,7 +29,7 @@ import org.folio.search.model.index.SearchDocumentBody; import org.folio.search.utils.JsonConverter; import org.folio.search.utils.SmileConverter; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/repository/InstanceSubjectRepositoryTest.java b/src/test/java/org/folio/search/repository/InstanceSubjectRepositoryTest.java index e66f768a2..9c85166be 100644 --- a/src/test/java/org/folio/search/repository/InstanceSubjectRepositoryTest.java +++ b/src/test/java/org/folio/search/repository/InstanceSubjectRepositoryTest.java @@ -32,7 +32,7 @@ import org.folio.search.model.index.SearchDocumentBody; import org.folio.search.utils.JsonConverter; import org.folio.search.utils.SmileConverter; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/repository/PrimaryResourceRepositoryTest.java b/src/test/java/org/folio/search/repository/PrimaryResourceRepositoryTest.java index 75f5fcdc6..c670cefde 100644 --- a/src/test/java/org/folio/search/repository/PrimaryResourceRepositoryTest.java +++ b/src/test/java/org/folio/search/repository/PrimaryResourceRepositoryTest.java @@ -19,7 +19,7 @@ import java.util.List; import org.folio.search.exception.SearchOperationException; import org.folio.search.model.index.SearchDocumentBody; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/repository/ScriptRepositoryTest.java b/src/test/java/org/folio/search/repository/ScriptRepositoryTest.java index 2c12fda29..6cb800022 100644 --- a/src/test/java/org/folio/search/repository/ScriptRepositoryTest.java +++ b/src/test/java/org/folio/search/repository/ScriptRepositoryTest.java @@ -11,7 +11,7 @@ import java.io.IOException; import org.folio.search.exception.SearchOperationException; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/repository/SearchRepositoryTest.java b/src/test/java/org/folio/search/repository/SearchRepositoryTest.java index ddb234272..29242908e 100644 --- a/src/test/java/org/folio/search/repository/SearchRepositoryTest.java +++ b/src/test/java/org/folio/search/repository/SearchRepositoryTest.java @@ -34,7 +34,7 @@ import org.folio.search.model.ResourceRequest; import org.folio.search.model.service.CqlResourceIdsRequest; import org.folio.search.utils.SearchUtils; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/repository/classification/InstanceClassificationEntityTest.java b/src/test/java/org/folio/search/repository/classification/InstanceClassificationEntityTest.java new file mode 100644 index 000000000..e67661878 --- /dev/null +++ b/src/test/java/org/folio/search/repository/classification/InstanceClassificationEntityTest.java @@ -0,0 +1,72 @@ +package org.folio.search.repository.classification; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import org.junit.jupiter.api.Test; + +class InstanceClassificationEntityTest { + + @Test + void constructor_AllParametersProvided_SuccessfullyCreated() { + // Arrange + InstanceClassificationEntity.Id id = + new InstanceClassificationEntity.Id("type", "number", "instanceId", "tenantId"); + boolean shared = true; + + // Act + InstanceClassificationEntity entity = new InstanceClassificationEntity(id, shared); + + // Assert + assertEquals(id, entity.id()); + assertEquals(shared, entity.shared()); + } + + @Test + void constructor_NullId_ThrowsNullPointerException() { + // Act & Assert + assertThrows(NullPointerException.class, () -> new InstanceClassificationEntity(null, true)); + } + + @Test + void builder_AllParametersProvided_SuccessfullyCreated() { + // Arrange + String type = "type"; + String number = "number"; + String instanceId = "instanceId"; + String tenantId = "tenantId"; + boolean shared = true; + + // Act + InstanceClassificationEntity.Id id = InstanceClassificationEntity.Id.builder() + .type(type) + .number(number) + .instanceId(instanceId) + .tenantId(tenantId) + .build(); + + InstanceClassificationEntity entity = new InstanceClassificationEntity(id, shared); + + // Assert + assertEquals(id, entity.id()); + assertEquals(shared, entity.shared()); + } + + @Test + void idBuilder_NullNumber_ThrowsNullPointerException() { + // Act & Assert + assertThrows(NullPointerException.class, () -> InstanceClassificationEntity.Id.builder().number(null).build()); + } + + @Test + void idBuilder_NullInstanceId_ThrowsNullPointerException() { + // Act & Assert + assertThrows(NullPointerException.class, () -> InstanceClassificationEntity.Id.builder().instanceId(null).build()); + } + + @Test + void idBuilder_NullTenantId_ThrowsNullPointerException() { + // Act & Assert + assertThrows(NullPointerException.class, () -> InstanceClassificationEntity.Id.builder().tenantId(null).build()); + } +} diff --git a/src/test/java/org/folio/search/repository/classification/InstanceClassificationJdbcRepositoryIT.java b/src/test/java/org/folio/search/repository/classification/InstanceClassificationJdbcRepositoryIT.java new file mode 100644 index 000000000..b3c493b50 --- /dev/null +++ b/src/test/java/org/folio/search/repository/classification/InstanceClassificationJdbcRepositoryIT.java @@ -0,0 +1,163 @@ +package org.folio.search.repository.classification; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.groups.Tuple.tuple; +import static org.folio.search.utils.TestConstants.TENANT_ID; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.when; + +import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; +import org.folio.spring.FolioExecutionContext; +import org.folio.spring.FolioModuleMetadata; +import org.folio.spring.testing.extension.EnablePostgres; +import org.folio.spring.testing.type.IntegrationTest; +import org.jeasy.random.EasyRandom; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; +import org.springframework.boot.test.autoconfigure.jdbc.JdbcTest; +import org.springframework.boot.test.autoconfigure.json.AutoConfigureJson; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.jdbc.core.JdbcTemplate; + +@IntegrationTest +@JdbcTest +@EnablePostgres +@AutoConfigureJson +@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) +class InstanceClassificationJdbcRepositoryIT { + + private final EasyRandom easyRandom = new EasyRandom(); + + private @Autowired JdbcTemplate jdbcTemplate; + private @MockBean FolioExecutionContext context; + private InstanceClassificationJdbcRepository repository; + + @BeforeEach + void setUp() { + repository = new InstanceClassificationJdbcRepository(context, jdbcTemplate, new ObjectMapper()); + when(context.getFolioModuleMetadata()).thenReturn(new FolioModuleMetadata() { + @Override + public String getModuleName() { + return null; + } + + @Override + public String getDBSchemaName(String tenantId) { + return "public"; + } + }); + when(context.getTenantId()).thenReturn(TENANT_ID); + } + + @Test + void testSaveAll_positive_recordsSaved() { + // Arrange + var entityList = List.of(randomEntity(), randomEntity(), randomEntity()); + + // Act + repository.saveAll(entityList); + + // Assert + var savedEntities = repository.findAll(); + assertEquals(entityList, savedEntities); + } + + @Test + void testSaveAll_positive_recordsSavedWithNullType() { + // Arrange + var entityList = List.of(randomEntity(), randomEntity(), randomEntityWithNullType()); + + // Act + repository.saveAll(entityList); + + // Assert + var savedEntities = repository.findAll(); + assertEquals(entityList, savedEntities); + } + + @Test + void testSaveAll_positive_uniqueRecordsSavedWhenDuplicated() { + // Arrange + var entity = randomEntity(); + var entityList = List.of(entity, entity); + + // Act + repository.saveAll(entityList); + + // Assert + var savedEntities = repository.findAll(); + assertEquals(List.of(entity), savedEntities); + } + + @Test + void testDeleteAll_positive_recordsDeleted() { + // Arrange + var e1 = randomEntity(); + var e2 = randomEntity(); + var e3 = randomEntityWithNullType(); + var entityList = List.of(e1, e2, e3); + repository.saveAll(entityList); + var entityListToDelete = List.of(e1, e1, e3); + + // Act + repository.deleteAll(entityListToDelete); + + // Assert + var savedEntities = repository.findAll(); + assertEquals(List.of(e2), savedEntities); + } + + @Test + void testFindAllByInstanceIds_positive() { + // Arrange + var e1 = entity("type1", "number1", "instanceId1", "tenant1", true); + var e2 = entity("type2", "number2", "instanceId1", "tenant2", false); + var e3 = entity("type1", "number1", "instanceId2", "tenant2", false); + var entityList = List.of(e1, e2, e3); + repository.saveAll(entityList); + + // Act + var allByInstanceIds = repository.findAllByInstanceIds(Collections.singletonList(e1.id().instanceId())); + + // Assert + assertThat(allByInstanceIds).hasSize(2) + .extracting(InstanceClassificationEntityAgg::type, InstanceClassificationEntityAgg::number, + entityAgg -> entityAgg.instances() + .stream() + .map(i -> i.getTenantId() + "|" + i.getInstanceId() + "|" + i.getShared()) + .collect(Collectors.joining(";"))) + .containsExactlyInAnyOrder( + tuple("type1", "number1", "tenant1|instanceId1|true;tenant2|instanceId2|false"), + tuple("type2", "number2", "tenant2|instanceId1|false")); + } + + private InstanceClassificationEntity randomEntity() { + return new InstanceClassificationEntity(InstanceClassificationEntity.Id.builder() + .number(easyRandom.nextObject(String.class)) + .type(easyRandom.nextObject(String.class)) + .tenantId(easyRandom.nextObject(String.class)) + .instanceId(easyRandom.nextObject(String.class)) + .build(), easyRandom.nextObject(Boolean.class)); + } + + private InstanceClassificationEntity randomEntityWithNullType() { + return new InstanceClassificationEntity(InstanceClassificationEntity.Id.builder() + .number(easyRandom.nextObject(String.class)) + .type(null) + .tenantId(easyRandom.nextObject(String.class)) + .instanceId(easyRandom.nextObject(String.class)) + .build(), easyRandom.nextObject(Boolean.class)); + } + + private InstanceClassificationEntity entity(String type, String number, String instanceId, + String tenant, boolean shared) { + return new InstanceClassificationEntity( + new InstanceClassificationEntity.Id(type, number, instanceId, tenant), + shared); + } +} diff --git a/src/test/java/org/folio/search/service/FacetServiceTest.java b/src/test/java/org/folio/search/service/FacetServiceTest.java index c10098fbe..492f1b8eb 100644 --- a/src/test/java/org/folio/search/service/FacetServiceTest.java +++ b/src/test/java/org/folio/search/service/FacetServiceTest.java @@ -17,7 +17,7 @@ import org.folio.search.model.service.CqlFacetRequest; import org.folio.search.repository.SearchRepository; import org.folio.search.service.converter.ElasticsearchFacetConverter; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/FeatureConfigServiceTest.java b/src/test/java/org/folio/search/service/FeatureConfigServiceTest.java index 49ccc44b8..0c36df7a2 100644 --- a/src/test/java/org/folio/search/service/FeatureConfigServiceTest.java +++ b/src/test/java/org/folio/search/service/FeatureConfigServiceTest.java @@ -28,7 +28,7 @@ import org.folio.search.service.FeatureConfigServiceTest.TestContextConfiguration; import org.folio.spring.DefaultFolioExecutionContext; import org.folio.spring.FolioExecutionContext; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/test/java/org/folio/search/service/IndexServiceTest.java b/src/test/java/org/folio/search/service/IndexServiceTest.java index 7046aa0c6..0585055de 100644 --- a/src/test/java/org/folio/search/service/IndexServiceTest.java +++ b/src/test/java/org/folio/search/service/IndexServiceTest.java @@ -46,7 +46,7 @@ import org.folio.search.service.es.SearchMappingsHelper; import org.folio.search.service.es.SearchSettingsHelper; import org.folio.search.service.metadata.ResourceDescriptionService; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/LanguageConfigServiceTest.java b/src/test/java/org/folio/search/service/LanguageConfigServiceTest.java index 250ba1025..3f47a7f61 100644 --- a/src/test/java/org/folio/search/service/LanguageConfigServiceTest.java +++ b/src/test/java/org/folio/search/service/LanguageConfigServiceTest.java @@ -24,7 +24,7 @@ import org.folio.search.service.metadata.LocalSearchFieldProvider; import org.folio.search.utils.SearchUtils; import org.folio.spring.service.SystemUserScopedExecutionService; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/ResourceIdServiceTest.java b/src/test/java/org/folio/search/service/ResourceIdServiceTest.java index bf269a35d..4a3c9fb52 100644 --- a/src/test/java/org/folio/search/service/ResourceIdServiceTest.java +++ b/src/test/java/org/folio/search/service/ResourceIdServiceTest.java @@ -34,7 +34,7 @@ import org.folio.search.repository.ResourceIdsJobRepository; import org.folio.search.repository.SearchRepository; import org.folio.spring.service.SystemUserScopedExecutionService; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/ResourceIdsStreamHelperTest.java b/src/test/java/org/folio/search/service/ResourceIdsStreamHelperTest.java index b762b58b2..20c2cadbc 100644 --- a/src/test/java/org/folio/search/service/ResourceIdsStreamHelperTest.java +++ b/src/test/java/org/folio/search/service/ResourceIdsStreamHelperTest.java @@ -15,7 +15,7 @@ import java.io.IOException; import org.folio.search.exception.SearchServiceException; import org.folio.search.model.service.CqlResourceIdsRequest; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/ResourceServiceTest.java b/src/test/java/org/folio/search/service/ResourceServiceTest.java index a0ed2dd5e..6f1c5d783 100644 --- a/src/test/java/org/folio/search/service/ResourceServiceTest.java +++ b/src/test/java/org/folio/search/service/ResourceServiceTest.java @@ -51,7 +51,7 @@ import org.folio.search.service.converter.MultiTenantSearchDocumentConverter; import org.folio.search.service.metadata.ResourceDescriptionService; import org.folio.search.utils.SearchUtils; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/SearchServiceTest.java b/src/test/java/org/folio/search/service/SearchServiceTest.java index af9f188cf..eef05a6fc 100644 --- a/src/test/java/org/folio/search/service/SearchServiceTest.java +++ b/src/test/java/org/folio/search/service/SearchServiceTest.java @@ -28,7 +28,7 @@ import org.folio.search.service.metadata.SearchFieldProvider; import org.folio.search.service.setter.SearchResponsePostProcessor; import org.folio.search.utils.TestUtils.TestResource; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/SearchTenantServiceTest.java b/src/test/java/org/folio/search/service/SearchTenantServiceTest.java index 5076ba8d1..45b28b390 100644 --- a/src/test/java/org/folio/search/service/SearchTenantServiceTest.java +++ b/src/test/java/org/folio/search/service/SearchTenantServiceTest.java @@ -26,7 +26,7 @@ import org.folio.spring.FolioModuleMetadata; import org.folio.spring.liquibase.FolioSpringLiquibase; import org.folio.spring.service.PrepareSystemUserService; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.folio.spring.tools.kafka.KafkaAdminService; import org.folio.tenant.domain.dto.Parameter; import org.folio.tenant.domain.dto.TenantAttributes; diff --git a/src/test/java/org/folio/search/service/browse/AbstractBrowseServiceBySearchAfterTest.java b/src/test/java/org/folio/search/service/browse/AbstractBrowseServiceBySearchAfterTest.java index 37c7fb78c..0907701cc 100644 --- a/src/test/java/org/folio/search/service/browse/AbstractBrowseServiceBySearchAfterTest.java +++ b/src/test/java/org/folio/search/service/browse/AbstractBrowseServiceBySearchAfterTest.java @@ -6,7 +6,7 @@ import org.folio.search.model.SearchResult; import org.folio.search.model.service.BrowseContext; import org.folio.search.model.service.BrowseRequest; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.opensearch.search.builder.SearchSourceBuilder; diff --git a/src/test/java/org/folio/search/service/browse/AuthorityBrowseServiceTest.java b/src/test/java/org/folio/search/service/browse/AuthorityBrowseServiceTest.java index d51b2226d..ed5ae34d8 100644 --- a/src/test/java/org/folio/search/service/browse/AuthorityBrowseServiceTest.java +++ b/src/test/java/org/folio/search/service/browse/AuthorityBrowseServiceTest.java @@ -35,7 +35,7 @@ import org.folio.search.service.converter.ElasticsearchDocumentConverter; import org.folio.search.service.metadata.SearchFieldProvider; import org.folio.search.service.setter.SearchResponsePostProcessor; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/browse/BrowseContextProviderTest.java b/src/test/java/org/folio/search/service/browse/BrowseContextProviderTest.java index aecbcf077..b9508d2ff 100644 --- a/src/test/java/org/folio/search/service/browse/BrowseContextProviderTest.java +++ b/src/test/java/org/folio/search/service/browse/BrowseContextProviderTest.java @@ -17,7 +17,7 @@ import org.folio.search.exception.RequestValidationException; import org.folio.search.model.service.BrowseContext; import org.folio.search.model.service.BrowseRequest; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/browse/CallNumberBrowseQueryProviderTest.java b/src/test/java/org/folio/search/service/browse/CallNumberBrowseQueryProviderTest.java index 27fcc3c70..eb7c596e5 100644 --- a/src/test/java/org/folio/search/service/browse/CallNumberBrowseQueryProviderTest.java +++ b/src/test/java/org/folio/search/service/browse/CallNumberBrowseQueryProviderTest.java @@ -31,7 +31,7 @@ import org.folio.search.service.consortium.ConsortiumSearchHelper; import org.folio.search.service.metadata.SearchFieldProvider; import org.folio.search.utils.CallNumberUtils; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/browse/CallNumberBrowseRangeServiceTest.java b/src/test/java/org/folio/search/service/browse/CallNumberBrowseRangeServiceTest.java index 2dd03f9ed..54a836aa4 100644 --- a/src/test/java/org/folio/search/service/browse/CallNumberBrowseRangeServiceTest.java +++ b/src/test/java/org/folio/search/service/browse/CallNumberBrowseRangeServiceTest.java @@ -26,7 +26,7 @@ import org.folio.search.model.service.CallNumberBrowseRangeValue; import org.folio.search.repository.SearchRepository; import org.folio.search.utils.CallNumberUtils; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/browse/CallNumberBrowseResultConverterTest.java b/src/test/java/org/folio/search/service/browse/CallNumberBrowseResultConverterTest.java index f3955471f..77b4183db 100644 --- a/src/test/java/org/folio/search/service/browse/CallNumberBrowseResultConverterTest.java +++ b/src/test/java/org/folio/search/service/browse/CallNumberBrowseResultConverterTest.java @@ -29,7 +29,7 @@ import org.folio.search.model.service.BrowseContext; import org.folio.search.service.consortium.FeatureConfigServiceDecorator; import org.folio.search.service.converter.ElasticsearchDocumentConverter; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/browse/CallNumberBrowseServiceTest.java b/src/test/java/org/folio/search/service/browse/CallNumberBrowseServiceTest.java index af4edeeb8..2feeb0f00 100644 --- a/src/test/java/org/folio/search/service/browse/CallNumberBrowseServiceTest.java +++ b/src/test/java/org/folio/search/service/browse/CallNumberBrowseServiceTest.java @@ -33,7 +33,7 @@ import org.folio.search.model.service.BrowseRequest; import org.folio.search.model.types.CallNumberType; import org.folio.search.repository.SearchRepository; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/browse/ContributorBrowseServiceTest.java b/src/test/java/org/folio/search/service/browse/ContributorBrowseServiceTest.java index dc6dc4bcd..9ce20a4e0 100644 --- a/src/test/java/org/folio/search/service/browse/ContributorBrowseServiceTest.java +++ b/src/test/java/org/folio/search/service/browse/ContributorBrowseServiceTest.java @@ -18,7 +18,7 @@ import org.folio.search.model.service.BrowseContext; import org.folio.search.model.service.BrowseRequest; import org.folio.search.service.consortium.ConsortiumSearchHelper; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/service/browse/SubjectBrowseServiceTest.java b/src/test/java/org/folio/search/service/browse/SubjectBrowseServiceTest.java index 45a3cb11a..5f4182a34 100644 --- a/src/test/java/org/folio/search/service/browse/SubjectBrowseServiceTest.java +++ b/src/test/java/org/folio/search/service/browse/SubjectBrowseServiceTest.java @@ -32,7 +32,7 @@ import org.folio.search.service.consortium.ConsortiumSearchHelper; import org.folio.search.service.converter.ElasticsearchDocumentConverter; import org.folio.search.service.setter.SearchResponsePostProcessor; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/consortium/ConsortiaServiceTest.java b/src/test/java/org/folio/search/service/consortium/ConsortiaServiceTest.java index 97865486f..57c7e5c4f 100644 --- a/src/test/java/org/folio/search/service/consortium/ConsortiaServiceTest.java +++ b/src/test/java/org/folio/search/service/consortium/ConsortiaServiceTest.java @@ -8,7 +8,7 @@ import java.util.Collections; import org.folio.search.client.UserTenantsClient; import org.folio.spring.FolioExecutionContext; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/consortium/ConsortiumInstanceRepositoryIT.java b/src/test/java/org/folio/search/service/consortium/ConsortiumInstanceRepositoryIT.java index a6db79184..4eca15e48 100644 --- a/src/test/java/org/folio/search/service/consortium/ConsortiumInstanceRepositoryIT.java +++ b/src/test/java/org/folio/search/service/consortium/ConsortiumInstanceRepositoryIT.java @@ -18,8 +18,8 @@ import org.folio.search.domain.dto.Item; import org.folio.spring.FolioExecutionContext; import org.folio.spring.FolioModuleMetadata; -import org.folio.spring.test.extension.EnablePostgres; -import org.folio.spring.test.type.IntegrationTest; +import org.folio.spring.testing.extension.EnablePostgres; +import org.folio.spring.testing.type.IntegrationTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/test/java/org/folio/search/service/consortium/ConsortiumInstanceServiceTest.java b/src/test/java/org/folio/search/service/consortium/ConsortiumInstanceServiceTest.java index d6e4c0811..1e8915d38 100644 --- a/src/test/java/org/folio/search/service/consortium/ConsortiumInstanceServiceTest.java +++ b/src/test/java/org/folio/search/service/consortium/ConsortiumInstanceServiceTest.java @@ -28,7 +28,7 @@ import org.folio.search.model.event.ConsortiumInstanceEvent; import org.folio.search.utils.JsonConverter; import org.folio.spring.FolioExecutionContext; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.folio.spring.tools.kafka.FolioMessageProducer; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/service/consortium/ConsortiumSearchHelperTest.java b/src/test/java/org/folio/search/service/consortium/ConsortiumSearchHelperTest.java index 6e079c895..739087209 100644 --- a/src/test/java/org/folio/search/service/consortium/ConsortiumSearchHelperTest.java +++ b/src/test/java/org/folio/search/service/consortium/ConsortiumSearchHelperTest.java @@ -22,7 +22,7 @@ import org.folio.search.model.index.SubjectResource; import org.folio.search.model.service.BrowseContext; import org.folio.spring.FolioExecutionContext; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/consortium/ConsortiumTenantExecutorTest.java b/src/test/java/org/folio/search/service/consortium/ConsortiumTenantExecutorTest.java index 6cb803995..681c8d01c 100644 --- a/src/test/java/org/folio/search/service/consortium/ConsortiumTenantExecutorTest.java +++ b/src/test/java/org/folio/search/service/consortium/ConsortiumTenantExecutorTest.java @@ -14,7 +14,7 @@ import java.util.function.Supplier; import org.folio.spring.FolioExecutionContext; import org.folio.spring.service.SystemUserScopedExecutionService; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/consortium/ConsortiumTenantProviderTest.java b/src/test/java/org/folio/search/service/consortium/ConsortiumTenantProviderTest.java index 0312390ca..cb51734bb 100644 --- a/src/test/java/org/folio/search/service/consortium/ConsortiumTenantProviderTest.java +++ b/src/test/java/org/folio/search/service/consortium/ConsortiumTenantProviderTest.java @@ -6,7 +6,7 @@ import static org.mockito.Mockito.when; import java.util.Optional; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/consortium/FeatureConfigServiceDecoratorTest.java b/src/test/java/org/folio/search/service/consortium/FeatureConfigServiceDecoratorTest.java index 66d27ea8d..69070847d 100644 --- a/src/test/java/org/folio/search/service/consortium/FeatureConfigServiceDecoratorTest.java +++ b/src/test/java/org/folio/search/service/consortium/FeatureConfigServiceDecoratorTest.java @@ -9,7 +9,7 @@ import org.folio.search.domain.dto.FeatureConfigs; import org.folio.search.domain.dto.TenantConfiguredFeature; import org.folio.search.service.FeatureConfigService; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/consortium/LanguageConfigServiceDecoratorTest.java b/src/test/java/org/folio/search/service/consortium/LanguageConfigServiceDecoratorTest.java index 0ea43e327..2fa1200b0 100644 --- a/src/test/java/org/folio/search/service/consortium/LanguageConfigServiceDecoratorTest.java +++ b/src/test/java/org/folio/search/service/consortium/LanguageConfigServiceDecoratorTest.java @@ -11,7 +11,7 @@ import org.folio.search.domain.dto.LanguageConfig; import org.folio.search.domain.dto.LanguageConfigs; import org.folio.search.service.LanguageConfigService; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/converter/ElasticsearchDocumentConverterTest.java b/src/test/java/org/folio/search/service/converter/ElasticsearchDocumentConverterTest.java index 82ba1e43b..435c3d95d 100644 --- a/src/test/java/org/folio/search/service/converter/ElasticsearchDocumentConverterTest.java +++ b/src/test/java/org/folio/search/service/converter/ElasticsearchDocumentConverterTest.java @@ -30,7 +30,7 @@ import org.folio.search.domain.dto.SeriesItem; import org.folio.search.model.SearchResult; import org.folio.search.utils.TestUtils.TestResource; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/converter/ElasticsearchFacetConverterTest.java b/src/test/java/org/folio/search/service/converter/ElasticsearchFacetConverterTest.java index 3615da284..8b0170bc4 100644 --- a/src/test/java/org/folio/search/service/converter/ElasticsearchFacetConverterTest.java +++ b/src/test/java/org/folio/search/service/converter/ElasticsearchFacetConverterTest.java @@ -19,7 +19,7 @@ import java.util.stream.Stream; import org.folio.search.domain.dto.Facet; import org.folio.search.domain.dto.FacetItem; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/converter/FacetQueryBuilderTest.java b/src/test/java/org/folio/search/service/converter/FacetQueryBuilderTest.java index a9c4416f9..d13420d1a 100644 --- a/src/test/java/org/folio/search/service/converter/FacetQueryBuilderTest.java +++ b/src/test/java/org/folio/search/service/converter/FacetQueryBuilderTest.java @@ -27,7 +27,7 @@ import org.folio.search.model.service.CqlFacetRequest; import org.folio.search.service.metadata.SearchFieldProvider; import org.folio.search.utils.TestUtils; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/converter/MultiTenantSearchDocumentConverterTest.java b/src/test/java/org/folio/search/service/converter/MultiTenantSearchDocumentConverterTest.java index 2bc8d6cd7..d78b47148 100644 --- a/src/test/java/org/folio/search/service/converter/MultiTenantSearchDocumentConverterTest.java +++ b/src/test/java/org/folio/search/service/converter/MultiTenantSearchDocumentConverterTest.java @@ -37,7 +37,7 @@ import org.folio.search.service.converter.preprocessor.EventPreProcessor; import org.folio.search.service.metadata.ResourceDescriptionService; import org.folio.spring.FolioExecutionContext; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -134,7 +134,7 @@ void convert_positive_eventWithCustomEventPreProcessor() { when(resourceDescriptionService.find(RESOURCE_NAME)).thenReturn(of(resourceDescriptionWithPreProcessor())); when(searchDocumentConverter.convert(event)).thenReturn(of(searchDocument)); when(eventPreProcessorBeans.get(CUSTOM_PRE_PROCESSOR)).thenReturn(customEventPreProcessor); - when(customEventPreProcessor.process(event)).thenReturn(List.of(event)); + when(customEventPreProcessor.preProcess(event)).thenReturn(List.of(event)); when(executionService.execute(eq(TENANT_ID), any())).thenAnswer(invocation -> invocation.>>getArgument(1).get()); diff --git a/src/test/java/org/folio/search/service/converter/SearchDocumentConverterTest.java b/src/test/java/org/folio/search/service/converter/SearchDocumentConverterTest.java index 9bc80bfa0..fafaa7e0d 100644 --- a/src/test/java/org/folio/search/service/converter/SearchDocumentConverterTest.java +++ b/src/test/java/org/folio/search/service/converter/SearchDocumentConverterTest.java @@ -45,7 +45,7 @@ import org.folio.search.service.metadata.ResourceDescriptionService; import org.folio.search.utils.JsonConverter; import org.folio.search.utils.SmileConverter; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/converter/SearchFieldsProcessorTest.java b/src/test/java/org/folio/search/service/converter/SearchFieldsProcessorTest.java index 7bdeb0226..b0125130c 100644 --- a/src/test/java/org/folio/search/service/converter/SearchFieldsProcessorTest.java +++ b/src/test/java/org/folio/search/service/converter/SearchFieldsProcessorTest.java @@ -25,7 +25,7 @@ import org.folio.search.service.converter.SearchFieldsProcessorTest.TestContextConfiguration; import org.folio.search.service.setter.FieldProcessor; import org.folio.search.utils.JsonConverter; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessorTest.java b/src/test/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessorTest.java index 2e3f1b05a..612394815 100644 --- a/src/test/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessorTest.java +++ b/src/test/java/org/folio/search/service/converter/preprocessor/AuthorityEventPreProcessorTest.java @@ -31,7 +31,7 @@ import org.folio.search.service.consortium.ConsortiumTenantService; import org.folio.search.service.metadata.ResourceDescriptionService; import org.folio.search.utils.TestUtils; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -60,7 +60,7 @@ void setUp() { @Test void process_positive() { var authority = fullAuthorityRecord(); - var actual = eventPreProcessor.process(resourceEvent(AUTHORITY_RESOURCE, toMap(authority))); + var actual = eventPreProcessor.preProcess(resourceEvent(AUTHORITY_RESOURCE, toMap(authority))); assertThat(actual).isEqualTo(List.of( event("personalName0", expectedAuthorityAsMap(authority, "personalName")), event("sftPersonalName0", expectedAuthorityAsMap(authority, "sftPersonalName[0]")), @@ -87,7 +87,7 @@ void process_positive() { @Test void process_positive_onlyPersonalIsPopulated() { var authority = new Authority().id(RESOURCE_ID).personalName("a personal name"); - var actual = eventPreProcessor.process(resourceEvent(AUTHORITY_RESOURCE, toMap(authority))); + var actual = eventPreProcessor.preProcess(resourceEvent(AUTHORITY_RESOURCE, toMap(authority))); assertThat(actual).isEqualTo(List.of( event("personalName0", expectedAuthorityAsMap(authority, "personalName")))); } @@ -96,7 +96,7 @@ void process_positive_onlyPersonalIsPopulated() { void process_positive_reindexEvent() { var authority = new Authority().id(RESOURCE_ID).uniformTitle("uniform title"); var event = resourceEvent(AUTHORITY_RESOURCE, toMap(authority)).type(REINDEX); - var actual = eventPreProcessor.process(event); + var actual = eventPreProcessor.preProcess(event); assertThat(actual).isEqualTo(List.of( event("uniformTitle0", expectedAuthorityAsMap(authority, "uniformTitle")).type(REINDEX))); } @@ -105,7 +105,7 @@ void process_positive_reindexEvent() { void process_positive_onlyCommonFieldsArePopulated() { var authority = new Authority().id(RESOURCE_ID).subjectHeadings("a subject headings") .identifiers(List.of(new Identifiers().value("an authority identifier"))); - var actual = eventPreProcessor.process(resourceEvent(AUTHORITY_RESOURCE, toMap(authority))); + var actual = eventPreProcessor.preProcess(resourceEvent(AUTHORITY_RESOURCE, toMap(authority))); assertThat(actual).isEqualTo(List.of(event("other0", expectedAuthorityAsMap(authority)))); } @@ -113,7 +113,7 @@ void process_positive_onlyCommonFieldsArePopulated() { void process_positive_deleteEvent() { var oldAuthority = new Authority().id(RESOURCE_ID).personalName("personal").corporateNameTitle("corporate"); var event = resourceEvent(AUTHORITY_RESOURCE, null).type(DELETE).old(toMap(oldAuthority)); - var actual = eventPreProcessor.process(event); + var actual = eventPreProcessor.preProcess(event); assertThat(actual).isEqualTo(List.of(deleteEvent("personalName0"), deleteEvent("corporateNameTitle0"))); } @@ -124,7 +124,7 @@ void process_positive_updateEvent() { var oldAuthority = new Authority().id(RESOURCE_ID).personalNameTitle("personal").uniformTitle("uniform title") .saftCorporateNameTitle(List.of("saft corp 1", "saft corp 2")); var event = resourceEvent(AUTHORITY_RESOURCE, toMap(newAuthority)).type(UPDATE).old(toMap(oldAuthority)); - var actual = eventPreProcessor.process(event); + var actual = eventPreProcessor.preProcess(event); assertThat(actual).isEqualTo(List.of( event("personalNameTitle0", expectedAuthorityAsMap(newAuthority, "personalNameTitle")), event("corporateNameTitle0", expectedAuthorityAsMap(newAuthority, "corporateNameTitle")), @@ -140,7 +140,7 @@ void process_positive_shouldSetSharedFlag() { when(consortiumTenantService.getCentralTenant(TENANT_ID)).thenReturn(Optional.of(TENANT_ID)); - var actual = eventPreProcessor.process(event); + var actual = eventPreProcessor.preProcess(event); assertThat(actual).isEqualTo(List.of( event("personalNameTitle0", expectedAuthorityAsMap(newAuthority, true, "personalNameTitle")))); } diff --git a/src/test/java/org/folio/search/service/converter/preprocessor/InstanceEventPreProcessorTest.java b/src/test/java/org/folio/search/service/converter/preprocessor/InstanceEventPreProcessorTest.java new file mode 100644 index 000000000..6eced2129 --- /dev/null +++ b/src/test/java/org/folio/search/service/converter/preprocessor/InstanceEventPreProcessorTest.java @@ -0,0 +1,262 @@ +package org.folio.search.service.converter.preprocessor; + +import static java.util.Collections.emptyList; +import static org.assertj.core.api.AssertionsForClassTypes.tuple; +import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; +import static org.folio.search.domain.dto.ResourceEventType.CREATE; +import static org.folio.search.domain.dto.ResourceEventType.DELETE; +import static org.folio.search.domain.dto.ResourceEventType.UPDATE; +import static org.folio.search.utils.SearchUtils.CLASSIFICATIONS_FIELD; +import static org.folio.search.utils.SearchUtils.CLASSIFICATION_NUMBER_FIELD; +import static org.folio.search.utils.SearchUtils.CLASSIFICATION_TYPE_FIELD; +import static org.folio.search.utils.SearchUtils.ID_FIELD; +import static org.folio.search.utils.SearchUtils.INSTANCE_RESOURCE; +import static org.folio.search.utils.SearchUtils.SOURCE_CONSORTIUM_PREFIX; +import static org.folio.search.utils.SearchUtils.SOURCE_FIELD; +import static org.folio.search.utils.TestConstants.TENANT_ID; +import static org.folio.search.utils.TestUtils.mapOf; +import static org.folio.search.utils.TestUtils.randomId; +import static org.folio.search.utils.TestUtils.resourceEvent; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Function; +import org.folio.search.domain.dto.ResourceEventType; +import org.folio.search.domain.dto.TenantConfiguredFeature; +import org.folio.search.repository.classification.InstanceClassificationEntity; +import org.folio.search.repository.classification.InstanceClassificationRepository; +import org.folio.search.service.FeatureConfigService; +import org.folio.search.service.consortium.ConsortiumTenantService; +import org.folio.spring.testing.type.UnitTest; +import org.jetbrains.annotations.NotNull; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +@UnitTest +@ExtendWith(MockitoExtension.class) +class InstanceEventPreProcessorTest { + + @SuppressWarnings("unchecked") + private static final Function[] ENTITY_FIELD_EXTRACTORS = new Function[] { + (Function) InstanceClassificationEntity::type, + (Function) InstanceClassificationEntity::number, + (Function) InstanceClassificationEntity::tenantId, + (Function) InstanceClassificationEntity::instanceId, + (Function) InstanceClassificationEntity::shared + }; + + private @Mock FeatureConfigService featureConfigService; + private @Mock ConsortiumTenantService consortiumTenantService; + private @Mock InstanceClassificationRepository instanceClassificationRepository; + private @InjectMocks InstanceEventPreProcessor preProcessor; + + private @Captor ArgumentCaptor> createCaptor; + private @Captor ArgumentCaptor> deleteCaptor; + + @Test + void preProcess_ShadowInstance_ShouldNotProcessClassifications() { + // Arrange + var data = instance(randomId(), SOURCE_CONSORTIUM_PREFIX + "SOURCE", emptyList()); + var resourceEvent = resourceEvent(INSTANCE_RESOURCE, data); + + // Act + var resourceEvents = preProcessor.preProcess(resourceEvent); + + // Assert + assertThat(resourceEvents) + .hasSize(1) + .containsExactly(resourceEvent); + + verifyNoInteractions(instanceClassificationRepository); + } + + @Test + void preProcess_FeatureIsDisabled_ShouldNotProcessClassifications() { + // Arrange + var data = instance(emptyList()); + var resourceEvent = resourceEvent(INSTANCE_RESOURCE, data); + mockClassificationBrowseFeatureEnabled(Boolean.FALSE); + + // Act + var resourceEvents = preProcessor.preProcess(resourceEvent); + + // Assert + assertThat(resourceEvents) + .hasSize(1) + .containsExactly(resourceEvent); + + verifyNoInteractions(instanceClassificationRepository); + } + + @Test + void preProcess_NoChangeToClassifications_ShouldNotProcessClassifications() { + // Arrange + var newData = instance(List.of(classification("n1", "t1"), classification("n2", "t2"))); + var oldData = instance(List.of(classification("n2", "t2"), classification("n1", "t1"))); + var resourceEvent = resourceEvent(randomId(), INSTANCE_RESOURCE, UPDATE, newData, oldData); + mockClassificationBrowseFeatureEnabled(Boolean.TRUE); + + // Act + var resourceEvents = preProcessor.preProcess(resourceEvent); + + // Assert + assertThat(resourceEvents) + .hasSize(1) + .containsExactly(resourceEvent); + + verifyNoInteractions(instanceClassificationRepository); + } + + @Test + void preProcess_CreateEvent_ShouldProcessClassifications() { + // Arrange + var id = randomId(); + var newData = instance(id, List.of(classification("n1", "t1"), classification("n2", "t2"))); + var resourceEvent = resourceEvent(id, INSTANCE_RESOURCE, CREATE, newData, null); + mockClassificationBrowseFeatureEnabled(Boolean.TRUE); + + // Act + var resourceEvents = preProcessor.preProcess(resourceEvent); + + // Assert + assertThat(resourceEvents) + .hasSize(1) + .containsExactly(resourceEvent); + + verify(instanceClassificationRepository).saveAll(createCaptor.capture()); + + assertThat(createCaptor.getValue()) + .extracting(ENTITY_FIELD_EXTRACTORS) + .containsExactlyInAnyOrder(tuple("t1", "n1", TENANT_ID, id, false), tuple("t2", "n2", TENANT_ID, id, false)); + + verify(instanceClassificationRepository).deleteAll(emptyList()); + verifyNoMoreInteractions(instanceClassificationRepository); + } + + @Test + void preProcess_DeleteEvent_ShouldProcessClassifications() { + // Arrange + var id = randomId(); + var oldData = instance(id, List.of(classification("n1", "t1"), classification("n2", "t2"))); + var resourceEvent = resourceEvent(id, INSTANCE_RESOURCE, DELETE, null, oldData); + mockClassificationBrowseFeatureEnabled(Boolean.TRUE); + + // Act + var resourceEvents = preProcessor.preProcess(resourceEvent); + + // Assert + assertThat(resourceEvents) + .hasSize(1) + .containsExactly(resourceEvent); + + verify(instanceClassificationRepository).deleteAll(deleteCaptor.capture()); + + assertThat(deleteCaptor.getValue()) + .extracting(ENTITY_FIELD_EXTRACTORS) + .containsExactlyInAnyOrder(tuple("t1", "n1", TENANT_ID, id, false), tuple("t2", "n2", TENANT_ID, id, false)); + + verify(instanceClassificationRepository).saveAll(emptyList()); + verifyNoMoreInteractions(instanceClassificationRepository); + } + + @Test + void preProcess_UpdateEvent_ShouldProcessClassifications() { + // Arrange + var id = randomId(); + var newData = instance(id, List.of(classification("n1", "t1"), classification("n3", "t3"))); + var oldData = instance(id, List.of(classification("n1", "t1"), classification("n4", "t4"))); + var resourceEvent = resourceEvent(id, INSTANCE_RESOURCE, DELETE, newData, oldData); + mockClassificationBrowseFeatureEnabled(Boolean.TRUE); + + // Act + var resourceEvents = preProcessor.preProcess(resourceEvent); + + // Assert + assertThat(resourceEvents) + .hasSize(1) + .containsExactly(resourceEvent); + + verify(instanceClassificationRepository).saveAll(createCaptor.capture()); + + assertThat(createCaptor.getValue()) + .extracting(ENTITY_FIELD_EXTRACTORS) + .containsExactlyInAnyOrder(tuple("t3", "n3", TENANT_ID, id, false)); + + verify(instanceClassificationRepository).deleteAll(deleteCaptor.capture()); + assertThat(deleteCaptor.getValue()) + .extracting(ENTITY_FIELD_EXTRACTORS) + .containsExactlyInAnyOrder(tuple("t4", "n4", TENANT_ID, id, false)); + + verifyNoMoreInteractions(instanceClassificationRepository); + } + + @ParameterizedTest + @EnumSource(value = ResourceEventType.class, mode = EnumSource.Mode.INCLUDE, names = {"CREATE", "UPDATE", "DELETE"}) + void preProcess_AnyEventInConsortium_ShouldProcessClassificationsAndSetShared(ResourceEventType eventType) { + // Arrange + var id = randomId(); + var newData = instance(id, List.of(classification("n1", "t1"), classification("n3", "t3"))); + var oldData = instance(id, List.of(classification("n1", "t1"), classification("n4", "t4"))); + var resourceEvent = resourceEvent(id, INSTANCE_RESOURCE, eventType, newData, oldData); + mockClassificationBrowseFeatureEnabled(Boolean.TRUE); + when(consortiumTenantService.getCentralTenant(any())).then(invocation -> Optional.of(invocation.getArgument(0))); + + // Act + var resourceEvents = preProcessor.preProcess(resourceEvent); + + // Assert + assertThat(resourceEvents) + .hasSize(1) + .containsExactly(resourceEvent); + + verify(instanceClassificationRepository).saveAll(createCaptor.capture()); + + assertThat(createCaptor.getValue()) + .extracting(ENTITY_FIELD_EXTRACTORS) + .containsExactlyInAnyOrder(tuple("t3", "n3", TENANT_ID, id, true)); + + verify(instanceClassificationRepository).deleteAll(deleteCaptor.capture()); + assertThat(deleteCaptor.getValue()) + .extracting(ENTITY_FIELD_EXTRACTORS) + .containsExactlyInAnyOrder(tuple("t4", "n4", TENANT_ID, id, true)); + + verifyNoMoreInteractions(instanceClassificationRepository); + } + + private void mockClassificationBrowseFeatureEnabled(Boolean isEnabled) { + when(featureConfigService.isEnabled(TenantConfiguredFeature.BROWSE_CLASSIFICATIONS)).thenReturn(isEnabled); + } + + @NotNull + private static Map instance(List> classifications) { + return instance(randomId(), classifications); + } + + @NotNull + private static Map instance(String id, List> classifications) { + return instance(id, "SOURCE", classifications); + } + + @NotNull + private static Map instance(String id, String source, List> classifications) { + return mapOf(ID_FIELD, id, SOURCE_FIELD, source, CLASSIFICATIONS_FIELD, classifications); + } + + @NotNull + private static Map classification(String number, String type) { + return mapOf(CLASSIFICATION_NUMBER_FIELD, number, CLASSIFICATION_TYPE_FIELD, type); + } +} diff --git a/src/test/java/org/folio/search/service/es/SearchMappingsHelperTest.java b/src/test/java/org/folio/search/service/es/SearchMappingsHelperTest.java index ed5644fd9..1f4be356f 100644 --- a/src/test/java/org/folio/search/service/es/SearchMappingsHelperTest.java +++ b/src/test/java/org/folio/search/service/es/SearchMappingsHelperTest.java @@ -37,7 +37,7 @@ import org.folio.search.service.metadata.SearchFieldProvider; import org.folio.search.utils.JsonConverter; import org.folio.search.utils.TestUtils; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/es/SearchSettingsHelperTest.java b/src/test/java/org/folio/search/service/es/SearchSettingsHelperTest.java index 1b7c9e93d..54209451a 100644 --- a/src/test/java/org/folio/search/service/es/SearchSettingsHelperTest.java +++ b/src/test/java/org/folio/search/service/es/SearchSettingsHelperTest.java @@ -11,7 +11,7 @@ import org.folio.search.exception.ResourceDescriptionException; import org.folio.search.service.metadata.LocalFileProvider; import org.folio.search.utils.JsonConverter; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/metadata/LocalFileProviderTest.java b/src/test/java/org/folio/search/service/metadata/LocalFileProviderTest.java index 34254261c..4331cb801 100644 --- a/src/test/java/org/folio/search/service/metadata/LocalFileProviderTest.java +++ b/src/test/java/org/folio/search/service/metadata/LocalFileProviderTest.java @@ -18,7 +18,7 @@ import lombok.NoArgsConstructor; import org.apache.commons.io.IOUtils; import org.folio.search.utils.JsonConverter; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/metadata/LocalResourceProviderTest.java b/src/test/java/org/folio/search/service/metadata/LocalResourceProviderTest.java index df5b1bf99..83d21eb3e 100644 --- a/src/test/java/org/folio/search/service/metadata/LocalResourceProviderTest.java +++ b/src/test/java/org/folio/search/service/metadata/LocalResourceProviderTest.java @@ -20,7 +20,7 @@ import org.folio.search.model.metadata.ResourceDescription; import org.folio.search.model.metadata.SearchFieldType; import org.folio.search.utils.JsonConverter; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/metadata/LocalSearchFieldProviderTest.java b/src/test/java/org/folio/search/service/metadata/LocalSearchFieldProviderTest.java index e6093a2e6..13d761319 100644 --- a/src/test/java/org/folio/search/service/metadata/LocalSearchFieldProviderTest.java +++ b/src/test/java/org/folio/search/service/metadata/LocalSearchFieldProviderTest.java @@ -33,7 +33,7 @@ import org.folio.search.model.types.ResponseGroupType; import org.folio.search.model.types.SearchType; import org.folio.search.utils.TestUtils; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/src/test/java/org/folio/search/service/metadata/ResourceDescriptionServiceTest.java b/src/test/java/org/folio/search/service/metadata/ResourceDescriptionServiceTest.java index 224b2741d..46fb5afda 100644 --- a/src/test/java/org/folio/search/service/metadata/ResourceDescriptionServiceTest.java +++ b/src/test/java/org/folio/search/service/metadata/ResourceDescriptionServiceTest.java @@ -26,7 +26,7 @@ import org.folio.search.service.metadata.ResourceDescriptionServiceTest.TestContextConfiguration; import org.folio.search.service.setter.FieldProcessor; import org.folio.search.utils.TestUtils; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/test/java/org/folio/search/service/setter/authority/AuthRefTypeProcessorTest.java b/src/test/java/org/folio/search/service/setter/authority/AuthRefTypeProcessorTest.java index 92da2a467..713b6293d 100644 --- a/src/test/java/org/folio/search/service/setter/authority/AuthRefTypeProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/authority/AuthRefTypeProcessorTest.java @@ -8,7 +8,7 @@ import java.util.Optional; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/setter/authority/HeadingRefProcessorTest.java b/src/test/java/org/folio/search/service/setter/authority/HeadingRefProcessorTest.java index fdc3c14ad..2e58ae48e 100644 --- a/src/test/java/org/folio/search/service/setter/authority/HeadingRefProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/authority/HeadingRefProcessorTest.java @@ -14,7 +14,7 @@ import java.util.List; import org.folio.search.domain.dto.Authority; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/setter/authority/HeadingTypeProcessorTest.java b/src/test/java/org/folio/search/service/setter/authority/HeadingTypeProcessorTest.java index a67e8fc96..da01c1905 100644 --- a/src/test/java/org/folio/search/service/setter/authority/HeadingTypeProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/authority/HeadingTypeProcessorTest.java @@ -9,7 +9,7 @@ import java.util.Optional; import org.folio.search.model.metadata.AuthorityFieldDescription; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/service/setter/authority/LccnProcessorTest.java b/src/test/java/org/folio/search/service/setter/authority/LccnProcessorTest.java index 3fc4fba0b..8c79abb73 100644 --- a/src/test/java/org/folio/search/service/setter/authority/LccnProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/authority/LccnProcessorTest.java @@ -18,7 +18,7 @@ import org.folio.search.domain.dto.Identifiers; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/setter/holding/HoldingAllFieldValuesProcessorTest.java b/src/test/java/org/folio/search/service/setter/holding/HoldingAllFieldValuesProcessorTest.java index 7bb158c54..b34d7d242 100644 --- a/src/test/java/org/folio/search/service/setter/holding/HoldingAllFieldValuesProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/holding/HoldingAllFieldValuesProcessorTest.java @@ -18,7 +18,7 @@ import org.folio.search.domain.dto.Tags; import org.folio.search.model.service.MultilangValue; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/setter/holding/HoldingsCallNumberComponentsProcessorTest.java b/src/test/java/org/folio/search/service/setter/holding/HoldingsCallNumberComponentsProcessorTest.java index 97d8fa230..94a3935a2 100644 --- a/src/test/java/org/folio/search/service/setter/holding/HoldingsCallNumberComponentsProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/holding/HoldingsCallNumberComponentsProcessorTest.java @@ -5,7 +5,7 @@ import java.util.List; import org.folio.search.domain.dto.Holding; import org.folio.search.domain.dto.Instance; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/service/setter/holding/HoldingsIdentifiersProcessorTest.java b/src/test/java/org/folio/search/service/setter/holding/HoldingsIdentifiersProcessorTest.java index 1b22dd54b..30c722d3a 100644 --- a/src/test/java/org/folio/search/service/setter/holding/HoldingsIdentifiersProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/holding/HoldingsIdentifiersProcessorTest.java @@ -10,7 +10,7 @@ import java.util.stream.Stream; import org.folio.search.domain.dto.Holding; import org.folio.search.domain.dto.Instance; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/holding/HoldingsNormalizedCallNumbersProcessorTest.java b/src/test/java/org/folio/search/service/setter/holding/HoldingsNormalizedCallNumbersProcessorTest.java index 450d4df5e..a72846ba7 100644 --- a/src/test/java/org/folio/search/service/setter/holding/HoldingsNormalizedCallNumbersProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/holding/HoldingsNormalizedCallNumbersProcessorTest.java @@ -5,7 +5,7 @@ import java.util.List; import org.folio.search.domain.dto.Holding; import org.folio.search.domain.dto.Instance; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/service/setter/holding/HoldingsPublicNotesProcessorTest.java b/src/test/java/org/folio/search/service/setter/holding/HoldingsPublicNotesProcessorTest.java index 27104f494..1e968bbed 100644 --- a/src/test/java/org/folio/search/service/setter/holding/HoldingsPublicNotesProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/holding/HoldingsPublicNotesProcessorTest.java @@ -10,7 +10,7 @@ import org.folio.search.domain.dto.Holding; import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Note; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/holding/HoldingsTagsProcessorTest.java b/src/test/java/org/folio/search/service/setter/holding/HoldingsTagsProcessorTest.java index d6043f260..a622979bb 100644 --- a/src/test/java/org/folio/search/service/setter/holding/HoldingsTagsProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/holding/HoldingsTagsProcessorTest.java @@ -11,7 +11,7 @@ import org.folio.search.domain.dto.Holding; import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Tags; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/holding/HoldingsTypeIdProcessorTest.java b/src/test/java/org/folio/search/service/setter/holding/HoldingsTypeIdProcessorTest.java index 1ad0d2dae..cd1468858 100644 --- a/src/test/java/org/folio/search/service/setter/holding/HoldingsTypeIdProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/holding/HoldingsTypeIdProcessorTest.java @@ -9,7 +9,7 @@ import java.util.stream.Stream; import org.folio.search.domain.dto.Holding; import org.folio.search.domain.dto.Instance; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/holding/StatisticalCodesProcessorTest.java b/src/test/java/org/folio/search/service/setter/holding/StatisticalCodesProcessorTest.java index 5b9867861..77516b197 100644 --- a/src/test/java/org/folio/search/service/setter/holding/StatisticalCodesProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/holding/StatisticalCodesProcessorTest.java @@ -11,7 +11,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Item; import org.folio.search.service.setter.instance.StatisticalCodesProcessor; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/instance/InstanceAbstractTagsProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/InstanceAbstractTagsProcessorTest.java index 37235c580..ac17d7983 100644 --- a/src/test/java/org/folio/search/service/setter/instance/InstanceAbstractTagsProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/InstanceAbstractTagsProcessorTest.java @@ -9,7 +9,7 @@ import java.util.stream.Stream; import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Tags; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/instance/InstanceAllFieldValuesProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/InstanceAllFieldValuesProcessorTest.java index df1930740..e88b8cb28 100644 --- a/src/test/java/org/folio/search/service/setter/instance/InstanceAllFieldValuesProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/InstanceAllFieldValuesProcessorTest.java @@ -23,7 +23,7 @@ import org.folio.search.domain.dto.Subject; import org.folio.search.model.service.MultilangValue; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/setter/instance/IsbnProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/IsbnProcessorTest.java index 07915a91c..5a27d6c42 100644 --- a/src/test/java/org/folio/search/service/setter/instance/IsbnProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/IsbnProcessorTest.java @@ -20,7 +20,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/setter/instance/IssnProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/IssnProcessorTest.java index 386e06582..03f99c461 100644 --- a/src/test/java/org/folio/search/service/setter/instance/IssnProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/IssnProcessorTest.java @@ -21,7 +21,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/setter/instance/OclcProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/OclcProcessorTest.java index bfc2c865c..285ae8562 100644 --- a/src/test/java/org/folio/search/service/setter/instance/OclcProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/OclcProcessorTest.java @@ -20,7 +20,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/service/setter/instance/PublicNotesProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/PublicNotesProcessorTest.java index 36c029b9f..e1d8aae41 100644 --- a/src/test/java/org/folio/search/service/setter/instance/PublicNotesProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/PublicNotesProcessorTest.java @@ -9,7 +9,7 @@ import java.util.stream.Stream; import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Note; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/instance/SortContributorsProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/SortContributorsProcessorTest.java index d9a1bb8a9..c30fb998e 100644 --- a/src/test/java/org/folio/search/service/setter/instance/SortContributorsProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/SortContributorsProcessorTest.java @@ -6,7 +6,7 @@ import org.folio.search.domain.dto.Contributor; import org.folio.search.domain.dto.Instance; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/service/setter/instance/SortTitleProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/SortTitleProcessorTest.java index 9db2627af..f0171778a 100644 --- a/src/test/java/org/folio/search/service/setter/instance/SortTitleProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/SortTitleProcessorTest.java @@ -5,7 +5,7 @@ import java.util.stream.Stream; import org.folio.search.domain.dto.Instance; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/instance/UniformTitleProcessorTest.java b/src/test/java/org/folio/search/service/setter/instance/UniformTitleProcessorTest.java index 32fbf8e42..c96c559ad 100644 --- a/src/test/java/org/folio/search/service/setter/instance/UniformTitleProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/instance/UniformTitleProcessorTest.java @@ -18,7 +18,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.client.CqlQueryParam; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/setter/item/EffectiveCallNumberComponentsProcessorTest.java b/src/test/java/org/folio/search/service/setter/item/EffectiveCallNumberComponentsProcessorTest.java index ff6f8bb69..069c2537d 100644 --- a/src/test/java/org/folio/search/service/setter/item/EffectiveCallNumberComponentsProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/item/EffectiveCallNumberComponentsProcessorTest.java @@ -6,7 +6,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Item; import org.folio.search.domain.dto.ItemEffectiveCallNumberComponents; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/service/setter/item/ItemAllFieldValuesProcessorTest.java b/src/test/java/org/folio/search/service/setter/item/ItemAllFieldValuesProcessorTest.java index 12c5b2d8d..460da445e 100644 --- a/src/test/java/org/folio/search/service/setter/item/ItemAllFieldValuesProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/item/ItemAllFieldValuesProcessorTest.java @@ -19,7 +19,7 @@ import org.folio.search.domain.dto.Tags; import org.folio.search.model.service.MultilangValue; import org.folio.search.service.metadata.SearchFieldProvider; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/org/folio/search/service/setter/item/ItemCallNumberProcessorTest.java b/src/test/java/org/folio/search/service/setter/item/ItemCallNumberProcessorTest.java index 16dcdab69..9f5c40ea7 100644 --- a/src/test/java/org/folio/search/service/setter/item/ItemCallNumberProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/item/ItemCallNumberProcessorTest.java @@ -5,7 +5,7 @@ import java.util.List; import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Item; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/service/setter/item/ItemEffectiveShelvingOrderProcessorTest.java b/src/test/java/org/folio/search/service/setter/item/ItemEffectiveShelvingOrderProcessorTest.java index 725a4b74a..5112e48f7 100644 --- a/src/test/java/org/folio/search/service/setter/item/ItemEffectiveShelvingOrderProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/item/ItemEffectiveShelvingOrderProcessorTest.java @@ -5,7 +5,7 @@ import java.util.List; import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Item; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/service/setter/item/ItemIdentifiersProcessorTest.java b/src/test/java/org/folio/search/service/setter/item/ItemIdentifiersProcessorTest.java index 2e54189e0..6d7657d8a 100644 --- a/src/test/java/org/folio/search/service/setter/item/ItemIdentifiersProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/item/ItemIdentifiersProcessorTest.java @@ -10,7 +10,7 @@ import java.util.stream.Stream; import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Item; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/item/ItemNormalizedCallNumbersProcessorTest.java b/src/test/java/org/folio/search/service/setter/item/ItemNormalizedCallNumbersProcessorTest.java index 570e95a18..366f77132 100644 --- a/src/test/java/org/folio/search/service/setter/item/ItemNormalizedCallNumbersProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/item/ItemNormalizedCallNumbersProcessorTest.java @@ -6,7 +6,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Item; import org.folio.search.domain.dto.ItemEffectiveCallNumberComponents; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; @UnitTest diff --git a/src/test/java/org/folio/search/service/setter/item/ItemPublicNotesProcessorTest.java b/src/test/java/org/folio/search/service/setter/item/ItemPublicNotesProcessorTest.java index 2fe6fe6cd..3c7048f83 100644 --- a/src/test/java/org/folio/search/service/setter/item/ItemPublicNotesProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/item/ItemPublicNotesProcessorTest.java @@ -11,7 +11,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Item; import org.folio.search.domain.dto.Note; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/item/ItemTagsProcessorTest.java b/src/test/java/org/folio/search/service/setter/item/ItemTagsProcessorTest.java index b4a8fd0bf..adcd12e1e 100644 --- a/src/test/java/org/folio/search/service/setter/item/ItemTagsProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/item/ItemTagsProcessorTest.java @@ -11,7 +11,7 @@ import org.folio.search.domain.dto.Instance; import org.folio.search.domain.dto.Item; import org.folio.search.domain.dto.Tags; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; diff --git a/src/test/java/org/folio/search/service/setter/item/ItemTypedCallNumberProcessorTest.java b/src/test/java/org/folio/search/service/setter/item/ItemTypedCallNumberProcessorTest.java index e194b4cf8..53678d76e 100644 --- a/src/test/java/org/folio/search/service/setter/item/ItemTypedCallNumberProcessorTest.java +++ b/src/test/java/org/folio/search/service/setter/item/ItemTypedCallNumberProcessorTest.java @@ -10,7 +10,7 @@ import org.folio.search.domain.dto.ItemEffectiveCallNumberComponents; import org.folio.search.integration.ReferenceDataService; import org.folio.search.model.types.CallNumberType; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/support/base/BaseIntegrationTest.java b/src/test/java/org/folio/search/support/base/BaseIntegrationTest.java index ff21b2c79..b5d6d1343 100644 --- a/src/test/java/org/folio/search/support/base/BaseIntegrationTest.java +++ b/src/test/java/org/folio/search/support/base/BaseIntegrationTest.java @@ -42,10 +42,10 @@ import org.folio.search.support.extension.EnableElasticSearch; import org.folio.search.utils.TestUtils; import org.folio.spring.integration.XOkapiHeaders; -import org.folio.spring.test.extension.EnableKafka; -import org.folio.spring.test.extension.EnablePostgres; -import org.folio.spring.test.extension.impl.OkapiConfiguration; -import org.folio.spring.test.extension.impl.OkapiExtension; +import org.folio.spring.testing.extension.EnableKafka; +import org.folio.spring.testing.extension.EnablePostgres; +import org.folio.spring.testing.extension.impl.OkapiConfiguration; +import org.folio.spring.testing.extension.impl.OkapiExtension; import org.folio.tenant.domain.dto.TenantAttributes; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; diff --git a/src/test/java/org/folio/search/utils/CallNumberUtilsTest.java b/src/test/java/org/folio/search/utils/CallNumberUtilsTest.java index 70f45877c..2a5a2ae82 100644 --- a/src/test/java/org/folio/search/utils/CallNumberUtilsTest.java +++ b/src/test/java/org/folio/search/utils/CallNumberUtilsTest.java @@ -24,7 +24,7 @@ import org.folio.search.domain.dto.Item; import org.folio.search.domain.dto.ItemEffectiveCallNumberComponents; import org.folio.search.model.service.BrowseContext; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/utils/CollectionUtilsTest.java b/src/test/java/org/folio/search/utils/CollectionUtilsTest.java index c0998c4b0..ca9a9c3e4 100644 --- a/src/test/java/org/folio/search/utils/CollectionUtilsTest.java +++ b/src/test/java/org/folio/search/utils/CollectionUtilsTest.java @@ -29,7 +29,7 @@ import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Stream; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/utils/JsonConverterTest.java b/src/test/java/org/folio/search/utils/JsonConverterTest.java index f15214813..b6e19c8c0 100644 --- a/src/test/java/org/folio/search/utils/JsonConverterTest.java +++ b/src/test/java/org/folio/search/utils/JsonConverterTest.java @@ -19,7 +19,7 @@ import org.apache.commons.lang3.SerializationException; import org.folio.search.utils.TestUtils.NonSerializableByJacksonClass; import org.folio.search.utils.TestUtils.TestClass; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; diff --git a/src/test/java/org/folio/search/utils/SearchConverterUtilsTest.java b/src/test/java/org/folio/search/utils/SearchConverterUtilsTest.java index ae91c1025..f15359c41 100644 --- a/src/test/java/org/folio/search/utils/SearchConverterUtilsTest.java +++ b/src/test/java/org/folio/search/utils/SearchConverterUtilsTest.java @@ -14,7 +14,7 @@ import java.util.List; import java.util.Map; import java.util.stream.Stream; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/utils/SearchQueryUtilsTest.java b/src/test/java/org/folio/search/utils/SearchQueryUtilsTest.java index 86e4b4bd4..bd8fd3071 100644 --- a/src/test/java/org/folio/search/utils/SearchQueryUtilsTest.java +++ b/src/test/java/org/folio/search/utils/SearchQueryUtilsTest.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.stream.Stream; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/utils/SearchUtilsTest.java b/src/test/java/org/folio/search/utils/SearchUtilsTest.java index 3bd393dc1..178976330 100644 --- a/src/test/java/org/folio/search/utils/SearchUtilsTest.java +++ b/src/test/java/org/folio/search/utils/SearchUtilsTest.java @@ -35,7 +35,7 @@ import org.folio.search.exception.SearchOperationException; import org.folio.search.model.index.SearchDocumentBody; import org.folio.search.model.service.MultilangValue; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/org/folio/search/utils/SmileConverterTest.java b/src/test/java/org/folio/search/utils/SmileConverterTest.java index d58e67323..65078496a 100644 --- a/src/test/java/org/folio/search/utils/SmileConverterTest.java +++ b/src/test/java/org/folio/search/utils/SmileConverterTest.java @@ -8,7 +8,7 @@ import org.apache.commons.lang3.SerializationException; import org.folio.search.utils.TestUtils.NonSerializableByJacksonClass; import org.folio.search.utils.TestUtils.TestClass; -import org.folio.spring.test.type.UnitTest; +import org.folio.spring.testing.type.UnitTest; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Spy; diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index f8fc63d2a..850eed092 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -18,6 +18,9 @@ spring: password: s3cret compression-enabled: false datasource: + hikari: + data-source-properties: + reWriteBatchedInserts: true username: folio_admin password: password liquibase: @@ -47,6 +50,7 @@ folio: search-all-fields: false browse-cn-intermediate-values: true browse-cn-intermediate-remove-duplicates: true + browse-classifications: true indexing: instance-subjects: retry-attempts: 3 diff --git a/src/test/resources/log4j2.properties b/src/test/resources/log4j2.properties index 1273b374f..fe3e5704d 100644 --- a/src/test/resources/log4j2.properties +++ b/src/test/resources/log4j2.properties @@ -16,19 +16,28 @@ rootLogger.appenderRef.stdout.ref = STDOUT # Debugging elasticsearch client -loggers=esclient, esclientsniffer, tracer +loggers=esclient, esclientsniffer, tracer, jdbc + +logger.jdbc.name = org.springframework.jdbc.core.JdbcTemplate +logger.jdbc.level = trace +logger.jdbc.additivity = false +logger.jdbc.appenderRefs = stdout +logger.jdbc.appenderRef.stdout.ref = STDOUT logger.esclient.name = org.opensearch.client logger.esclient.level = trace +logger.esclient.additivity = false logger.esclient.appenderRefs = stdout logger.esclient.appenderRef.stdout.ref = STDOUT logger.esclientsniffer.name = org.opensearch.client.sniffer logger.esclientsniffer.level = trace +logger.esclientsniffer.additivity = false logger.esclientsniffer.appenderRefs = stdout logger.esclientsniffer.appenderRef.stdout.ref = STDOUT logger.tracer.name=tracer logger.tracer.level=trace +logger.tracer.additivity = false logger.tracer.appenderRefs = stdout logger.tracer.appenderRef.stdout.ref = STDOUT