How to throw a JsonProcessingException with mockito

i have this lines in my code: @Autowired private ObjectMapper mapper = new ObjectMapper(); @PostMapping(“/postPrueba”) public ResponseEntity<String> postPrueba(@RequestBody Prueba prueba) { String pTest = null; try { pTest = mapper.writeValueAsString(prueba); System.out.println(pTest ); } catch (JsonProcessingException e) { return new ResponseEntity<>(“”, HttpStatus.INTERNAL_SERVER_ERROR); } return new ResponseEntity<>(“”, HttpStatus.OK); } My model Prueba.java public class Prueba { @Id…

Details