Fixed sentTo attribute

This commit is contained in:
Marcin Grzejszczak
2016-04-25 17:21:20 +02:00
parent b589633292
commit 819e35bd88
7 changed files with 12 additions and 8 deletions

View File

@@ -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)

View File

@@ -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()')

View File

@@ -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
}

View File

@@ -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)
}
}
};

View File

@@ -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")
}

View File

@@ -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)
}
}
}

View File

@@ -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) {