use of io.crnk.core.mock.models.ContainedPojo in project crnk-framework by crnk-project.
the class ComplexPojoRepository method findOne.
@Override
public ComplexPojo findOne(Long aLong, QueryParams queryParams) {
if (THREAD_LOCAL_REPOSITORY.size() < 1) {
ComplexPojo complexPojo = new ComplexPojo();
complexPojo.setContainedPojo(new ContainedPojo());
complexPojo.getContainedPojo().setUpdateableProperty1("value from repository mock");
complexPojo.getContainedPojo().setUpdateableProperty2("value from repository mock");
complexPojo.setId(1l);
THREAD_LOCAL_REPOSITORY.put(complexPojo.getId(), complexPojo);
}
ComplexPojo complexPojo = THREAD_LOCAL_REPOSITORY.get(aLong);
if (complexPojo == null) {
throw new ResourceNotFoundException("");
}
return complexPojo;
}
Aggregations