diff --git a/bundles/org.openhab.binding.sleepiq/src/3rdparty/test/org/openhab/binding/sleepiq/api/test/AbstractTest.java b/bundles/org.openhab.binding.sleepiq/src/3rdparty/test/org/openhab/binding/sleepiq/api/test/AbstractTest.java index f9dfd395b565c..955f7e2ef86b4 100644 --- a/bundles/org.openhab.binding.sleepiq/src/3rdparty/test/org/openhab/binding/sleepiq/api/test/AbstractTest.java +++ b/bundles/org.openhab.binding.sleepiq/src/3rdparty/test/org/openhab/binding/sleepiq/api/test/AbstractTest.java @@ -24,17 +24,14 @@ import java.util.Arrays; import java.util.List; -public abstract class AbstractTest -{ +public abstract class AbstractTest { private static final String RESOURCES_PATH = "src/test/resources/"; - protected File getTestDataFile(String name) - { + protected File getTestDataFile(String name) { return getTestDataPath(name).toFile(); } - protected Path getTestDataPath(String name) - { + protected Path getTestDataPath(String name) { String packageName = this.getClass().getPackage().getName(); List paths = new ArrayList<>(); @@ -44,8 +41,7 @@ protected Path getTestDataPath(String name) return Paths.get(RESOURCES_PATH, paths.toArray(new String[paths.size()])); } - protected String readJson(String jsonFileName) throws IOException - { - return new String(Files.readAllBytes(getTestDataPath(jsonFileName))); + protected String readJson(String jsonFileName) throws IOException { + return String.join("\n", Files.readAllLines(getTestDataPath(jsonFileName))); } }