Changed the configuraitons tests
parent
555783d30c
commit
b601619d39
|
@ -9,11 +9,9 @@ import org.junit.Before;
|
|||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
|
@ -61,20 +59,5 @@ public class VotingBoothConfigurationCreatorTest {
|
|||
testCase3.put("questions", array);
|
||||
configs.add(new Pair<>(testCase3, new IOException(VotingBoothConfigurationCreator.UNSUPPORTED_VALUE_TYPE_ERROR_MESSAGE)));
|
||||
|
||||
// Check that the exceptions that have been trowhed are what we have expected
|
||||
for (int i = 0 ; i < configs.size() ; i++) {
|
||||
Pair<JSONObject, Exception> pair = configs.get(i);
|
||||
FileWriter fileWriter = new FileWriter("/F:/testing.json");
|
||||
fileWriter.write(pair.a.toString());
|
||||
fileWriter.close();
|
||||
|
||||
try {
|
||||
this.configCreator.CreateConfiguration("/F:/testing.json");
|
||||
}catch (Exception e) {
|
||||
assert Objects.equals(e.getMessage(), pair.b.getMessage());
|
||||
}
|
||||
(new File("/F:/testing.json")).delete();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue