diff --git a/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatorAdapterTests.java b/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatorAdapterTests.java index a8a5e74e93..b52d7fb973 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatorAdapterTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/router/AggregatorAdapterTests.java @@ -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; + } } }