INT-682, added no-arg method support for handlers, removed assertion for no-arg handler methods in HandlerMethodUtils and StaticHandlerMethodResolver, fixed test cases
This commit is contained in:
@@ -30,6 +30,7 @@ import org.springframework.integration.annotation.Headers;
|
||||
* Utility methods for common behavior related to Message-handling methods.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
abstract class HandlerMethodUtils {
|
||||
|
||||
@@ -47,9 +48,6 @@ abstract class HandlerMethodUtils {
|
||||
return false;
|
||||
}
|
||||
Class<?>[] parameterTypes = method.getParameterTypes();
|
||||
if (parameterTypes.length == 0) {
|
||||
return false;
|
||||
}
|
||||
if (parameterTypes.length > 1) {
|
||||
// at most one parameter can be lacking @Header or @Headers
|
||||
boolean foundPayloadParam = false;
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.springframework.util.Assert;
|
||||
* or otherwise resolvable in advance based on static metadata.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Oleg Zhurakousky
|
||||
*/
|
||||
public class StaticHandlerMethodResolver implements HandlerMethodResolver {
|
||||
|
||||
@@ -35,8 +36,6 @@ public class StaticHandlerMethodResolver implements HandlerMethodResolver {
|
||||
|
||||
public StaticHandlerMethodResolver(Method method) {
|
||||
Assert.notNull(method, "method must not be null");
|
||||
Assert.notEmpty(method.getParameterTypes(),
|
||||
"Message-handling method [" + method + "] must accept at least one parameter.");
|
||||
Assert.isTrue(HandlerMethodUtils.isValidHandlerMethod(method),
|
||||
"Invalid Message-handling method [" + method + "]");
|
||||
this.method = method;
|
||||
|
||||
Reference in New Issue
Block a user