### Question:
GlobalExceptionHandlerController { @ExceptionHandler(value = MethodArgumentTypeMismatchException.class) public ResponseEntity methodArgumentTypeMismatchException(MethodArgumentTypeMismatchException ex, HandlerMethod handlerMethod) { log.warn("MethodArgumentTypeMismatchException handled in service: {}, message: {}", handlerMethod.getMethod().getDeclaringClass().getSimpleName(), ex.getMessage()); return responseErrorMapper.generateErrorResponse(createMessageError(FORMAT_ERROR)); }  @ExceptionHandler(value = ValidationException.class) ResponseEntity validationException(ValidationException ex, HandlerMethod handlerMethod); @ExceptionHandler(value = ServletRequestBindingException.class) ResponseEntity servletRequestBindingException(ServletRequestBindingException ex,
                                                         HandlerMethod handlerMethod); @ExceptionHandler(value = IllegalArgumentException.class) ResponseEntity illegalArgumentException(IllegalArgumentException ex, HandlerMethod handlerMethod); @ExceptionHandler(value = HttpMessageNotReadableException.class) ResponseEntity httpMessageException(HttpMessageNotReadableException ex, HandlerMethod handlerMethod); @ExceptionHandler(value = HttpMediaTypeNotAcceptableException.class) ResponseEntity mediaTypeNotSupportedException(HttpMediaTypeNotAcceptableException ex,
                                                         HandlerMethod handlerMethod); @ExceptionHandler(value = Exception.class) ResponseEntity exception(Exception ex, HandlerMethod handlerMethod); @ExceptionHandler(value = RestException.class) ResponseEntity restException(RestException ex, HandlerMethod handlerMethod); @ExceptionHandler(value = AspspProfileRestException.class) ResponseEntity aspspProfileRestException(AspspProfileRestException ex, HandlerMethod handlerMethod); @ExceptionHandler(value = ResourceAccessException.class) ResponseEntity resourceAccessException(ResourceAccessException ex, HandlerMethod handlerMethod); @ExceptionHandler(value = MethodArgumentNotValidException.class) ResponseEntity requestBodyValidationException(MethodArgumentNotValidException ex,
                                                         HandlerMethod handlerMethod); @ExceptionHandler(value = CertificateException.class) ResponseEntity getTppIdException(CertificateException ex, HandlerMethod handlerMethod); @ExceptionHandler(value = MethodArgumentTypeMismatchException.class) ResponseEntity methodArgumentTypeMismatchException(MethodArgumentTypeMismatchException ex,
                                                              HandlerMethod handlerMethod); @ExceptionHandler(value = WrongPaymentTypeException.class) ResponseEntity wrongPaymentTypeException(WrongPaymentTypeException ex,
                                                              HandlerMethod handlerMethod);  }### Answer:
@Test void methodArgumentTypeMismatchException_shouldReturnFormatError() throws NoSuchMethodException { when(serviceTypeDiscoveryService.getServiceType()) .thenReturn(ServiceType.AIS); when(errorTypeMapper.mapToErrorType(ServiceType.AIS, 400)) .thenReturn(ErrorType.AIS_400); when(handlerMethod.getMethod()).thenReturn(Object.class.getMethod("toString")); MethodArgumentTypeMismatchException exception = new MethodArgumentTypeMismatchException(new Object(), LocalDate.class, null, null, null); globalExceptionHandlerController.methodArgumentTypeMismatchException(exception, handlerMethod); verify(errorTypeMapper).mapToErrorType(ServiceType.AIS, 400); verify(responseErrorMapper).generateErrorResponse(new MessageError(ErrorType.AIS_400, TppMessageInformation.of(MessageErrorCode.FORMAT_ERROR))); }