mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 08:15:49 +00:00
Fixed indentation from copy/paste
This commit is contained in:
parent
bc81a84e48
commit
9657254791
1 changed files with 17 additions and 17 deletions
|
@ -17,22 +17,22 @@ public class VisitControllerTest
|
||||||
@Test
|
@Test
|
||||||
public void testPetVisitDate()
|
public void testPetVisitDate()
|
||||||
{
|
{
|
||||||
// Define random pet ID
|
// Define random pet ID
|
||||||
final Integer PET_ID = 7;
|
final Integer PET_ID = 7;
|
||||||
Pet pet7 = new Pet();
|
Pet pet7 = new Pet();
|
||||||
|
|
||||||
// Mock dependencies
|
// Mock dependencies
|
||||||
VisitRepository mockVisitRepo = mock(VisitRepository.class);
|
VisitRepository mockVisitRepo = mock(VisitRepository.class);
|
||||||
PetRepository mockPetRepo = mock(PetRepository.class);
|
PetRepository mockPetRepo = mock(PetRepository.class);
|
||||||
VisitController visitController = new VisitController(mockVisitRepo, mockPetRepo);
|
VisitController visitController = new VisitController(mockVisitRepo, mockPetRepo);
|
||||||
|
|
||||||
// Define mock behaviour
|
// Define mock behaviour
|
||||||
when(mockPetRepo.findById(PET_ID)).thenReturn(pet7);
|
when(mockPetRepo.findById(PET_ID)).thenReturn(pet7);
|
||||||
|
|
||||||
// Call method under inspection
|
// Call method under inspection
|
||||||
Visit visit = visitController.loadPetWithVisit(PET_ID, new HashMap<>());
|
Visit visit = visitController.loadPetWithVisit(PET_ID, new HashMap<>());
|
||||||
|
|
||||||
// Confirm that the same visit date was assigned to the pet
|
// Confirm that the same visit date was assigned to the pet
|
||||||
assertEquals(visit.getDate(), pet7.getVisits().get(0).getDate());
|
assertEquals(visit.getDate(), pet7.getVisits().get(0).getDate());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue