use of io.crnk.test.mock.repository.ScheduleRepository.ScheduleList in project crnk-framework by crnk-project.
the class QuerySpecClientTest method testInterfaceAccess.
@Test
public void testInterfaceAccess() {
// tag::interfaceAccess[]
ScheduleRepository scheduleRepository = client.getResourceRepository(ScheduleRepository.class);
Schedule schedule = new Schedule();
schedule.setId(13L);
schedule.setName("mySchedule");
scheduleRepository.create(schedule);
QuerySpec querySpec = new QuerySpec(Schedule.class);
ScheduleList list = scheduleRepository.findAll(querySpec);
Assert.assertEquals(1, list.size());
ScheduleListMeta meta = list.getMeta();
ScheduleListLinks links = list.getLinks();
Assert.assertNotNull(meta);
Assert.assertNotNull(links);
// end::interfaceAccess[]
}
use of io.crnk.test.mock.repository.ScheduleRepository.ScheduleList in project crnk-framework by crnk-project.
the class QuerySpecClientTest method testCreate.
@Test
public void testCreate() {
ScheduleRepository scheduleRepository = client.getResourceRepository(ScheduleRepository.class);
Schedule schedule = new Schedule();
schedule.setName("mySchedule");
scheduleRepository.create(schedule);
QuerySpec querySpec = new QuerySpec(Schedule.class);
ScheduleList list = scheduleRepository.findAll(querySpec);
Assert.assertEquals(1, list.size());
schedule = list.get(0);
Assert.assertNotNull(schedule.getId());
ScheduleListMeta meta = list.getMeta();
ScheduleListLinks links = list.getLinks();
Assert.assertNotNull(meta);
Assert.assertNotNull(links);
}
Aggregations