@Test
public void testSpa() throws Exception {

    ObjectNode node = (ObjectNode) new ObjectMapper().readTree(getClass().getResourceAsStream("/test-app.json"));
    Spa spa = new Spa(node);
    Page page = spa.getRoot();
    assertNotNull(page);
    assertEquals("Applications", page.getTitle());
    assertEquals("All applications", page.getName());
    assertEquals("Page with all applications", page.getDescription());
    assertNull(page.getFrame());
    assertNotNull(page.getQuery());
    Relation relation = new Relation("singlePageApplications");
    Action create = page.getCreate(relation);
    assertNotNull(create);
    ObjectNode extract = create.getExtract();
    assertNotNull(extract);
    assertEquals(1, extract.size());
    assertEquals("bar", extract.get("foo")
                               .asText());
    assertNotNull(create.getQuery());
    assertEquals("cc2f49ae-1c72-11e7-b9f2-31cf61e9d1f6",
                 create.getFrameBy());
    assertNotNull(page.getUpdate(relation));
    assertNotNull(page.getDelete(relation));
    Launch launch = page.getLaunch(relation);
    assertNotNull(launch);
    assertNull(launch.getFrame());
    assertEquals("id", launch.getFrameBy());
    assertEquals("cc2f49ae-1c72-11e7-b9f2-31cf61e9d1f6",
                 launch.getImmediate());
    assertEquals("id", launch.getLaunchBy());
    Route route = page.getNavigation(relation);
    assertNotNull(route);
    assertEquals("workspace", route.getFrameBy());
    extract = route.getExtract();
    assertNotNull(extract);
    assertEquals("bar", extract.get("foo")
                               .asText());
    assertEquals("foo", route.getPath());
}