use of org.springframework.integration.aggregator.ReleaseStrategy in project spring-integration by spring-projects.
the class ReleaseStrategyFactoryBeanTests method testRefWithMethodWithDifferentAnnotatedMethod.
@Test
public void testRefWithMethodWithDifferentAnnotatedMethod() throws Exception {
Bar bar = new Bar();
ReleaseStrategyFactoryBean factory = new ReleaseStrategyFactoryBean();
factory.setTarget(bar);
factory.setMethodName("doRelease2");
factory.afterPropertiesSet();
ReleaseStrategy delegate = factory.getObject();
assertThat(delegate, instanceOf(MethodInvokingReleaseStrategy.class));
assertThat(TestUtils.getPropertyValue(delegate, "adapter.delegate.targetObject", Bar.class), is(bar));
assertThat(TestUtils.getPropertyValue(delegate, "adapter.delegate.handlerMethod.expressionString"), equalTo("#target.doRelease2(messages)"));
}
Aggregations