Skip to content

Commit

Permalink
Merge branch 'main' into 174-incorporate-generateassertionssummary-in…
Browse files Browse the repository at this point in the history
…to-dos-dashboard
  • Loading branch information
vteague authored Aug 30, 2024
2 parents 51db6f9 + 72c15ba commit 2f967d7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ public class GenerateAssertionsAPITests extends TestClassWithAuth {

/**
* Wiremock server for mocking the raire service.
* (Note the default of 8080 clashes with the raire-service default, so this is different.)
*
*/
private final WireMockServer wireMockRaireServer = new WireMockServer(8110);
private WireMockServer wireMockRaireServer;

/**
* Base url - this is set up to use the wiremock server, but could be set here to wherever you have the
Expand Down Expand Up @@ -154,8 +154,12 @@ public void initMocks() {
tinyIRVContestResult.setWinners(Set.of("Alice"));
tinyIRVContestResult.addContests(Set.of(tinyIRVExample));

// Default raire server. You can instead run the real raire service and set baseUrl accordingly.
// Of course you have to have appropriate contests in the database.
// Set up default raire server on the port defined in test.properties.
// You can instead run the real raire service and set baseUrl accordingly,
// though some tests may fail, depending on whether you have
// appropriate contests in the database.
final int rairePort = Integer.parseInt(config.getProperty(generateAssertionsPortNumberString, ""));
wireMockRaireServer = new WireMockServer(rairePort);
wireMockRaireServer.start();
baseUrl = wireMockRaireServer.baseUrl();
configureFor("localhost", wireMockRaireServer.port());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ public class GenerateAssertionsTests extends TestClassWithDatabase {
*/
private final static String raireGenerateAssertionsEndpoint = "/raire/generate-assertions";

/**
* The string used to identify the configured port in test.properties.
*/
private final static String generateAssertionsPortNumberString = "generate_assertions_mock_port";

/**
* Wiremock server for mocking the raire service.
* (Note the default of 8080 clashes with the raire-service default, so this is different.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ public class GetAssertionsTests extends TestClassWithDatabase {
*/
private final static String raireGetAssertionsEndpoint = "/raire/get-assertions";

/**
* The string used to identify the configured port in test.properties.
*/
private final static String getAssertionsPortNumberString = "get_assertions_mock_port";

/**
* Wiremock server for mocking the raire service.
* (Note the default of 8080 clashes with the raire-service default, so this is different.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ public abstract class TestClassWithDatabase {
*/
protected static Properties config = loadProperties();

/**
* The string used to identify the configured port in test.properties.
*/
protected final static String generateAssertionsPortNumberString = "generate_assertions_mock_port";

/**
* The string used to identify the configured port in test.properties.
*/
protected final static String getAssertionsPortNumberString = "get_assertions_mock_port";

/**
* Begin a new transaction before each test method in the class is run.
*/
Expand Down

0 comments on commit 2f967d7

Please sign in to comment.