From fdda24c46dea2ce7497e548bb3f7d4939e95bc2f Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 13 Nov 2018 18:03:29 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- multi/multi_stub-runner-for-messaging.html | 6 +++--- single/spring-cloud-contract.html | 6 +++--- spring-cloud-contract.xml | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/multi/multi_stub-runner-for-messaging.html b/multi/multi_stub-runner-for-messaging.html index 0632f290aa..04f7e48b76 100644 --- a/multi/multi_stub-runner-for-messaging.html +++ b/multi/multi_stub-runner-for-messaging.html @@ -98,11 +98,11 @@ Remember to annotate your test class with @AutoConfigureSt header('BOOK-NAME', 'foo') } } -}

Scenario 1 (no input message)

So as to trigger a message via the return_book_1 label we’ll use the StubTigger interface as follows

stubFinder.trigger('return_book_1')

Next we’ll want to listen to the output of the message sent to jms:output

Exchange receivedMessage = camelContext.createConsumerTemplate().receive('jms:output', 5000)

And the received message would pass the following assertions

receivedMessage != null
+}

Scenario 1 (no input message)

So as to trigger a message via the return_book_1 label we’ll use the StubTigger interface as follows

stubFinder.trigger('return_book_1')

Next we’ll want to listen to the output of the message sent to jms:output

Exchange receivedMessage = consumerTemplate.receive('jms:output', 5000)

And the received message would pass the following assertions

receivedMessage != null
 assertThatBodyContainsBookNameFoo(receivedMessage.in.body)
-receivedMessage.in.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input)

Since the route is set for you it’s enough to just send a message to the jms:output destination.

camelContext.createProducerTemplate().sendBodyAndHeaders('jms:input', new BookReturned('foo'), [sample: 'header'])

Next we’ll want to listen to the output of the message sent to jms:output

Exchange receivedMessage = camelContext.createConsumerTemplate().receive('jms:output', 5000)

And the received message would pass the following assertions

receivedMessage != null
+receivedMessage.in.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input)

Since the route is set for you it’s enough to just send a message to the jms:output destination.

producerTemplate.sendBodyAndHeaders('jms:input', new BookReturned('foo'), [sample: 'header'])

Next we’ll want to listen to the output of the message sent to jms:output

Exchange receivedMessage = consumerTemplate.receive('jms:output', 5000)

And the received message would pass the following assertions

receivedMessage != null
 assertThatBodyContainsBookNameFoo(receivedMessage.in.body)
-receivedMessage.in.headers.get('BOOK-NAME') == 'foo'

Scenario 3 (input with no output)

Since the route is set for you it’s enough to just send a message to the jms:output destination.

camelContext.createProducerTemplate().sendBodyAndHeaders('jms:delete', new BookReturned('foo'), [sample: 'header'])

7.3 Stub Runner Integration

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to +receivedMessage.in.headers.get('BOOK-NAME') == 'foo'

Scenario 3 (input with no output)

Since the route is set for you it’s enough to just send a message to the jms:output destination.

producerTemplate.sendBodyAndHeaders('jms:delete', new BookReturned('foo'), [sample: 'header'])

7.3 Stub Runner Integration

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to integrate with Spring Integration. For the provided artifacts, it automatically downloads the stubs and registers the required routes.

7.3.1 Adding the Runner to the Project

You can have both Spring Integration and Spring Cloud Contract Stub Runner on the classpath. Remember to annotate your test class with @AutoConfigureStubRunner.

7.3.2 Disabling the functionality

If you need to disable this functionality, set the diff --git a/single/spring-cloud-contract.html b/single/spring-cloud-contract.html index 207b2733da..ff575a8c39 100644 --- a/single/spring-cloud-contract.html +++ b/single/spring-cloud-contract.html @@ -3199,11 +3199,11 @@ Remember to annotate your test class with @AutoConfigureSt header('BOOK-NAME', 'foo') } } -}

Scenario 1 (no input message)

So as to trigger a message via the return_book_1 label we’ll use the StubTigger interface as follows

stubFinder.trigger('return_book_1')

Next we’ll want to listen to the output of the message sent to jms:output

Exchange receivedMessage = camelContext.createConsumerTemplate().receive('jms:output', 5000)

And the received message would pass the following assertions

receivedMessage != null
+}

Scenario 1 (no input message)

So as to trigger a message via the return_book_1 label we’ll use the StubTigger interface as follows

