use of org.springframework.cloud.stream.messaging.Processor in project spring-cloud-stream by spring-cloud.
the class InputOutputBindingOrderTest method testInputOutputBindingOrder.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void testInputOutputBindingOrder() {
ConfigurableApplicationContext applicationContext = SpringApplication.run(TestSource.class, "--server.port=-1");
@SuppressWarnings("rawtypes") Binder binder = applicationContext.getBean(BinderFactory.class).getBinder(null, MessageChannel.class);
Processor processor = applicationContext.getBean(Processor.class);
// input is bound after the context has been started
verify(binder).bindConsumer(eq("input"), isNull(), eq(processor.input()), Mockito.any());
SomeLifecycle someLifecycle = applicationContext.getBean(SomeLifecycle.class);
assertThat(someLifecycle.isRunning());
applicationContext.close();
assertThat(someLifecycle.isRunning()).isFalse();
applicationContext.close();
}
Aggregations