diff --git a/provider/indexer-gcp/src/main/resources/application.properties b/provider/indexer-gcp/src/main/resources/application.properties index 6bf28172052fe1b278d0451fc14c44ec7b4d64e6..06d81a1e4504e68c74c75c5e5c3caefd470b4eab 100644 --- a/provider/indexer-gcp/src/main/resources/application.properties +++ b/provider/indexer-gcp/src/main/resources/application.properties @@ -31,6 +31,10 @@ gae-service=indexer key-ring=csqp kms-key=searchService +KEY_RING=${key-ring} +KMS_KEY=${kms-key} +GOOGLE_CLOUD_PROJECT=${google-cloud-project} + elastic-datastore-kind=SearchSettings elastic-datastore-id=indexer-service diff --git a/provider/indexer-gcp/src/test/java/org/opengroup/osdu/indexer/service/CronServiceImplTest.java b/provider/indexer-gcp/src/test/java/org/opengroup/osdu/indexer/service/CronServiceImplTest.java index 39ad6fb0eebd03b8540c606318bc5e29eb007aab..f839c8d2f25e550df8ee3e631a1c96c6b826ff66 100644 --- a/provider/indexer-gcp/src/test/java/org/opengroup/osdu/indexer/service/CronServiceImplTest.java +++ b/provider/indexer-gcp/src/test/java/org/opengroup/osdu/indexer/service/CronServiceImplTest.java @@ -26,10 +26,10 @@ import org.opengroup.osdu.core.common.model.search.IndexInfo; import org.opengroup.osdu.core.common.logging.JaxRsDpsLog; import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo; import org.opengroup.osdu.core.common.search.IndicesService; +import org.opengroup.osdu.indexer.config.IndexerConfigurationProperties; import org.opengroup.osdu.indexer.util.ElasticClientHandler; import org.powermock.core.classloader.annotations.PrepareForTest; import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.util.ReflectionTestUtils; import java.io.IOException; import java.time.Instant; @@ -49,6 +49,8 @@ public class CronServiceImplTest { @Mock private ElasticClientHandler elasticClientHandler; @Mock + private IndexerConfigurationProperties configurationProperties; + @Mock private IRequestInfo requestInfo; @Mock private JaxRsDpsLog log; @@ -63,8 +65,8 @@ public class CronServiceImplTest { when(this.requestInfo.getHeaders()).thenReturn(dpsHeaders); - ReflectionTestUtils.setField(this.sut, "CRON_INDEX_CLEANUP_THRESHOLD_DAYS", "3"); - ReflectionTestUtils.setField(this.sut, "CRON_EMPTY_INDEX_CLEANUP_THRESHOLD_DAYS", "7"); + when(configurationProperties.getCronIndexCleanupThresholdDays()).thenReturn(3); + when(configurationProperties.getCronEmptyIndexCleanupThresholdDays()).thenReturn(3); } @Test diff --git a/provider/indexer-gcp/src/test/java/org/opengroup/osdu/indexer/service/StorageServiceTest.java b/provider/indexer-gcp/src/test/java/org/opengroup/osdu/indexer/service/StorageServiceTest.java index e868e50c842262a4eba35f2fa49cad1c2aae3cf6..3ffbbbd4cdd40f018ba41288a6fdf4e67a044d3a 100644 --- a/provider/indexer-gcp/src/test/java/org/opengroup/osdu/indexer/service/StorageServiceTest.java +++ b/provider/indexer-gcp/src/test/java/org/opengroup/osdu/indexer/service/StorageServiceTest.java @@ -36,9 +36,9 @@ import org.opengroup.osdu.core.common.http.IUrlFetchService; import org.opengroup.osdu.core.common.model.indexer.RecordQueryResponse; import org.opengroup.osdu.core.common.model.indexer.RecordReindexRequest; import org.opengroup.osdu.core.common.model.indexer.Records; +import org.opengroup.osdu.indexer.config.IndexerConfigurationProperties; import org.springframework.http.HttpStatus; import org.springframework.test.context.junit4.SpringRunner; -import org.springframework.test.util.ReflectionTestUtils; import java.lang.reflect.Type; import java.net.URISyntaxException; @@ -64,6 +64,8 @@ public class StorageServiceTest { private JaxRsDpsLog log; @Mock private IRequestInfo requestInfo; + @Mock + private IndexerConfigurationProperties configurationProperties; @InjectMocks private StorageServiceImpl sut; @@ -86,7 +88,7 @@ public class StorageServiceTest { jobStatus.initialize(msgs); ids = Arrays.asList(RECORD_ID1, RECORDS_ID2); - ReflectionTestUtils.setField(this.sut, "STORAGE_RECORDS_BATCH_SIZE", "20"); + when(configurationProperties.getStorageRecordsBatchSize()).thenReturn(20); } @Test