JacksonJsonDeserializer implements JsonDeserializer<T> { @Override public T apply(final String json) { try { return mapper.readerFor(clazz).readValue(json); } catch (final IOException e) { throw new JacksonConversionException("Could not deserialize json", e); } }  @Override T apply(final String json);  }
@Test(expected=JacksonConversionException.class) public void shouldThrow() throws IOException { when(reader.readValue("")).thenThrow(mock(JsonProcessingException.class)); function.apply(""); }