Skip to content

Commit 1d376d2

Browse files
committed
suppress false positive alarms sent by spotbugs
1 parent 994587f commit 1d376d2

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

service/src/main/java/uk/nhs/adaptors/gp2gp/common/configuration/CustomTrustStore.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525

2626
@Component
2727
@Slf4j
28+
@SuppressFBWarnings(value = "EI_EXPOSE_REP2", justification = "S3Client is immutable and thread-safe.")
2829
public class CustomTrustStore {
2930

30-
private S3Client s3Client;
31+
private final S3Client s3Client;
3132

3233
@Autowired
3334
public CustomTrustStore(S3Client s3Client) {

service/src/test/java/uk/nhs/adaptors/gp2gp/common/configuration/CustomTrustStoreTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import software.amazon.awssdk.services.s3.model.CreateBucketRequest;
1414
import software.amazon.awssdk.services.s3.model.PutObjectRequest;
1515
import java.io.File;
16-
import java.lang.reflect.Field;
1716
import java.net.URI;
1817
import 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);

0 commit comments

Comments
 (0)