use of io.crnk.core.mock.repository.ScheduleRepository in project crnk-framework by crnk-project.
the class DecoratorTest method testDecoratedResourceRepositoryBase.
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testDecoratedResourceRepositoryBase() {
ScheduleRepository repository = Mockito.mock(ScheduleRepository.class);
ResourceRepositoryDecoratorBase<Schedule, Long> decorator = new ResourceRepositoryDecoratorBase() {
};
decorator.setDecoratedObject(repository);
decorator.create(null);
Mockito.verify(repository, Mockito.times(1)).create(Mockito.any(Schedule.class));
decorator.delete(null);
Mockito.verify(repository, Mockito.times(1)).delete(Mockito.anyLong());
decorator.findAll(null);
Mockito.verify(repository, Mockito.times(1)).findAll(Mockito.any(QuerySpec.class));
decorator.findAll(null, null);
Mockito.verify(repository, Mockito.times(1)).findAll(Mockito.anyListOf(Long.class), Mockito.any(QuerySpec.class));
decorator.getResourceClass();
Mockito.verify(repository, Mockito.times(1)).getResourceClass();
Schedule schedule = Mockito.mock(Schedule.class);
decorator.save(schedule);
Mockito.verify(repository, Mockito.times(1)).save(Mockito.eq(schedule));
decorator.findOne(null, null);
Mockito.verify(repository, Mockito.times(1)).findOne(Mockito.anyLong(), Mockito.any(QuerySpec.class));
}
Aggregations