Adjusted JavaDoc for handler method validation after INT-682 changes.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,9 +36,9 @@ abstract class HandlerMethodUtils {
|
||||
|
||||
/**
|
||||
* Verifies that the provided Method is capable of handling Messages.
|
||||
* It must accept at least one parameter, and if it expects more than one
|
||||
* parameter, at most one of them may expect the payload object. Others
|
||||
* must be annotated for accepting Message header values.
|
||||
* It must be public, and not defined directly on Object. If it expects
|
||||
* more than one parameter, at most one of them may expect the payload
|
||||
* object. Others must be annotated for accepting Message header values.
|
||||
*/
|
||||
public static boolean isValidHandlerMethod(Method method) {
|
||||
if (method.getDeclaringClass().equals(Object.class)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.handler;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
@@ -38,12 +39,6 @@ public class StaticHandlerMethodResolverTests {
|
||||
new StaticHandlerMethodResolver(method);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void noArgMethodIsNotValid() throws Exception {
|
||||
Method method = TestBean.class.getDeclaredMethod("noArgMethod", new Class<?>[0]);
|
||||
new StaticHandlerMethodResolver(method);
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void privateMethodIsNotValid() throws Exception {
|
||||
Method method = TestBean.class.getDeclaredMethod("privateMethod", new Class<?>[] {String.class});
|
||||
@@ -70,6 +65,12 @@ public class StaticHandlerMethodResolverTests {
|
||||
assertEquals(method, resolved);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void validNoArgMethod() throws Exception {
|
||||
Method method = TestBean.class.getDeclaredMethod("noArgMethod", new Class<?>[0]);
|
||||
new StaticHandlerMethodResolver(method);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void validHeaderMethod() throws Exception {
|
||||
Method method = TestBean.class.getDeclaredMethod("headerMethod", new Class<?>[] {String.class});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -48,7 +48,7 @@ public class MethodInvokingMessageHandlerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void invalidMethodWithNoArgs() {
|
||||
public void validMethodWithNoArgs() {
|
||||
new MethodInvokingMessageHandler(new TestSink(), "validMethodWithNoArgs");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user