Search in sources :

Example 1 with ProjectLinks

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;
}
Also used : ProjectLinks(io.crnk.test.mock.models.Project.ProjectLinks) ProjectMeta(io.crnk.test.mock.models.Project.ProjectMeta)

Example 2 with ProjectLinks

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());
}
Also used : Project(io.crnk.test.mock.models.Project) ProjectsLinksInformation(io.crnk.test.mock.repository.ProjectRepository.ProjectsLinksInformation) ProjectLinks(io.crnk.test.mock.models.Project.ProjectLinks) QuerySpec(io.crnk.core.queryspec.QuerySpec) Test(org.junit.Test)

Aggregations

ProjectLinks (io.crnk.test.mock.models.Project.ProjectLinks)2 QuerySpec (io.crnk.core.queryspec.QuerySpec)1 Project (io.crnk.test.mock.models.Project)1 ProjectMeta (io.crnk.test.mock.models.Project.ProjectMeta)1 ProjectsLinksInformation (io.crnk.test.mock.repository.ProjectRepository.ProjectsLinksInformation)1 Test (org.junit.Test)1