use of org.springframework.integration.config.FilterFactoryBean in project spring-integration by spring-projects.
the class FilterAnnotationMethodResolutionTests method resolveAnnotatedMethod.
@Test
public void resolveAnnotatedMethod() throws Exception {
TestUtils.TestApplicationContext testApplicationContext = TestUtils.createTestApplicationContext();
testApplicationContext.refresh();
FilterFactoryBean factoryBean = new FilterFactoryBean();
factoryBean.setBeanFactory(testApplicationContext);
AnnotatedTestFilter filter = new AnnotatedTestFilter();
factoryBean.setTargetObject(filter);
MessageHandler handler = factoryBean.getObject();
QueueChannel replyChannel = new QueueChannel();
handler.handleMessage(MessageBuilder.withPayload("test").setReplyChannel(replyChannel).build());
Message<?> result = replyChannel.receive(0);
assertNotNull(result);
assertTrue(filter.invokedCorrectMethod);
assertFalse(filter.invokedIncorrectMethod);
testApplicationContext.close();
}
Aggregations