|
|
@@ -83,7 +83,7 @@ class BirthCertificateCommandPartThreeValidatorTest {
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
- void validateWhenBornTestTest() {
|
|
|
+ void validateWhenBornTest() {
|
|
|
validator.validate(birthCertificateCommandMock, bindingResultMock);
|
|
|
verify(validateTypesMock).validatePastDateAndTime(
|
|
|
birthCertificateCommandMock.getWhenBorn(),
|
|
|
@@ -94,4 +94,18 @@ class BirthCertificateCommandPartThreeValidatorTest {
|
|
|
bindingResultMock);
|
|
|
}
|
|
|
|
|
|
+ @Test
|
|
|
+ void validateRegisteredDateTest() {
|
|
|
+ String string = GetRandomString();
|
|
|
+ when(birthCertificateCommandMock.getWhenRegistered()).thenReturn(string);
|
|
|
+ validator.validate(birthCertificateCommandMock, bindingResultMock);
|
|
|
+ verify(validateTypesMock).validatePastDate(
|
|
|
+ string,
|
|
|
+ "whenRegistered",
|
|
|
+ "When registered cannot be null.",
|
|
|
+ "When registered date is invalid.",
|
|
|
+ "Date should not be in the future.",
|
|
|
+ bindingResultMock);
|
|
|
+ }
|
|
|
+
|
|
|
}
|