File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
main/java/uk/nhs/adaptors/gp2gp/common/configuration
test/java/uk/nhs/adaptors/gp2gp/common/configuration Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change 2525
2626@ Component
2727@ Slf4j
28+ @ SuppressFBWarnings (value = "EI_EXPOSE_REP2" , justification = "S3Client is immutable and thread-safe." )
2829public class CustomTrustStore {
2930
30- private S3Client s3Client ;
31+ private final S3Client s3Client ;
3132
3233 @ Autowired
3334 public CustomTrustStore (S3Client s3Client ) {
Original file line number Diff line number Diff line change 1313import software .amazon .awssdk .services .s3 .model .CreateBucketRequest ;
1414import software .amazon .awssdk .services .s3 .model .PutObjectRequest ;
1515import java .io .File ;
16- import java .lang .reflect .Field ;
1716import java .net .URI ;
1817import static org .junit .jupiter .api .Assertions .assertNotNull ;
1918
@@ -61,10 +60,6 @@ static void tearDown() {
6160 @ Test
6261 void trustManagerLoadsSuccessfullyTest () throws NoSuchFieldException , IllegalAccessException {
6362
64- Field s3ClientField = CustomTrustStore .class .getDeclaredField ("s3Client" );
65- s3ClientField .setAccessible (true );
66- s3ClientField .set (customTrustStore , s3Client );
67-
6863 String s3Uri = "s3://" + BUCKET_NAME + "/" + TRUSTSTORE_PATH ;
6964
7065 var trustManager = customTrustStore .getCustomDbTrustManager (s3Client .utilities ().parseUri (URI .create (s3Uri )), TRUSTSTORE_PASSWORD );
You can’t perform that action at this time.
0 commit comments