Java DSL polishing around HeaderEnricherSpec
* Make `HeaderEnricherSpec extends ConsumerEndpointSpec` to avoid extra EIP-method with two `Consumer`s, when only one for the `HeaderEnricherSpec` can address all the options - header enricher, as well as target endpoint * Move `this.endpointFactoryBean.setHandler(this.handler)` into the `ConsumerEndpointSpec#doGet()` instead of ctor to avoid duplicate code from the target implementations (e.g. `BarrierSpec`)
This commit is contained in:
committed by
Gary Russell
parent
515042fa03
commit
78bab07874
@@ -177,7 +177,7 @@ public class CorrelationHandlerTests {
|
||||
return f -> f.enrichHeaders(s -> s.header("FOO", "BAR"))
|
||||
.split("testSplitterData", "buildList", c -> c.applySequence(false))
|
||||
.channel(MessageChannels.executor(taskExecutor()))
|
||||
.split(Message.class, m -> m.getPayload(), c -> c.applySequence(false))
|
||||
.split(Message.class, Message::getPayload, c -> c.applySequence(false))
|
||||
.channel(MessageChannels.executor(taskExecutor()))
|
||||
.split(s -> s
|
||||
.applySequence(false)
|
||||
|
||||
@@ -304,8 +304,9 @@ public class TransformerTests {
|
||||
@Bean
|
||||
public IntegrationFlow pojoTransformFlow() {
|
||||
return f -> f
|
||||
.enrichHeaders(h -> h.header("Foo", "Bar"),
|
||||
e -> e.advice(idempotentReceiverInterceptor()))
|
||||
.enrichHeaders(h -> h
|
||||
.header("Foo", "Bar")
|
||||
.advice(idempotentReceiverInterceptor()))
|
||||
.transform(new PojoTransformer());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user