generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/SILVA-563
- Loading branch information
Showing
5 changed files
with
83 additions
and
18 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
backend/src/test/java/ca/bc/gov/restapi/results/oracle/enums/AuditActionCodeEnumTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package ca.bc.gov.restapi.results.oracle.enums; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import java.util.stream.Stream; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
|
||
@DisplayName("Unit Test | AuditActionCodeEnum") | ||
class AuditActionCodeEnumTest { | ||
|
||
@DisplayName("Test enum conversion") | ||
@ParameterizedTest(name = "Test enum conversion for code {0} and description {1}") | ||
@MethodSource("enumConversion") | ||
void testEnumConversion(String code, String description, AuditActionCodeEnum expected) { | ||
AuditActionCodeEnum actual = AuditActionCodeEnum.of(code); | ||
assertEquals(expected, actual); | ||
if (expected != null) { | ||
assertEquals(expected.getCode(), actual.getCode()); | ||
assertEquals(description, actual.getDescription()); | ||
} | ||
} | ||
|
||
private static Stream<Arguments> enumConversion() { | ||
return Stream.of( | ||
Arguments.of("UPD", "Update", AuditActionCodeEnum.UPD), | ||
Arguments.of("COR", "Correction", AuditActionCodeEnum.COR), | ||
Arguments.of("O", "Original", AuditActionCodeEnum.O), | ||
Arguments.of("197", "Section 197", AuditActionCodeEnum.SEC197), | ||
Arguments.of("AMG", "Amalgamate", AuditActionCodeEnum.AMG), | ||
Arguments.of("ES", "E-submission", AuditActionCodeEnum.ES), | ||
Arguments.of("MIL", "Milestone", AuditActionCodeEnum.MIL), | ||
Arguments.of("MIN", "Amended (Minor)", AuditActionCodeEnum.MIN), | ||
Arguments.of("SPA", "Site Plan Amendment", AuditActionCodeEnum.SPA), | ||
Arguments.of("VAR", "Variation", AuditActionCodeEnum.VAR), | ||
Arguments.of("AMD", "Amended", AuditActionCodeEnum.AMD), | ||
Arguments.of("APP", "Approved", AuditActionCodeEnum.APP), | ||
Arguments.of("DEL", "Deleted", AuditActionCodeEnum.DEL), | ||
Arguments.of("REJ", "Rejected", AuditActionCodeEnum.REJ), | ||
Arguments.of("RET", "Retired", AuditActionCodeEnum.RET), | ||
Arguments.of("RMD", "Removed", AuditActionCodeEnum.RMD), | ||
Arguments.of("SUB", "Submitted", AuditActionCodeEnum.SUB), | ||
Arguments.of(null, null, null), | ||
Arguments.of("", null, null) | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters