Use configuration file from bundled resource in test
parent
b601619d39
commit
ac4d668984
|
@ -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");
|
||||
|
||||
|
|
Loading…
Reference in New Issue