From 67b1b776bbaba098b8e2e05eedfff71a63ee2471 Mon Sep 17 00:00:00 2001 From: Ryan Amari Date: Wed, 20 Nov 2024 10:03:11 -0500 Subject: [PATCH] ALS-7810: Attempt to fix parsing error --- .../hpds/processing/upload/SignUrlService.java | 10 ++++++---- .../avillach/hpds/processing/io/PfbWriterTest.java | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/upload/SignUrlService.java b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/upload/SignUrlService.java index f80ddce3..6c1c66c4 100644 --- a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/upload/SignUrlService.java +++ b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/upload/SignUrlService.java @@ -26,6 +26,8 @@ public class SignUrlService { private final int signedUrlExpiryMinutes; private final Region region; + private final S3Client s3; + private static Logger log = LoggerFactory.getLogger(SignUrlService.class); @Autowired @@ -37,13 +39,13 @@ public SignUrlService( this.bucketName = bucketName; this.signedUrlExpiryMinutes = signedUrlExpiryMinutes; this.region = Region.of(region); - } - public void uploadFile(File file, String objectKey) { - S3Client s3 = S3Client.builder() - .region(region) + s3 = S3Client.builder() + .region(this.region) .build(); + } + public void uploadFile(File file, String objectKey) { putS3Object(s3, bucketName, objectKey, file); s3.close(); } diff --git a/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriterTest.java b/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriterTest.java index 1167a090..2d150d27 100644 --- a/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriterTest.java +++ b/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriterTest.java @@ -28,7 +28,7 @@ public void writeValidPFB() { PfbWriter pfbWriter = new PfbWriter(new File("target/test-result.avro"), UUID.randomUUID().toString(), dictionaryService); Mockito.when(dictionaryService.getConcepts(List.of("patient_id", "\\demographics\\age\\", "\\phs123\\stroke\\"))) - .thenReturn(List.of(new Concept("Categorical", "\\demographics\\age\\", "age", "AGE", "demographics", "patient age", Map.of("drs_uri", "a-drs.uri")))); + .thenReturn(List.of(new Concept("Categorical", "\\demographics\\age\\", "age", "AGE", null, "patient age", Map.of("drs_uri", "[\"a-drs.uri\", \"another-drs.uri\"]")))); pfbWriter.writeHeader(new String[] {"patient_id", "\\demographics\\age\\", "\\phs123\\stroke\\"}); List> nullableList = new ArrayList<>();