use of io.crnk.test.mock.models.Project.ProjectMeta 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.ProjectMeta in project crnk-framework by crnk-project.
the class InformationClientTest method testMeta.
@Test
public void testMeta() {
QuerySpec querySpec = new QuerySpec(Project.class);
ResourceList<Project> list = projectRepo.findAll(querySpec);
ProjectsMetaInformation metaInformation = list.getMeta(ProjectsMetaInformation.class);
Assert.assertEquals("testMeta", metaInformation.getMetaValue());
Project project = list.get(0);
ProjectMeta projectMeta = project.getMeta();
Assert.assertNotNull(projectMeta);
Assert.assertEquals("someMetaValue", projectMeta.getValue());
}
Aggregations