Add test method reflecting the fact that the only type of parameter that is supported by AggregatorAdapter is Collection<?> and not one of the Collection subclasses. This might change in a future version.
This commit is contained in:
@@ -19,6 +19,7 @@ package org.springframework.integration.router;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
@@ -107,6 +108,11 @@ public class AggregatorAdapterTests {
|
||||
new AggregatorAdapter(simpleAggregator, "notEnoughParameters");
|
||||
}
|
||||
|
||||
@Test(expected=MessagingConfigurationException.class)
|
||||
public void testCollectionSubclassParameterUsingMethodName() {
|
||||
new AggregatorAdapter(simpleAggregator, "collectionSubclassParameter");
|
||||
}
|
||||
|
||||
@Test(expected=MessagingConfigurationException.class)
|
||||
public void testInvalidParameterTypeUsingMethodObject() throws SecurityException, NoSuchMethodException {
|
||||
new AggregatorAdapter(simpleAggregator, simpleAggregator.getClass().getMethod(
|
||||
@@ -125,6 +131,12 @@ public class AggregatorAdapterTests {
|
||||
"notEnoughParameters", new Class[] {} ));
|
||||
}
|
||||
|
||||
@Test(expected= MessagingConfigurationException.class)
|
||||
public void testCollectionSubclassParameterUsingMethodObject() throws SecurityException, NoSuchMethodException {
|
||||
new AggregatorAdapter(simpleAggregator, simpleAggregator.getClass().getMethod(
|
||||
"collectionSubclassParameter", new Class[] {List.class} ));
|
||||
}
|
||||
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testNullObject() {
|
||||
new AggregatorAdapter(null, "doesNotMatter");
|
||||
@@ -222,6 +234,10 @@ public class AggregatorAdapterTests {
|
||||
public Message<?> notEnoughParameters() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Message<?> collectionSubclassParameter(List<?> l1){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user