I'm trying to create a JsonProcessingException to be thrown by a mock object.
when(mapper.writeValueAsString(any(Object.class))).thenThrow(new JsonProcessingException("Error"));
However I'm unable to create a JsonProcessingException object as all the constructors are protected. How do I get around this?
MyJsonProcessingException
and inheritJsonProcessingException
class? – Daugherty