-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Revert "Revert "SSCSCI-1456" (#1704)" This reverts commit aa5e8ae. * fix by adding constructor without hmcHearingType * attempted fix * checkstyle fix * removing redundant constructor and isNullCheck
- Loading branch information
Showing
5 changed files
with
71 additions
and
5 deletions.
There are no files selected for viewing
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
23 changes: 23 additions & 0 deletions
23
src/main/java/uk/gov/hmcts/reform/sscs/ccd/domain/HmcHearingType.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,23 @@ | ||
package uk.gov.hmcts.reform.sscs.ccd.domain; | ||
|
||
import com.fasterxml.jackson.annotation.JsonValue; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum HmcHearingType { | ||
SUBSTANTIVE("BBA3-SUB", "Substantive", null), | ||
DIRECTION_HEARINGS("BBA3-DIR", "Direction Hearings", null), | ||
CHAMBERS_OUTCOME("BBA3-CHA", "Chambers Outcome", null); | ||
|
||
private final String hmcReference; | ||
private final String valueEn; | ||
private final String valueCy; | ||
|
||
@Override | ||
@JsonValue | ||
public String toString() { | ||
return hmcReference; | ||
} | ||
} |
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
25 changes: 25 additions & 0 deletions
25
src/test/java/uk/gov/hmcts/reform/sscs/ccd/domain/HmcHearingTypeTest.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,25 @@ | ||
package uk.gov.hmcts.reform.sscs.ccd.domain; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNull; | ||
|
||
import junitparams.JUnitParamsRunner; | ||
import junitparams.Parameters; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(JUnitParamsRunner.class) | ||
public class HmcHearingTypeTest { | ||
|
||
@Test | ||
@Parameters({ | ||
"SUBSTANTIVE,BBA3-SUB,Substantive", | ||
"DIRECTION_HEARINGS,BBA3-DIR,Direction Hearings", | ||
"CHAMBERS_OUTCOME,BBA3-CHA,Chambers Outcome" | ||
}) | ||
public void shouldReturnCorrectValues(HmcHearingType hmcHearingType, String hmcReference, String valueEn) { | ||
assertEquals(hmcReference, hmcHearingType.getHmcReference()); | ||
assertEquals(valueEn, hmcHearingType.getValueEn()); | ||
assertNull(hmcHearingType.getValueCy()); | ||
} | ||
} |