IdolViewController extends ViewController<IdolViewRequest, String, AciErrorException> { @SuppressWarnings("TypeMayBeWeakened") @ExceptionHandler @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) public ModelAndView handleViewServerErrorException( final ViewServerErrorException e, final HttpServletRequest request, final ServletResponse response ) { response.reset(); final String reference = e.getReference(); log.info(Markers.AUDIT, "TRIED TO VIEW DOCUMENT WITH REFERENCE {} BUT VIEW SERVER RETURNED AN ERROR PAGE", reference); return controllerUtils.buildErrorModelAndView(new ErrorModelAndViewInfo.Builder() .setRequest(request) .setMainMessageCode("error.viewServerErrorMain") .setSubMessageCode("error.viewServerErrorSub") .setSubMessageArguments(new Object[]{reference}) .setStatusCode(HttpStatus.INTERNAL_SERVER_ERROR.value()) .setContactSupport(true) .setException(e) .build()); } @SuppressWarnings("TypeMayBeWeakened") @Autowired  IdolViewController(
            final IdolViewServerService viewServerService,
            final ObjectFactory<IdolViewRequestBuilder> viewRequestBuilder,
            final ControllerUtils controllerUtils,
            final UserService userService,
            final AuthenticationInformationRetriever<?, CommunityPrincipal> authenticationInformationRetriever,
            final ConfigFileService<IdolFindConfig> configService
    ); @Override void viewDocument(
        @RequestParam(REFERENCE_PARAM) final String reference,
        @RequestParam(DATABASE_PARAM) final String database,
        @RequestParam(value = HIGHLIGHT_PARAM, required = false) final String highlightExpression,
        final HttpServletResponse response
    ); @SuppressWarnings("TypeMayBeWeakened") @ExceptionHandler @ResponseStatus(HttpStatus.NOT_FOUND) ModelAndView handleViewDocumentNotFoundException(
            final ViewDocumentNotFoundException e,
            final HttpServletRequest request,
            final ServletResponse response
    ); @SuppressWarnings("TypeMayBeWeakened") @ExceptionHandler @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) ModelAndView handleViewServerErrorException(
            final ViewServerErrorException e,
            final HttpServletRequest request,
            final ServletResponse response
    );  }
@Test public void viewServerError() { assertNotNull(viewController.handleViewServerErrorException(new ViewServerErrorException("some reference", new AciServiceException("It broke")), new MockHttpServletRequest(), new MockHttpServletResponse())); }