Spa { public Spa() { routes = new HashMap<>(); } Spa();  Spa(ObjectNode app);  Spa(String name, String description, String frame, JsonNode jsonNode,
               String root, Map<String, Page> routes); static Spa manifest(String resource); static Map<String, Page> routes(ArrayNode pages); String getDescription(); String getFrame(); boolean getMeta(); String getName(); Page getRoot(); Page route(String path); void route(String path, Page page); void setDescription(String description); void setFrame(String frame); void setMeta(boolean meta); void setName(String name); void setRoot(String root); @Override String toString();  }
@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()); }