Search in sources :

Example 1 with RelationIdTestRepository

use of io.crnk.core.mock.repository.RelationIdTestRepository in project crnk-framework by crnk-project.

the class ResourceIdControllerTest method prepare.

@Before
public void prepare() {
    super.prepare();
    ScheduleRepositoryImpl scheduleRepository = new ScheduleRepositoryImpl();
    schedule2 = new Schedule();
    schedule2.setId(2L);
    schedule2.setName("test");
    scheduleRepository.save(schedule2);
    schedule2Id = new ResourceIdentifier(schedule2.getId().toString(), "schedules");
    schedule3 = new Schedule();
    schedule3.setId(3L);
    schedule3.setName("test");
    scheduleRepository.save(schedule3);
    schedule3Id = new ResourceIdentifier(schedule3.getId().toString(), "schedules");
    repository = new RelationIdTestRepository();
    repository.setResourceRegistry(resourceRegistry);
}
Also used : ScheduleRepositoryImpl(io.crnk.core.mock.repository.ScheduleRepositoryImpl) RelationIdTestRepository(io.crnk.core.mock.repository.RelationIdTestRepository) ResourceIdentifier(io.crnk.core.engine.document.ResourceIdentifier) Schedule(io.crnk.core.mock.models.Schedule) Before(org.junit.Before)

Example 2 with RelationIdTestRepository

use of io.crnk.core.mock.repository.RelationIdTestRepository in project crnk-framework by crnk-project.

the class NestedRelationIdLookupTest method setup.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Before
public void setup() {
    super.setup();
    scheduleRepository = new ScheduleRepositoryImpl();
    schedule = new Schedule();
    schedule.setId(3L);
    schedule.setName("test");
    scheduleRepository.save(schedule);
    testRepository = new RelationIdTestRepository();
    child = new RelationIdTestResource();
    child.setId(1L);
    child.setName("child");
    testRepository.save(child);
    child.setTestSerializeEager(schedule);
}
Also used : ScheduleRepositoryImpl(io.crnk.core.mock.repository.ScheduleRepositoryImpl) RelationIdTestRepository(io.crnk.core.mock.repository.RelationIdTestRepository) Schedule(io.crnk.core.mock.models.Schedule) RelationIdTestResource(io.crnk.core.mock.models.RelationIdTestResource) Before(org.junit.Before)

Aggregations

Schedule (io.crnk.core.mock.models.Schedule)2 RelationIdTestRepository (io.crnk.core.mock.repository.RelationIdTestRepository)2 ScheduleRepositoryImpl (io.crnk.core.mock.repository.ScheduleRepositoryImpl)2 Before (org.junit.Before)2 ResourceIdentifier (io.crnk.core.engine.document.ResourceIdentifier)1 RelationIdTestResource (io.crnk.core.mock.models.RelationIdTestResource)1