use of io.crnk.core.mock.models.Document in project crnk-framework by crnk-project.
the class RegistryEntryTest method onValidParentShouldReturnTrue.
@Test
public void onValidParentShouldReturnTrue() throws Exception {
// GIVEN
RegistryEntry thing = new RegistryEntry(newResourceEntry(Thing.class, "things"));
RegistryEntry document = new RegistryEntry(newResourceEntry(Document.class, "documents"));
document.setParentRegistryEntry(thing);
RegistryEntry memorandum = new RegistryEntry(newResourceEntry(Memorandum.class, "memorandum"));
memorandum.setParentRegistryEntry(document);
// WHEN
boolean result = memorandum.isParent(thing);
// THEN
assertThat(result).isTrue();
}
use of io.crnk.core.mock.models.Document in project crnk-framework by crnk-project.
the class RegistryEntryTest method onInvalidParentShouldReturnFalse.
@Test
public void onInvalidParentShouldReturnFalse() throws Exception {
// GIVEN
RegistryEntry document = new RegistryEntry(newResourceEntry(Document.class, "documents"));
RegistryEntry task = new RegistryEntry(newResourceEntry(Task.class, "tasks"));
// WHEN
boolean result = document.isParent(task);
// THEN
assertThat(result).isFalse();
}
Aggregations