Search in sources :

Example 11 with ReleaseStrategy

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)"));
}
Also used : MethodInvokingReleaseStrategy(org.springframework.integration.aggregator.MethodInvokingReleaseStrategy) MethodInvokingReleaseStrategy(org.springframework.integration.aggregator.MethodInvokingReleaseStrategy) ReleaseStrategy(org.springframework.integration.aggregator.ReleaseStrategy) SequenceSizeReleaseStrategy(org.springframework.integration.aggregator.SequenceSizeReleaseStrategy) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 MethodInvokingReleaseStrategy (org.springframework.integration.aggregator.MethodInvokingReleaseStrategy)11 ReleaseStrategy (org.springframework.integration.aggregator.ReleaseStrategy)11 SequenceSizeReleaseStrategy (org.springframework.integration.aggregator.SequenceSizeReleaseStrategy)6 EventDrivenConsumer (org.springframework.integration.endpoint.EventDrivenConsumer)5 ExpressionEvaluatingReleaseStrategy (org.springframework.integration.aggregator.ExpressionEvaluatingReleaseStrategy)4 MessageChannel (org.springframework.messaging.MessageChannel)3 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)2 CorrelationStrategy (org.springframework.integration.aggregator.CorrelationStrategy)2 ExpressionEvaluatingCorrelationStrategy (org.springframework.integration.aggregator.ExpressionEvaluatingCorrelationStrategy)2 PollableChannel (org.springframework.messaging.PollableChannel)2 AggregatingMessageHandler (org.springframework.integration.aggregator.AggregatingMessageHandler)1 MethodInvokingMessageGroupProcessor (org.springframework.integration.aggregator.MethodInvokingMessageGroupProcessor)1 ResequencingMessageHandler (org.springframework.integration.aggregator.ResequencingMessageHandler)1 SimpleMessageGroup (org.springframework.integration.store.SimpleMessageGroup)1 LockRegistry (org.springframework.integration.support.locks.LockRegistry)1