Skip to content

Commit

Permalink
[sleepiq] Fix the failing tests
Browse files Browse the repository at this point in the history
Fix openhab#7981

Signed-off-by: Laurent Garnier <[email protected]>
  • Loading branch information
lolodomo committed Jun 22, 2020
1 parent 61083da commit b21bce7
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> paths = new ArrayList<>();
Expand All @@ -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 new String(Files.readAllBytes(getTestDataPath(jsonFileName))).replaceAll("\r\n", "\n");
}
}

0 comments on commit b21bce7

Please sign in to comment.