ExceptionsHandler extends BaseExceptionHandler<ResponseEntity> { @Override protected <R> ResponseEntity badRequest(R body) { return ResponseEntity .badRequest() .contentType(MediaType.APPLICATION_JSON) .body(body); }  @ExceptionHandler(InvalidLifeCyclePhaseException.class) ResponseEntity toResponse(InvalidLifeCyclePhaseException exception); @ExceptionHandler(InvalidTransitionException.class) ResponseEntity toResponse(InvalidTransitionException exception); @ExceptionHandler(NodeInstanceNotFoundException.class) ResponseEntity toResponse(NodeInstanceNotFoundException exception); @ExceptionHandler(NodeNotFoundException.class) ResponseEntity toResponse(NodeNotFoundException exception); @ExceptionHandler(NotAuthorizedException.class) ResponseEntity toResponse(NotAuthorizedException exception); @ExceptionHandler(value = {ProcessInstanceDuplicatedException.class}) ResponseEntity<Object> toResponse(ProcessInstanceDuplicatedException exception); @ExceptionHandler(ProcessInstanceExecutionException.class) ResponseEntity toResponse(ProcessInstanceExecutionException exception); @ExceptionHandler(ProcessInstanceNotFoundException.class) ResponseEntity toResponse(ProcessInstanceNotFoundException exception); @ExceptionHandler(VariableViolationException.class) ResponseEntity toResponse(VariableViolationException exception);  }
@Test void testBadRequest() { ResponseEntity responseEntity = tested.badRequest(body); assertResponse(responseEntity, HttpStatus.BAD_REQUEST); }