use of io.crnk.test.mock.models.Project 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");
}
use of io.crnk.test.mock.models.Project in project crnk-framework by crnk-project.
the class InformationClientTest method testLinks.
@Test
public void testLinks() {
QuerySpec querySpec = new QuerySpec(Project.class);
ResourceList<Project> list = projectRepo.findAll(querySpec);
ProjectsLinksInformation lnksInformation = list.getLinks(ProjectsLinksInformation.class);
Assert.assertEquals("testLink", lnksInformation.getLinkValue());
Project project = list.get(0);
ProjectLinks projectLinks = project.getLinks();
Assert.assertNotNull(projectLinks);
Assert.assertEquals("someLinkValue", projectLinks.getValue());
}
Aggregations