stubFinder.trigger('return_book_1')

Next we’ll want to listen to the output of the message sent to jms:output

Exchange receivedMessage = consumerTemplate.receive('jms:output', 5000)

And the received message would pass the following assertions

receivedMessage != null
 assertThatBodyContainsBookNameFoo(receivedMessage.in.body)
-receivedMessage.in.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input)

Since the route is set for you it’s enough to just send a message to the jms:output destination.

camelContext.createProducerTemplate().sendBodyAndHeaders('jms:input', new BookReturned('foo'), [sample: 'header'])

Next we’ll want to listen to the output of the message sent to jms:output

Exchange receivedMessage = camelContext.createConsumerTemplate().receive('jms:output', 5000)

And the received message would pass the following assertions

receivedMessage != null
+receivedMessage.in.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input)

Since the route is set for you it’s enough to just send a message to the jms:output destination.

producerTemplate.sendBodyAndHeaders('jms:input', new BookReturned('foo'), [sample: 'header'])

Next we’ll want to listen to the output of the message sent to jms:output

Exchange receivedMessage = consumerTemplate.receive('jms:output', 5000)

And the received message would pass the following assertions

receivedMessage != null
 assertThatBodyContainsBookNameFoo(receivedMessage.in.body)
-receivedMessage.in.headers.get('BOOK-NAME') == 'foo'

Scenario 3 (input with no output)

Since the route is set for you it’s enough to just send a message to the jms:output destination.

camelContext.createProducerTemplate().sendBodyAndHeaders('jms:delete', new BookReturned('foo'), [sample: 'header'])

7.3 Stub Runner Integration

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to +receivedMessage.in.headers.get('BOOK-NAME') == 'foo'

Scenario 3 (input with no output)

Since the route is set for you it’s enough to just send a message to the jms:output destination.

producerTemplate.sendBodyAndHeaders('jms:delete', new BookReturned('foo'), [sample: 'header'])

7.3 Stub Runner Integration

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to integrate with Spring Integration. For the provided artifacts, it automatically downloads the stubs and registers the required routes.

7.3.1 Adding the Runner to the Project

You can have both Spring Integration and Spring Cloud Contract Stub Runner on the classpath. Remember to annotate your test class with @AutoConfigureStubRunner.

7.3.2 Disabling the functionality

If you need to disable this functionality, set the diff --git a/spring-cloud-contract.xml b/spring-cloud-contract.xml index 84e7767970..7b6e2b038d 100644 --- a/spring-cloud-contract.xml +++ b/spring-cloud-contract.xml @@ -5500,7 +5500,7 @@ Remember to annotate your test class with @AutoConfigureStubRunnerSo as to trigger a message via the return_book_1 label we’ll use the StubTigger interface as follows stubFinder.trigger('return_book_1') Next we’ll want to listen to the output of the message sent to jms:output -Exchange receivedMessage = camelContext.createConsumerTemplate().receive('jms:output', 5000) +Exchange receivedMessage = consumerTemplate.receive('jms:output', 5000) And the received message would pass the following assertions receivedMessage != null assertThatBodyContainsBookNameFoo(receivedMessage.in.body) @@ -5509,9 +5509,9 @@ receivedMessage.in.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input) Since the route is set for you it’s enough to just send a message to the jms:output destination. -camelContext.createProducerTemplate().sendBodyAndHeaders('jms:input', new BookReturned('foo'), [sample: 'header']) +producerTemplate.sendBodyAndHeaders('jms:input', new BookReturned('foo'), [sample: 'header']) Next we’ll want to listen to the output of the message sent to jms:output -Exchange receivedMessage = camelContext.createConsumerTemplate().receive('jms:output', 5000) +Exchange receivedMessage = consumerTemplate.receive('jms:output', 5000) And the received message would pass the following assertions receivedMessage != null assertThatBodyContainsBookNameFoo(receivedMessage.in.body) @@ -5520,7 +5520,7 @@ receivedMessage.in.headers.get('BOOK-NAME') == 'foo'
Scenario 3 (input with no output) Since the route is set for you it’s enough to just send a message to the jms:output destination. -camelContext.createProducerTemplate().sendBodyAndHeaders('jms:delete', new BookReturned('foo'), [sample: 'header']) +producerTemplate.sendBodyAndHeaders('jms:delete', new BookReturned('foo'), [sample: 'header'])