### Question:
InternalServerErrorController implements ErrorController { @SuppressWarnings("squid:S3752") @RequestMapping(value = ERROR_ENDPOINT, produces = "application/json") @ResponseBody public ResponseEntity<ApiMessageView> error(HttpServletRequest request) { final Throwable exc = (Throwable) request.getAttribute(ErrorUtils.ATTR_ERROR_EXCEPTION); ResponseEntity<ApiMessageView> entity = checkForSpecificErrors(request, exc); if (entity != null) { return entity; } return createResponseForInternalError(request, exc); } @Autowired  InternalServerErrorController(MessageService messageService); @Override String getErrorPath(); @SuppressWarnings("squid:S3752") @RequestMapping(value = ERROR_ENDPOINT, produces = "application/json") @ResponseBody ResponseEntity<ApiMessageView> error(HttpServletRequest request);  }### Answer:
@Test void testGenericError() { MessageService messageService = new YamlMessageService(); InternalServerErrorController errorController = new InternalServerErrorController(messageService); MockHttpServletRequest request = new MockHttpServletRequest(); request.setAttribute(ErrorUtils.ATTR_ERROR_EXCEPTION, new Exception("Hello")); request.setAttribute(ErrorUtils.ATTR_ERROR_STATUS_CODE, 523); request.setAttribute(RequestDispatcher.FORWARD_REQUEST_URI, "/uri"); ResponseEntity<ApiMessageView> response = errorController.error(request); assertEquals(523, response.getStatusCodeValue()); assertEquals("org.zowe.apiml.common.internalRequestError", response.getBody().getMessages().get(0).getMessageKey()); assertTrue(response.getBody().getMessages().get(0).getMessageContent().contains("Hello")); assertTrue(response.getBody().getMessages().get(0).getMessageContent().contains("/uri")); }