use of de.spring.example.persistence.repository.AdDescriptionRepository in project JavaForFun by gumartinm.
the class AdDescriptionRevisionServiceShould method test.
@Test
public void test() {
AdDescriptionRepository adDescriptionRepository = mock(AdDescriptionRepository.class);
AdDescriptionRevisionServiceImpl adDescriptionRevisionService = new AdDescriptionRevisionServiceImpl();
adDescriptionRevisionService.setRepository(adDescriptionRepository);
List<Revision<Integer, AdDescription>> adRevisions = new ArrayList<>();
Pageable pageRequest = new PageRequest(0, 1);
Page<Revision<Integer, AdDescription>> page = new PageImpl<>(adRevisions);
given(adDescriptionRepository.findRevisions(1L, pageRequest)).willReturn(page);
assertThat(adDescriptionRevisionService.findRevisions(1L, pageRequest), is(page));
}
Aggregations