From ac4d66898446f0e81f0b909a049dfc667ddd2ccf Mon Sep 17 00:00:00 2001 From: Tal Moran Date: Sun, 30 Oct 2016 13:32:39 +0200 Subject: [PATCH] Use configuration file from bundled resource in test --- .../meerkat/voting/VotingBoothConfigurationCreatorTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voting-booth-gui/src/test/java/meerkat/voting/VotingBoothConfigurationCreatorTest.java b/voting-booth-gui/src/test/java/meerkat/voting/VotingBoothConfigurationCreatorTest.java index c54e14e..22cfe6b 100644 --- a/voting-booth-gui/src/test/java/meerkat/voting/VotingBoothConfigurationCreatorTest.java +++ b/voting-booth-gui/src/test/java/meerkat/voting/VotingBoothConfigurationCreatorTest.java @@ -20,7 +20,7 @@ import java.util.Scanner; */ public class VotingBoothConfigurationCreatorTest { private VotingBoothConfigurationCreator configCreator; - private String currentConfigurationPath = "/F:/vova/meerkat/meerkat-java/voting-booth-gui/src/main/resources/configuration/VotingBoothConfiguration.json"; + private String currentConfigurationPath = "/configuration/VotingBoothConfiguration.json"; @Before public void setup() { @@ -32,7 +32,7 @@ public class VotingBoothConfigurationCreatorTest { public void testConfigurationCreation() throws IOException, JSONException { List> configs = new ArrayList<>(); - String content = new Scanner(new File(this.currentConfigurationPath)).useDelimiter("\\Z").next(); + String content = new Scanner(getClass().getResourceAsStream(this.currentConfigurationPath)).useDelimiter("\\Z").next(); JSONObject jsonObject = new JSONObject(content); JSONArray currentBallotQuestions = jsonObject.getJSONArray("questions");