ソースを参照

BirthCertificateCommandValidatorTest - not a null person

Andrew Grant 7 ヶ月 前
コミット
cb9b9bf637

+ 9 - 2
src/test/java/scot/carricksoftware/grants/validators/certificates/BirthCertificateCommandValidatorTest.java

@@ -18,6 +18,8 @@ import scot.carricksoftware.grants.commands.certificates.birthcertificates.Birth
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoInteractions;
+import static scot.carricksoftware.grants.GenerateRandomPeopleValues.GetRandomPerson;
 
 @ExtendWith(MockitoExtension.class)
 class BirthCertificateCommandValidatorTest {
@@ -47,8 +49,6 @@ class BirthCertificateCommandValidatorTest {
 
     @Test
     public void nullPersonTest() {
-
-
         commandValidator.validate(birthCertificateCommand, bindingResultMock);
 
         verify(bindingResultMock).rejectValue(stringArgumentCaptor.capture(),
@@ -61,5 +61,12 @@ class BirthCertificateCommandValidatorTest {
 
     }
 
+    @Test
+    public void notNullPersonTest() {
+        birthCertificateCommand.setNewBorn(GetRandomPerson());
+        commandValidator.validate(birthCertificateCommand, bindingResultMock);
+
+        verifyNoInteractions(bindingResultMock);
+    }
 
 }