File tree Expand file tree Collapse file tree 2 files changed +5
-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 +5
-6
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,6 @@ public class CustomTrustStore {
3131 @ Autowired (required = false )
3232 private S3Client s3Client ;
3333
34- public void setS3Client (S3Client s3Client ) {
35- this .s3Client = s3Client ;
36- }
37-
3834 @ SneakyThrows
3935 public void addToDefault (String trustStorePath , String trustStorePassword ) {
4036 final X509TrustManager defaultTrustManager = getDefaultTrustManager ();
Original file line number Diff line number Diff line change 1212import software .amazon .awssdk .services .s3 .model .CreateBucketRequest ;
1313import software .amazon .awssdk .services .s3 .model .PutObjectRequest ;
1414import java .io .File ;
15+ import java .lang .reflect .Field ;
1516import java .net .URI ;
1617import static org .junit .jupiter .api .Assertions .assertNotNull ;
1718
@@ -53,9 +54,11 @@ static void tearDown() {
5354 }
5455
5556 @ Test
56- void trustManagerLoadsSuccessfullyTest () {
57+ void trustManagerLoadsSuccessfullyTest () throws NoSuchFieldException , IllegalAccessException {
5758
58- customTrustStore .setS3Client (s3Client );
59+ Field s3ClientField = CustomTrustStore .class .getDeclaredField ("s3Client" );
60+ s3ClientField .setAccessible (true );
61+ s3ClientField .set (customTrustStore , s3Client );
5962
6063 String s3Uri = "s3://" + BUCKET_NAME + "/" + TRUSTSTORE_PATH ;
6164
You can’t perform that action at this time.
0 commit comments