diff --git a/attribution-data-file-share/src/test/java/gov/cms/ab2d/attributionDataShare/AttributionDataShareTest.java b/attribution-data-file-share/src/test/java/gov/cms/ab2d/attributionDataShare/AttributionDataShareTest.java index 946361a..c8984e0 100644 --- a/attribution-data-file-share/src/test/java/gov/cms/ab2d/attributionDataShare/AttributionDataShareTest.java +++ b/attribution-data-file-share/src/test/java/gov/cms/ab2d/attributionDataShare/AttributionDataShareTest.java @@ -44,11 +44,6 @@ public class AttributionDataShareTest { @BeforeEach public void beforeEach() { - // var sysMock = Mockito.mockStatic(System.class); - // System.setProperty("S3_UPLOAD_BUCKET", BUCKET_NAME); - // System.setProperty("S3_UPLOAD_PATH", UPLOAD_PATH); -// sysMock.when(() -> System.getProperty(BUCKET_NAME_PROP)).thenReturn(BUCKET_NAME); -// sysMock.when(() -> System.getProperty(UPLOAD_PATH_PROP)).thenReturn(UPLOAD_PATH); helper = spy(new AttributionDataShareHelper(FILE_NAME, FILE_FULL_PATH, LOGGER)); } diff --git a/optout/src/main/java/gov/cms/ab2d/optout/OptOutS3.java b/optout/src/main/java/gov/cms/ab2d/optout/OptOutS3.java index 8e2e815..8e0965c 100644 --- a/optout/src/main/java/gov/cms/ab2d/optout/OptOutS3.java +++ b/optout/src/main/java/gov/cms/ab2d/optout/OptOutS3.java @@ -27,35 +27,6 @@ public OptOutS3(S3Client s3Client, String fileName, String bfdBucket, LambdaLogg this.logger = logger; } - public void doesBucketExist(){ - try { - logger.log("Bucket name: " + bfdBucket); - logger.log("File name: " + fileName); - - HeadBucketRequest headBucketRequest = HeadBucketRequest.builder() - .bucket(bfdBucket).build(); - - s3Client.headBucket(headBucketRequest); - logger.log("Bucket exists"); - - } catch (SdkClientException ex) { - var errorMessage = "Unable to load credentials to connect S3 bucket"; - logger.log(errorMessage); - throw new OptOutException(errorMessage, ex); - } catch (S3Exception ex) { - if (ex.statusCode() == 404) { - - var errorMessage = "Object " + fileName + " does not exist. " + ex.getMessage(); - logger.log(errorMessage); - throw new OptOutException(errorMessage, ex); - } else { - logger.log(ex.getMessage()); - throw ex; - } - } - - } - public BufferedReader openFileS3() { try { //Checking if object exists @@ -131,7 +102,7 @@ public String getOutFileName() { String[] path = fileName.split("in"); - return path[0] + "out/" + name; + return path[0] + "out/" + name; }