Skip to content

Commit

Permalink
ALS-6551: Attempt to fix character encoding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ramari16 committed Aug 14, 2024
1 parent 7dac201 commit 091eab0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.mockito.junit.jupiter.MockitoExtension;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import static org.junit.jupiter.api.Assertions.*;
Expand All @@ -17,6 +18,15 @@ public void writeValidPFB() {
PfbWriter pfbWriter = new PfbWriter(new File("target/test-result.avro"));

pfbWriter.writeHeader(new String[] {"patient_id", "\\demographics\\age\\", "\\phs123\\stroke\\"});
List<List<String>> nullableList = new ArrayList<>();
nullableList.add(List.of("123"));
nullableList.add(null);
nullableList.add(List.of("Y"));
pfbWriter.writeMultiValueEntity(List.of(
nullableList,
List.of(List.of("456"), null ,List.of("N", "Y")),
List.of(List.of(), List.of("75"), List.of())
));
pfbWriter.writeMultiValueEntity(List.of(
List.of(List.of("123"), List.of("80"), List.of("Y")),
List.of(List.of("456"), List.of("70"),List.of("N", "Y")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public ResponseEntity queryResult(@PathVariable("resourceQueryId") UUID queryId,
result.open();
return ResponseEntity.ok()
.contentType(MediaType.TEXT_PLAIN)
.body(new String(result.readAllBytes(), StandardCharsets.UTF_8));
.body(result.readAllBytes());
} else {
return ResponseEntity.status(400).body("Status : " + result.getStatus().name());
}
Expand Down

0 comments on commit 091eab0

Please sign in to comment.