Ver Fonte

BirthCertificateService::FindAllByFather test

Andrew Grant há 2 meses atrás
pai
commit
968b7ca243

+ 12 - 0
src/test/java/scot/carricksoftware/grantswriter/services/certificates/birthcertificate/BirthCertificateServiceTest.java

@@ -45,4 +45,16 @@ class BirthCertificateServiceTest {
         List<BirthCertificate> result = birthCertificateService.findAllByNewBorn(person);
         assertEquals(birthCertificateList, result);
     }
+
+    @Test
+    void findAllByFatherTest() {
+        List<BirthCertificate> birthCertificateList = new ArrayList<>();
+        BirthCertificate birthCertificate = new BirthCertificate();
+        birthCertificateList.add(birthCertificate);
+        Person person = GetRandomPerson();
+        when(birthCertificateRepositoryMock.findAllByFather(person)).thenReturn(birthCertificateList);
+
+        List<BirthCertificate> result = birthCertificateService.findAllByFather(person);
+        assertEquals(birthCertificateList, result);
+    }
 }