File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
main/java/uk/nhs/adaptors/gp2gp/common/storage
test/java/uk/nhs/adaptors/gp2gp/common/storage Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 55import org .springframework .context .annotation .Bean ;
66import org .springframework .context .annotation .Configuration ;
77
8+ import software .amazon .awssdk .regions .Region ;
89import software .amazon .awssdk .services .s3 .S3Client ;
910
1011import lombok .Getter ;
@@ -26,7 +27,7 @@ public class StorageConnectorConfiguration {
2627 @ Bean
2728 public S3Client getS3Client () {
2829 if (StringUtils .isNotBlank (trustStoreUrl ) && trustStoreUrl .startsWith (S3_PREFIX )) {
29- return S3Client .builder ().build ();
30+ return S3Client .builder ().region ( Region . EU_WEST_2 ). build ();
3031 }
3132
3233 return null ;
Original file line number Diff line number Diff line change 66import org .mockito .MockitoAnnotations ;
77import software .amazon .awssdk .core .ResponseInputStream ;
88import software .amazon .awssdk .core .sync .RequestBody ;
9+ import software .amazon .awssdk .regions .Region ;
910import software .amazon .awssdk .services .s3 .S3Client ;
1011import software .amazon .awssdk .services .s3 .model .GetObjectRequest ;
1112import software .amazon .awssdk .services .s3 .model .GetObjectResponse ;
@@ -49,8 +50,8 @@ void setUp() {
4950
5051
5152 @ Test
52- void expectExceptionWhenS3ClientCantDeliverResponse () {
53- S3StorageConnector storageConnector = new S3StorageConnector (S3Client .builder ().build (), config );
53+ void expectExceptionWhenS3ClientCannotDeliverResponse () {
54+ S3StorageConnector storageConnector = new S3StorageConnector (S3Client .builder ().region ( Region . EU_WEST_2 ). build (), config );
5455 Exception exception = assertThrows (StorageConnectorException .class ,
5556 () -> storageConnector .downloadFromStorage ("s3File" ));
5657
You can’t perform that action at this time.
0 commit comments