use of com.manydesigns.portofino.dispatcher.resolvers.JacksonResourceResolver in project Portofino by ManyDesigns.
the class TestJacksonResourceResolver method person.
@Test
public void person() throws Exception {
FileObject root = getRoot();
ResourceResolver resourceResolver = new CachingResourceResolver(new JacksonResourceResolver());
Map personMap = resourceResolver.resolve(root.resolveFile("test/person.json"), Map.class);
assertEquals("person", personMap.get("title"));
Entity personEntity = resourceResolver.resolve(root.resolveFile("test/person.json"), Entity.class);
assertEquals("person", personEntity.title);
personMap = resourceResolver.resolve(root.resolveFile("test"), "person", Map.class);
assertEquals("person", personMap.get("title"));
personEntity = resourceResolver.resolve(root.resolveFile("test"), "person", Entity.class);
assertEquals("person", personEntity.title);
}
Aggregations