use of io.crnk.test.mock.models.Project.ProjectLinks in project crnk-framework by crnk-project.
the class ProjectRepository method save.
@Override
public <S extends Project> S save(S entity) {
entity.setId((long) (THREAD_LOCAL_REPOSITORY.size() + 1));
THREAD_LOCAL_REPOSITORY.put(entity.getId(), entity);
ProjectLinks links = new ProjectLinks();
links.setValue("someLinkValue");
entity.setLinks(links);
ProjectMeta meta = new ProjectMeta();
meta.setValue("someMetaValue");
entity.setMeta(meta);
return entity;
}
use of io.crnk.test.mock.models.Project.ProjectLinks 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