add one test

This commit is contained in:
zhaos 2025-04-29 14:33:15 -04:00
parent 0c88f916db
commit 481d9c6a40

View file

@ -244,4 +244,20 @@ class ClinicServiceTests {
.isNotNull(); .isNotNull();
} }
@Test
void shouldFindVisitsByAnotherPetId() {
Optional<Owner> optionalOwner = this.owners.findById(6);
assertThat(optionalOwner).isPresent();
Owner owner6 = optionalOwner.get();
Pet pet7 = owner6.getPet(7);
Collection<Visit> visits = pet7.getVisits();
assertThat(visits) //
.hasSize(2) //
.element(0)
.extracting(Visit::getDate)
.isNotNull();
}
} }