From a92a738de140fee30199f86aaad70a048f809893 Mon Sep 17 00:00:00 2001 From: vteague Date: Fri, 23 Aug 2024 15:00:50 +1000 Subject: [PATCH] Test that assertion generation is allowed in the initial and PARTIAL_AUDIT_INFO_SET states, and not in any other states. --- .../corla/endpoint/GenerateAssertionsAPITests.java | 5 ++--- .../au/org/democracydevelopers/corla/util/testUtils.java | 8 +++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/server/eclipse-project/src/test/java/au/org/democracydevelopers/corla/endpoint/GenerateAssertionsAPITests.java b/server/eclipse-project/src/test/java/au/org/democracydevelopers/corla/endpoint/GenerateAssertionsAPITests.java index 66240435..816a2d4f 100644 --- a/server/eclipse-project/src/test/java/au/org/democracydevelopers/corla/endpoint/GenerateAssertionsAPITests.java +++ b/server/eclipse-project/src/test/java/au/org/democracydevelopers/corla/endpoint/GenerateAssertionsAPITests.java @@ -48,7 +48,6 @@ import us.freeandfair.corla.model.AuditReason; import us.freeandfair.corla.model.Choice; import us.freeandfair.corla.model.ContestResult; -import us.freeandfair.corla.model.DoSDashboard; import us.freeandfair.corla.persistence.Persistence; import javax.transaction.Transactional; @@ -186,8 +185,8 @@ public void closeMocks() { */ @Test @Transactional - void assertionGenerationBlockedWhenInWrongASMStateOrComparisonAuditsPresent() { - testUtils.log(LOGGER, "assertionGenerationBlockedWhenInWrongASMStateOrComparisonAuditsPresent"); + void assertionGenerationBlockedWhenInWrongASMState() { + testUtils.log(LOGGER, "assertionGenerationBlockedWhenInWrongASMState"); // Mock the main class; mock its auth as the mocked state admin auth. try (MockedStatic
mockedMain = Mockito.mockStatic(Main.class); diff --git a/server/eclipse-project/src/test/java/au/org/democracydevelopers/corla/util/testUtils.java b/server/eclipse-project/src/test/java/au/org/democracydevelopers/corla/util/testUtils.java index 5384fcf1..c95fe040 100644 --- a/server/eclipse-project/src/test/java/au/org/democracydevelopers/corla/util/testUtils.java +++ b/server/eclipse-project/src/test/java/au/org/democracydevelopers/corla/util/testUtils.java @@ -22,12 +22,10 @@ package au.org.democracydevelopers.corla.util; import au.org.democracydevelopers.corla.model.ContestType; import org.apache.log4j.Logger; -import us.freeandfair.corla.model.Choice; -import us.freeandfair.corla.model.Contest; -import us.freeandfair.corla.model.ContestResult; -import us.freeandfair.corla.model.County; +import us.freeandfair.corla.model.*; -import java.util.List; +import java.math.BigDecimal; +import java.util.*; /** * This class contains utilities and default data for use in testing.