Search in sources :

Example 1 with TaskSubType

use of io.crnk.test.mock.models.TaskSubType in project crnk-framework by crnk-project.

the class InheritanceClientTest method setup.

@Before
public void setup() {
    super.setup();
    taskRepo = client.getRepositoryForType(Task.class);
    projectRepo = client.getRepositoryForType(Project.class);
    relRepo = client.getRepositoryForType(Project.class, Task.class);
    Task baseTask = new Task();
    baseTask.setId(Long.valueOf(1));
    baseTask.setName("baseTask");
    taskRepo.create(baseTask);
    TaskSubType taskSubType = new TaskSubType();
    taskSubType.setId(Long.valueOf(2));
    taskSubType.setName("taskSubType");
    taskSubType.setSubTypeValue(13);
    taskRepo.create(taskSubType);
    Project project = new Project();
    project.setId(1L);
    project.setName("project0");
    project.setTasks(Arrays.asList(baseTask, taskSubType));
    projectRepo.create(project);
    relRepo.addRelations(project, Arrays.asList(baseTask.getId(), taskSubType.getId()), "tasks");
}
Also used : Project(io.crnk.test.mock.models.Project) Task(io.crnk.test.mock.models.Task) TaskSubType(io.crnk.test.mock.models.TaskSubType) Before(org.junit.Before)

Aggregations

Project (io.crnk.test.mock.models.Project)1 Task (io.crnk.test.mock.models.Task)1 TaskSubType (io.crnk.test.mock.models.TaskSubType)1 Before (org.junit.Before)1