Search in sources :

Example 1 with Memorandum

use of io.crnk.core.mock.models.Memorandum 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();
}
Also used : Memorandum(io.crnk.core.mock.models.Memorandum) Document(io.crnk.core.mock.models.Document) RegistryEntry(io.crnk.core.engine.registry.RegistryEntry) Thing(io.crnk.core.mock.models.Thing) Test(org.junit.Test)

Aggregations

RegistryEntry (io.crnk.core.engine.registry.RegistryEntry)1 Document (io.crnk.core.mock.models.Document)1 Memorandum (io.crnk.core.mock.models.Memorandum)1 Thing (io.crnk.core.mock.models.Thing)1 Test (org.junit.Test)1