@Test @RoxableTest(key = "c03c81c0e9eb") public void jsonRootDeserializerShouldReturnNullForNonJsonRootWrapperType() { JavaType type = SimpleType.construct(Integer.class); JsonDeserializer d = null; try { d = jsonRootDeserializer.findBeanDeserializer(type, null, null, null, null); } catch (JsonMappingException ex) { fail("Unexpected exception when finding Bean Deserializer"); } assertNull(d); }
public List<Project> getProjects() throws AuthenticationFailedException, ServiceNotFoundException, Exception { HttpURLConnection con = getServiceConnection("api/projects"); if (con.getResponseCode() == 401) { throw new AuthenticationFailedException(); } else if (con.getResponseCode() == 404) { throw new ServiceNotFoundException(); } JavaType type = CollectionType.construct(ArrayList.class, SimpleType.construct(Project.class)); InputStream in = con.getInputStream(); try { return (List<Project>) objectMapper.readValue(in, type); } finally { in.close(); } }
@Override public JavaType containedType(int index) { return SimpleType.construct(genericClass); }
@Override public JavaType getValueType() { return SimpleType.construct(String.class); }
@Override public JavaType withTypeHandler(Object h) { return SimpleType.construct(h.getClass()); }
@Override public JavaType withContentTypeHandler(Object h) { return SimpleType.construct(h.getClass()); }
@Override protected JavaType _narrow(Class<?> subclass) { return SimpleType.construct(subclass); }
@Override public JavaType narrowContentsBy(Class<?> contentClass) { return SimpleType.construct(contentClass); }
@Override public JavaType widenContentsBy(Class<?> contentClass) { return SimpleType.construct(contentClass); }