mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
add one test
This commit is contained in:
parent
0c88f916db
commit
481d9c6a40
1 changed files with 16 additions and 0 deletions
|
@ -244,4 +244,20 @@ class ClinicServiceTests {
|
|||
.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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue