title: How to get a JsonProcessingException using Jackson
body: <p>Might be a strange question but indeed I would like to achieve a a bit more coverage on my tests and although I coded against a <code>JsonProcessingException</code> I can't create a payload that generates this exception, maybe because Jackson is quite smart and converts everything to a string, and even for bad strings it goes around the JSON specs. My problem is that Jackson is quite good :)</p>
  
  <p>I basically want a payload that when I run this, it break with <code>JsonProcessingException</code>:</p>
  
  <pre><code>String jsonPayload = objectMapper.writeValueAsString(payload);
  </code></pre>
  
  <p>I've tried some like:</p>
  
  <pre><code>HashMap&lt;String, String&gt; invalidJSONPayload= new HashMap&lt;&gt;();
  
  invalidJSONPayload.put("021",021);
  invalidJSONPayload.put("---",021);
  invalidJSONPayload.put("~",021);
  </code></pre>
  
  <p>I'm not fussed with the type, so feel free to suggest another one. An empty object for example, throws <code>JsonMappingException</code> and I already catch that one as well.</p>