From 4159b5940eaa772300509526d5763c4b3c4f6a29 Mon Sep 17 00:00:00 2001 From: Matt Busche Date: Wed, 31 Jul 2024 17:56:09 -0500 Subject: [PATCH] open rewrite updates (#419) --- src/main/java/trap/report/DownloadHelper.java | 4 ++-- src/test/java/trap/report/TrapHelperTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/trap/report/DownloadHelper.java b/src/main/java/trap/report/DownloadHelper.java index 352603e..982ec6e 100644 --- a/src/main/java/trap/report/DownloadHelper.java +++ b/src/main/java/trap/report/DownloadHelper.java @@ -8,7 +8,7 @@ import java.net.URI; import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import java.nio.file.Paths; +import java.nio.file.Path; import java.util.HashMap; import java.util.Map; @@ -30,7 +30,7 @@ public void downloadFiles(String[] trapTypes) throws IOException { logger.info("Finished downloading {} file", type); logger.info("Replacing double spaces for {} file", type); - var path = Paths.get(type + ".csv"); + var path = Path.of(type + ".csv"); var content = Files.readString(path, charset).replaceAll(" {2}", " "); Files.writeString(path, content, charset); logger.info("Finished replacing double spaces for {} file", type); diff --git a/src/test/java/trap/report/TrapHelperTest.java b/src/test/java/trap/report/TrapHelperTest.java index 2d48726..545acb0 100644 --- a/src/test/java/trap/report/TrapHelperTest.java +++ b/src/test/java/trap/report/TrapHelperTest.java @@ -121,14 +121,14 @@ void testPlayerIndividualTotals() { var player1 = playerIndividualTotal.get(roundScoresPlayer1.getFirst().getUniqueName()); assertEquals(4, player1.size()); - assertEquals(49, player1.get(0).getTotal()); + assertEquals(49, player1.getFirst().getTotal()); assertEquals(48, player1.get(1).getTotal()); assertEquals(48, player1.get(2).getTotal()); assertEquals(48, player1.get(3).getTotal()); var player2 = playerIndividualTotal.get(roundScoresPlayer2.getFirst().getUniqueName()); assertEquals(4, player2.size()); - assertEquals(49, player2.get(0).getTotal()); + assertEquals(49, player2.getFirst().getTotal()); assertEquals(49, player2.get(1).getTotal()); assertEquals(49, player2.get(2).getTotal()); assertEquals(40, player2.get(3).getTotal());