HodViewController extends ViewController<HodViewRequest, ResourceName, HodErrorException> { @SuppressWarnings("TypeMayBeWeakened") @ExceptionHandler @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) public ModelAndView handleGeneralException( final Exception e, final HttpServletRequest request, final ServletResponse response ) { response.reset(); return controllerUtils.buildErrorModelAndView(new ErrorModelAndViewInfo.Builder() .setRequest(request) .setMainMessageCode(HOD_ERROR_MESSAGE_CODE_INTERNAL_MAIN) .setSubMessageCode(HOD_ERROR_MESSAGE_CODE_INTERNAL_SUB) .setStatusCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR) .setContactSupport(true) .setException(e) .build()); } @SuppressWarnings("TypeMayBeWeakened") @Autowired  HodViewController(final HodViewServerService viewServerService,
                             final ObjectFactory<HodViewRequestBuilder> viewRequestBuilderFactory,
                             final ControllerUtils controllerUtils); @SuppressWarnings("TypeMayBeWeakened") @ExceptionHandler ModelAndView handleHodErrorException(
            final HodErrorException e,
            final HttpServletRequest request,
            final HttpServletResponse response
    ); @SuppressWarnings("TypeMayBeWeakened") @ExceptionHandler ModelAndView hodAuthenticationFailedException(
            final HodAuthenticationFailedException e,
            final HttpServletRequest request,
            final HttpServletResponse response
    ); @SuppressWarnings("TypeMayBeWeakened") @ExceptionHandler @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) ModelAndView handleGeneralException(
            final Exception e,
            final HttpServletRequest request,
            final ServletResponse response
    );  }
@Test public void handleGeneralException() { assertNotNull(viewController.handleGeneralException(new Exception(), new MockHttpServletRequest(), new MockHttpServletResponse())); verify(controllerUtils).buildErrorModelAndView(any(ErrorModelAndViewInfo.class)); }