use of org.springframework.integration.dsl.MessageProducerSpec in project spring-integration by spring-projects.
the class ManualFlowTests method testWithAnonymousMessageProducerSpecStart.
@Test
public void testWithAnonymousMessageProducerSpecStart() {
final AtomicBoolean started = new AtomicBoolean();
class MyProducer extends MessageProducerSupport {
@Override
protected void doStart() {
started.set(true);
super.doStart();
}
}
class MyProducerSpec extends MessageProducerSpec<MyProducerSpec, MyProducer> {
MyProducerSpec(MyProducer producer) {
super(producer);
}
}
MyProducerSpec spec = new MyProducerSpec(new MyProducer());
QueueChannel channel = new QueueChannel();
IntegrationFlow flow = IntegrationFlows.from(spec.id("foo")).channel(channel).get();
this.integrationFlowContext.registration(flow).register();
assertTrue(started.get());
}
Aggregations