Use configuration file from bundled resource in test

android-scanner
Tal Moran 2016-10-30 13:32:39 +02:00
parent b601619d39
commit ac4d668984
1 changed files with 2 additions and 2 deletions

View File

@ -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<Pair<JSONObject, Exception>> 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");