diff --git a/provider/storage-aws/src/main/java/org/opengroup/osdu/storage/provider/aws/CloudStorageImpl.java b/provider/storage-aws/src/main/java/org/opengroup/osdu/storage/provider/aws/CloudStorageImpl.java index 007ec26960c45b4ba7446c98c7b31b107d19019b..b9001f9801426f5a2cf5e71f2b5f745dc3b78878 100644 --- a/provider/storage-aws/src/main/java/org/opengroup/osdu/storage/provider/aws/CloudStorageImpl.java +++ b/provider/storage-aws/src/main/java/org/opengroup/osdu/storage/provider/aws/CloudStorageImpl.java @@ -101,7 +101,7 @@ public class CloudStorageImpl implements ICloudStorage { CompletableFuture<List<RecordProcessor>> results = CompletableFuture.allOf(cfs) .thenApply(ignored -> futures.stream() .map(CompletableFuture::join) - .collect(Collectors.toList())); + .toList()); List<RecordProcessor> recordProcessors = results.get(); for(RecordProcessor recordProcessor : recordProcessors){ @@ -112,6 +112,7 @@ public class CloudStorageImpl implements ICloudStorage { , recordProcessor.getRecordId() , recordProcessor.getException().getErrorMessage() )); + throw recordProcessor.getException(); } } } catch (Exception e) { diff --git a/provider/storage-aws/src/test/java/org/opengroup/osdu/storage/provider/aws/CloudStorageImplTest.java b/provider/storage-aws/src/test/java/org/opengroup/osdu/storage/provider/aws/CloudStorageImplTest.java index d52e6e60a09108ef85c3065141930145238d51f1..6123470b365fd99b5601c5392ebebf139e04cda1 100644 --- a/provider/storage-aws/src/test/java/org/opengroup/osdu/storage/provider/aws/CloudStorageImplTest.java +++ b/provider/storage-aws/src/test/java/org/opengroup/osdu/storage/provider/aws/CloudStorageImplTest.java @@ -138,7 +138,18 @@ class CloudStorageImplTest { } @Test - void write_shouldThrowAppException_whenRecordProcessingFails() { + void write_shouldThrowException_whenRecordProcessingHasException() { + when(recordProcessing.getRecordData()).thenReturn(recordData); + doNothing().when(userAccessService).validateRecordAcl(any()); + + when(recordProcessing.getRecordMetadata()).thenReturn(record); + doThrow(AmazonServiceException.class).when(s3RecordClient).saveRecord(recordProcessing, dataPartition); + + assertThrows(AppException.class, () -> repo.write(recordProcessing)); + } + + @Test + void write_shouldThrowAppException_whenRecordProcessingThrowsException() { when(recordProcessing.getRecordData()).thenReturn(recordData); doNothing().when(userAccessService).validateRecordAcl(any()); diff --git a/provider/storage-gc/src/main/resources/application.properties b/provider/storage-gc/src/main/resources/application.properties index 71eaa84449425f7c4fda3bb8ec1368f09d0c83c6..9deef8ec7a2fb5576b028d6e8ff02d7da3d6b968 100644 --- a/provider/storage-gc/src/main/resources/application.properties +++ b/provider/storage-gc/src/main/resources/application.properties @@ -45,7 +45,7 @@ LEGAL_PATH=/api/legal/v1/ LEGALTAG_API=${LEGAL_HOST}${LEGAL_PATH} CRS_CONVERTER_HOST=http://crs-conversion -CRS_CONVERTER_PATH=/api/crs/converter/v2/ +CRS_CONVERTER_PATH=/api/crs/converter/v3 CRS_API=${CRS_CONVERTER_HOST}${CRS_CONVERTER_PATH} # Collaboration context feature flag name : properties specific @@ -57,7 +57,7 @@ management.endpoints.web.base-path=${MANAGEMENT_ENDPOINTS_WEB_BASE:/} management.endpoints.web.exposure.include=health management.health.probes.enabled=true -featureFlag.strategy=appProperty +featureFlag.strategy=dataPartition featureFlag.opa.enabled=${OPA_ENABLED:false} destination.resolver=partition diff --git a/storage-core-plus/src/main/resources/application.properties b/storage-core-plus/src/main/resources/application.properties index 6d10f2d9f1820886c64fdc587b20ecae2f5f6a85..6b0a9254130fe1e49aef529c09f8337d5db5842d 100644 --- a/storage-core-plus/src/main/resources/application.properties +++ b/storage-core-plus/src/main/resources/application.properties @@ -47,7 +47,7 @@ LEGAL_PATH=/api/legal/v1/ LEGALTAG_API=${LEGAL_HOST}${LEGAL_PATH} CRS_CONVERTER_HOST=http://crs-conversion -CRS_CONVERTER_PATH=/api/crs/converter/v2/ +CRS_CONVERTER_PATH=/api/crs/converter/v3/ CRS_API=${CRS_CONVERTER_HOST}${CRS_CONVERTER_PATH} # Collaboration context feature flag name : properties specific