### Question:
ImageUploadController { @ExceptionHandler(value = ImageProcessException.class) @ResponseBody public FailJsonResponse handleImageProcessException(ImageProcessException e, Locale locale) { String errorMessage = messageSource.getMessage(COMMON_ERROR_RESOURCE_MESSAGE, null, locale); return new FailJsonResponse(JsonResponseReason.INTERNAL_SERVER_ERROR, errorMessage); } ImageUploadController(MessageSource messageSource); @ExceptionHandler(value = ImageSizeException.class) @ResponseBody FailJsonResponse handleImageSizeException(ImageSizeException e, Locale locale); @ExceptionHandler(value = ImageFormatException.class) @ResponseBody FailJsonResponse handleImageFormatException(ImageFormatException e, Locale locale); @ExceptionHandler(value = ImageProcessException.class) @ResponseBody FailJsonResponse handleImageProcessException(ImageProcessException e, Locale locale); MessageSource getMessageSource(); Date getIfModifiedSinceDate(String ifModifiedSinceHeader);  }### Answer:
@Test public void handleImageProcessExceptionShouldReturnInternalServerErrorAndErrorMessage() { Locale locale = Locale.ENGLISH; String expectedMessage = "a message"; when(messageSource.getMessage( imageUploadController.COMMON_ERROR_RESOURCE_MESSAGE, null, locale) ).thenReturn(expectedMessage); FailJsonResponse result = imageUploadController.handleImageProcessException(null, locale); assertEquals(result.getStatus(), JsonResponseStatus.FAIL, "We have an exception, so we should get false value."); assertEquals(result.getReason(), JsonResponseReason.INTERNAL_SERVER_ERROR, "Failture reason should be validation"); assertEquals(result.getResult(), expectedMessage, "Result contains incorrect message."); }