Fixed sentTo attribute
This commit is contained in:
@@ -68,7 +68,7 @@ class JUnitMessagingMethodBodyBuilder extends MessagingMethodBodyBuilder {
|
||||
|
||||
@Override
|
||||
protected void validateResponseHeadersBlock(BlockBuilder bb) {
|
||||
bb.addLine("""AccurestMessage response = accurestMessaging.receiveMessage("${outputMessage.sentTo}");""")
|
||||
bb.addLine("""AccurestMessage response = accurestMessaging.receiveMessage("${outputMessage.sentTo.serverValue}");""")
|
||||
bb.addLine("""assertThat(response).isNotNull();""")
|
||||
outputMessage.headers?.collect { Header header ->\
|
||||
processHeaderElement(bb, header.name, header.serverValue)
|
||||
|
||||
@@ -62,7 +62,7 @@ class SpockMessagingMethodBodyBuilder extends MessagingMethodBodyBuilder {
|
||||
@Override
|
||||
protected void validateResponseCodeBlock(BlockBuilder bb) {
|
||||
if (outputMessage) {
|
||||
bb.addLine("""def response = accurestMessaging.receiveMessage('${outputMessage.sentTo}')""")
|
||||
bb.addLine("""def response = accurestMessaging.receiveMessage('${outputMessage.sentTo.serverValue}')""")
|
||||
bb.addLine("""assert response != null""")
|
||||
} else {
|
||||
bb.addLine('noExceptionThrown()')
|
||||
|
||||
@@ -10,7 +10,7 @@ import groovy.transform.TypeChecked
|
||||
@ToString(includePackage = false, includeNames = true)
|
||||
class OutputMessage extends Common {
|
||||
|
||||
String sentTo
|
||||
DslProperty<String> sentTo
|
||||
Headers headers
|
||||
DslProperty body
|
||||
ExecutionProperty assertThat
|
||||
@@ -24,6 +24,10 @@ class OutputMessage extends Common {
|
||||
}
|
||||
|
||||
void sentTo(String sentTo) {
|
||||
this.sentTo = new DslProperty(sentTo)
|
||||
}
|
||||
|
||||
void sentTo(DslProperty sentTo) {
|
||||
this.sentTo = sentTo
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class StubRunnerCamelConfiguration {
|
||||
from(it.input.messageFrom)
|
||||
.filter(new StubRunnerCamelPredicate(it))
|
||||
.process(new StubRunnerCamelProcessor(it))
|
||||
.to(it.outputMessage.sentTo)
|
||||
.to(it.outputMessage.sentTo.clientValue)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ class StubRunnerIntegrationConfiguration {
|
||||
.filter(new StubRunnerIntegrationMessageSelector(dsl), { FilterEndpointSpec e -> e.id("${flowName}.filter") } )
|
||||
.transform(new StubRunnerIntegrationTransformer(dsl), { GenericEndpointSpec e -> e.id("${flowName}.transformer") })
|
||||
if (dsl.outputMessage) {
|
||||
builder = builder.channel(dsl.outputMessage.sentTo)
|
||||
builder = builder.channel(dsl.outputMessage.sentTo.clientValue)
|
||||
} else {
|
||||
builder = builder.handle(new DummyMessageHandler(), "handle")
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class StubRunnerStreamConfiguration {
|
||||
.filter(new StubRunnerStreamMessageSelector(dsl), { FilterEndpointSpec e -> e.id("${flowName}.filter") } )
|
||||
.transform(new StubRunnerStreamTransformer(dsl), { GenericEndpointSpec e -> e.id("${flowName}.transformer") })
|
||||
if (dsl.outputMessage) {
|
||||
builder = builder.channel(dsl.outputMessage.sentTo)
|
||||
builder = builder.channel(dsl.outputMessage.sentTo.clientValue)
|
||||
} else {
|
||||
builder = builder.handle(new DummyMessageHandler(), "handle")
|
||||
}
|
||||
@@ -51,7 +51,7 @@ class StubRunnerStreamConfiguration {
|
||||
beanFactory.getBean("${flowName}.transformer", Lifecycle.class).start();
|
||||
channelBindingService.bindConsumer(beanFactory.getBean(dsl.input.messageFrom, MessageChannel.class), dsl.input.messageFrom)
|
||||
if (dsl.outputMessage) {
|
||||
channelBindingService.bindProducer(beanFactory.getBean(dsl.outputMessage.sentTo, MessageChannel.class), dsl.outputMessage.sentTo)
|
||||
channelBindingService.bindProducer(beanFactory.getBean(dsl.outputMessage.sentTo.clientValue, MessageChannel.class), dsl.outputMessage.sentTo.clientValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ class StubRunnerExecutor implements StubFinder {
|
||||
}
|
||||
AccurestMessage message = accurestMessaging.create(groovyDsl.outputMessage.body.clientValue,
|
||||
groovyDsl.outputMessage.headers.asStubSideMap())
|
||||
accurestMessaging.send(message, groovyDsl.outputMessage.sentTo)
|
||||
accurestMessaging.send(message, groovyDsl.outputMessage.sentTo.clientValue)
|
||||
}
|
||||
|
||||
private URL returnStubUrlIfMatches(boolean condition) {
|
||||
|
||||
Reference in New Issue
Block a user