@Test void supportsParameter_withWrongParameterType_shouldReturnFalse() throws Exception { NotificationSubjectHandlerMethodArgumentResolver resolver = new NotificationSubjectHandlerMethodArgumentResolver(); Method methodWithWrongParameterType = this.getClass() .getDeclaredMethod("methodWithWrongParameterType", Integer.class); MethodParameter methodParameter = new MethodParameter( methodWithWrongParameterType, 0); boolean supportsParameter = resolver.supportsParameter(methodParameter); assertThat(supportsParameter).isFalse(); }
@Override public boolean supportsParameter(MethodParameter parameter) { return (parameter.hasParameterAnnotation(NotificationSubject.class) && ClassUtils.isAssignable(String.class, parameter.getParameterType())); }
NotificationSubjectHandlerMethodArgumentResolver extends AbstractNotificationMessageHandlerMethodArgumentResolver { @Override public boolean supportsParameter(MethodParameter parameter) { return (parameter.hasParameterAnnotation(NotificationSubject.class) && ClassUtils.isAssignable(String.class, parameter.getParameterType())); } }
NotificationSubjectHandlerMethodArgumentResolver extends AbstractNotificationMessageHandlerMethodArgumentResolver { @Override public boolean supportsParameter(MethodParameter parameter) { return (parameter.hasParameterAnnotation(NotificationSubject.class) && ClassUtils.isAssignable(String.class, parameter.getParameterType())); }  }
NotificationSubjectHandlerMethodArgumentResolver extends AbstractNotificationMessageHandlerMethodArgumentResolver { @Override public boolean supportsParameter(MethodParameter parameter) { return (parameter.hasParameterAnnotation(NotificationSubject.class) && ClassUtils.isAssignable(String.class, parameter.getParameterType())); }  @Override boolean supportsParameter(MethodParameter parameter); }
NotificationSubjectHandlerMethodArgumentResolver extends AbstractNotificationMessageHandlerMethodArgumentResolver { @Override public boolean supportsParameter(MethodParameter parameter) { return (parameter.hasParameterAnnotation(NotificationSubject.class) && ClassUtils.isAssignable(String.class, parameter.getParameterType())); }  @Override boolean supportsParameter(MethodParameter parameter);  }