-
'''
+'''
given:
ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
\'\'\'{"bookName":"foo"}\'\'\',
@@ -3969,7 +3969,7 @@ and proper stubbed routes are created.
Maven
-
<dependencies>
+<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
@@ -4003,7 +4003,7 @@ and proper stubbed routes are created.
Gradle
-
ext {
+ext {
contractsDir = file("mappings")
stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
}
@@ -4046,7 +4046,7 @@ automatically for you.
Maven
-
<repositories>
+<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
@@ -4103,7 +4103,7 @@ automatically for you.
Gradle
-
buildscript {
+buildscript {
repositories {
mavenCentral()
mavenLocal()
@@ -4134,7 +4134,7 @@ For both Maven and Gradle the setup comes out of the box. But you can customize
Maven
-
<!-- First disable the default jar setup in the properties section-->
+<!-- First disable the default jar setup in the properties section-->
<!-- we don't want the verifier to do a jar for us -->
<spring.cloud.contract.verifier.skip>true</spring.cloud.contract.verifier.skip>
@@ -4205,7 +4205,7 @@ For both Maven and Gradle the setup comes out of the box. But you can customize
Gradle
-
ext {
+ext {
contractsDir = file("mappings")
stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
}
@@ -4271,7 +4271,7 @@ contract processing.
-
@AutoConfigureStubRunner(repositoryRoot="http://foo.bar", ids = "com.example:beer-api-producer:+:stubs:8095")
+
@AutoConfigureStubRunner(repositoryRoot="http://foo.bar", ids = "com.example:beer-api-producer:+:stubs:8095")
@@ -4284,7 +4284,7 @@ following example:
-
@AutoConfigureStubRunner(ids = {
+@AutoConfigureStubRunner(ids = {
"com.example:beer-api-producer:+:stubs:8095",
"com.example.foo:bar:1.0.0:superstubs:8096"
})
@@ -4296,7 +4296,7 @@ following example:
Maven
-
<dependency>
+<dependency>
<groupId>com.example</groupId>
<artifactId>beer-api-producer-restdocs</artifactId>
<classifier>stubs</classifier>
@@ -4327,7 +4327,7 @@ following example:
Gradle
-
testCompile("com.example:beer-api-producer-restdocs:0.0.1-SNAPSHOT:stubs") {
+testCompile("com.example:beer-api-producer-restdocs:0.0.1-SNAPSHOT:stubs") {
transitive = false
}
testCompile("com.example.foo:bar:1.0.0:superstubs") {
@@ -4385,7 +4385,7 @@ producer stubs.
-
└── src
+└── src
└── test
└── resources
└── contracts
@@ -4405,7 +4405,7 @@ structure in your stubs jar.
-
└── META-INF
+└── META-INF
└── com.example
└── beer-api-producer-restdocs
└── 2.0.0
@@ -4450,7 +4450,7 @@ There might be a problem with StubRunner shutting down ports between tests. You
-
-c, --classifier Suffix for the jar containing stubs (e.
+-c, --classifier Suffix for the jar containing stubs (e.
g. 'stubs' if the stub jar would
have a 'stubs' classifier for stubs:
foobar-stubs ). Defaults to 'stubs'
@@ -4492,7 +4492,7 @@ There might be a problem with StubRunner shutting down ports between tests. You
-
{
+{
"request": {
"method": "GET",
"url": "/ping"
@@ -4529,7 +4529,7 @@ There might be a problem with StubRunner shutting down ports between tests. You
-
@ClassRule public static StubRunnerRule rule = new StubRunnerRule()
+@ClassRule public static StubRunnerRule rule = new StubRunnerRule()
.repoRoot(repoRoot())
.downloadStub("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")
.downloadStub("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer");
@@ -4569,7 +4569,7 @@ Check their docs for more informat
-
package org.springframework.cloud.contract.stubrunner;
+package org.springframework.cloud.contract.stubrunner;
import java.net.URL;
import java.util.Collection;
@@ -4613,7 +4613,7 @@ public interface StubFinder extends StubTrigger {
-
@ClassRule @Shared StubRunnerRule rule = new StubRunnerRule()
+@ClassRule @Shared StubRunnerRule rule = new StubRunnerRule()
.repoRoot(StubRunnerRuleSpec.getResource("/m2repo/repository").toURI().toString())
.downloadStub("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")
.downloadStub("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")
@@ -4639,7 +4639,7 @@ def 'should start WireMock servers'() {
-
@Test
+@Test
public void should_start_wiremock_servers() throws Exception {
// expect: 'WireMocks are running'
then(rule.findStubUrl("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")).isNotNull();
@@ -4694,7 +4694,7 @@ JUnit rule.
-
@ClassRule public static StubRunnerRule rule = new StubRunnerRule()
+@ClassRule public static StubRunnerRule rule = new StubRunnerRule()
.repoRoot(repoRoot())
.downloadStub("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")
.withPort(12345)
@@ -4706,7 +4706,7 @@ JUnit rule.
-
then(rule.findStubUrl("loanIssuance")).isEqualTo(URI.create("http://localhost:12345").toURL());
+then(rule.findStubUrl("loanIssuance")).isEqualTo(URI.create("http://localhost:12345").toURL());
then(rule.findStubUrl("fraudDetectionServer")).isEqualTo(URI.create("http://localhost:12346").toURL());
@@ -4726,7 +4726,7 @@ its methods as presented below:
-
@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
+@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
@SpringBootTest(properties = [" stubrunner.cloud.enabled=false",
"stubrunner.camel.enabled=false",
'foo=${stubrunner.runningstubs.fraudDetectionServer.port}'])
@@ -4803,7 +4803,7 @@ class StubRunnerConfigurationSpec extends Specification {
-
stubrunner:
+stubrunner:
repositoryRoot: classpath:m2repo/repository/
ids:
- org.springframework.cloud.contract.verifier.stubs:loanIssuance
@@ -4825,7 +4825,7 @@ Below you can find an example of achieving the same result by setting values on
-
@AutoConfigureStubRunner(
+@AutoConfigureStubRunner(
ids = ["org.springframework.cloud.contract.verifier.stubs:loanIssuance",
"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer",
"org.springframework.cloud.contract.verifier.stubs:bootService"],
@@ -4895,7 +4895,7 @@ or DiscoveryClient directly, to call those stubbed servers instead
-
def 'should make service discovery work'() {
+def 'should make service discovery work'() {
expect: 'WireMocks are running'
"${stubFinder.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
"${stubFinder.findStubUrl('fraudDetectionServer').toString()}/name".toURL().text == 'fraudDetectionServer'
@@ -4910,7 +4910,7 @@ or DiscoveryClient directly, to call those stubbed servers instead
-
spring.cloud:
+spring.cloud:
zookeeper.enabled: false
consul.enabled: false
eureka.client.enabled: false
@@ -4934,7 +4934,7 @@ via a static block like presented below (example for Eureka)
-
//Hack to work around https://github.com/spring-cloud/spring-cloud-commons/issues/156
+ //Hack to work around https://github.com/spring-cloud/spring-cloud-commons/issues/156
static {
System.setProperty("eureka.client.enabled", "false");
System.setProperty("spring.cloud.config.failFast", "false");
@@ -4984,7 +4984,7 @@ trigger the messaging labels and to access started WireMock servers.
-
compile "org.springframework.cloud:spring-cloud-starter-stub-runner"
+
compile "org.springframework.cloud:spring-cloud-starter-stub-runner"
@@ -5033,7 +5033,7 @@ trigger the messaging labels and to access started WireMock servers.
Example
-
@ContextConfiguration(classes = StubRunnerBoot, loader = SpringBootContextLoader)
+@ContextConfiguration(classes = StubRunnerBoot, loader = SpringBootContextLoader)
@SpringBootTest(properties = "spring.cloud.zookeeper.enabled=false")
@ActiveProfiles("test")
class StubRunnerBootSpec extends Specification {
@@ -5142,7 +5142,7 @@ class StubRunnerBootSpec extends Specification {
-
@SpringBootApplication
+@SpringBootApplication
@EnableStubRunnerServer
@EnableEurekaClient
@AutoConfigureStubRunner
@@ -5166,7 +5166,7 @@ and we want to have the stub runner feature turned on @AutoConfigureStubRu
-
-Dstubrunner.repositoryRoot=http://repo.spring.io/snapshots (1)
+-Dstubrunner.repositoryRoot=http://repo.spring.io/snapshots (1)
-Dstubrunner.cloud.stubbed.discovery.enabled=false (2)
-Dstubrunner.ids=org.springframework.cloud.contract.verifier.stubs:loanIssuance,org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer,org.springframework.cloud.contract.verifier.stubs:bootService (3)
-Dstubrunner.idsToServiceIds.fraudDetectionServer=someNameThatShouldMapFraudDetectionServer (4)
@@ -5213,7 +5213,7 @@ There are 2 consumers: foo-consumer and bar-consumer.<
-
request {
+request {
url '/foo'
method GET()
}
@@ -5230,7 +5230,7 @@ response {
-
request {
+request {
url '/foo'
method GET()
}
@@ -5257,7 +5257,7 @@ if it contains the subfolder with name of the consumer in the path only then wil
-
.
+.
└── contracts
├── bar-consumer
│ ├── bookReturnedForBar.groovy
@@ -5273,7 +5273,7 @@ Or set the test as follows:
-
@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
+@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
@SpringBootTest(properties = ["spring.application.name=bar-consumer"])
@AutoConfigureStubRunner(ids = "org.springframework.cloud.contract.verifier.stubs:producerWithMultipleConsumers",
repositoryRoot = "classpath:m2repo/repository/",
@@ -5293,7 +5293,7 @@ class StubRunnerStubsPerConsumerSpec extends Specification {
-
@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
+@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
@SpringBootTest
@AutoConfigureStubRunner(ids = "org.springframework.cloud.contract.verifier.stubs:producerWithMultipleConsumers",
repositoryRoot = "classpath:m2repo/repository/",
@@ -5394,7 +5394,7 @@ information about the reasons behind this change.
-
groupId:artifactId:version:classifier:port
+
groupId:artifactId:version:classifier:port
@@ -5487,7 +5487,7 @@ segments are padded with trailing 0 or "ga" segments, respectively, until the ki
-
package org.springframework.cloud.contract.stubrunner;
+package org.springframework.cloud.contract.stubrunner;
import java.util.Collection;
import java.util.Map;
@@ -5540,14 +5540,14 @@ public interface StubTrigger {
Trigger by label
-
stubFinder.trigger('return_book_1')
+
stubFinder.trigger('return_book_1')
Trigger by group and artifact ids
-
stubFinder.trigger('org.springframework.cloud.contract.verifier.stubs:camelService', 'return_book_1')
+
stubFinder.trigger('org.springframework.cloud.contract.verifier.stubs:camelService', 'return_book_1')
@@ -5555,7 +5555,7 @@ public interface StubTrigger {
Trigger by artifact ids
-
stubFinder.trigger('camelService', 'return_book_1')
+
stubFinder.trigger('camelService', 'return_book_1')
@@ -5564,7 +5564,7 @@ public interface StubTrigger {
Trigger all messages
-
stubFinder.trigger()
+
stubFinder.trigger()
@@ -5594,7 +5594,7 @@ Remember to annotate your test class with
@AutoConfigureStubRunner.
-
└── .m2
+└── .m2
└── repository
└── io
└── codearte
@@ -5613,7 +5613,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
├── META-INF
+├── META-INF
│ └── MANIFEST.MF
└── repository
├── accurest
@@ -5628,7 +5628,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
Contract.make {
+Contract.make {
label 'return_book_1'
input {
triggeredBy('bookReturnedTriggered()')
@@ -5648,7 +5648,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
Contract.make {
+Contract.make {
label 'return_book_2'
input {
messageFrom('jms:input')
@@ -5679,7 +5679,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
stubFinder.trigger('return_book_1')
+
stubFinder.trigger('return_book_1')
@@ -5687,7 +5687,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
Exchange receivedMessage = camelContext.createConsumerTemplate().receive('jms:output', 5000)
+
Exchange receivedMessage = camelContext.createConsumerTemplate().receive('jms:output', 5000)
@@ -5695,7 +5695,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
receivedMessage != null
+receivedMessage != null
assertThatBodyContainsBookNameFoo(receivedMessage.in.body)
receivedMessage.in.headers.get('BOOK-NAME') == 'foo'
@@ -5708,7 +5708,7 @@ receivedMessage.in.headers.get('BOOK-NAME') == 'foo'
-
camelContext.createProducerTemplate().sendBodyAndHeaders('jms:input', new BookReturned('foo'), [sample: 'header'])
+
camelContext.createProducerTemplate().sendBodyAndHeaders('jms:input', new BookReturned('foo'), [sample: 'header'])
@@ -5716,7 +5716,7 @@ receivedMessage.in.headers.get('BOOK-NAME') == 'foo'
-
Exchange receivedMessage = camelContext.createConsumerTemplate().receive('jms:output', 5000)
+
Exchange receivedMessage = camelContext.createConsumerTemplate().receive('jms:output', 5000)
@@ -5724,7 +5724,7 @@ receivedMessage.in.headers.get('BOOK-NAME') == 'foo'
-
receivedMessage != null
+receivedMessage != null
assertThatBodyContainsBookNameFoo(receivedMessage.in.body)
receivedMessage.in.headers.get('BOOK-NAME') == 'foo'
@@ -5737,7 +5737,7 @@ receivedMessage.in.headers.get('BOOK-NAME') == 'foo'
-
camelContext.createProducerTemplate().sendBodyAndHeaders('jms:delete', new BookReturned('foo'), [sample: 'header'])
+
camelContext.createProducerTemplate().sendBodyAndHeaders('jms:delete', new BookReturned('foo'), [sample: 'header'])
@@ -5767,7 +5767,7 @@ Remember to annotate your test class with
@AutoConfigureStubRunner.
-
└── .m2
+└── .m2
└── repository
└── io
└── codearte
@@ -5786,7 +5786,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
├── META-INF
+├── META-INF
│ └── MANIFEST.MF
└── repository
├── accurest
@@ -5801,7 +5801,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
Contract.make {
+Contract.make {
label 'return_book_1'
input {
triggeredBy('bookReturnedTriggered()')
@@ -5821,7 +5821,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
Contract.make {
+Contract.make {
label 'return_book_2'
input {
messageFrom('input')
@@ -5849,7 +5849,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
@@ -5878,7 +5878,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
stubFinder.trigger('return_book_1')
+
stubFinder.trigger('return_book_1')
@@ -5886,7 +5886,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
Message<?> receivedMessage = messaging.receive('outputTest')
+
Message<?> receivedMessage = messaging.receive('outputTest')
@@ -5894,7 +5894,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
receivedMessage != null
+receivedMessage != null
assertJsons(receivedMessage.payload)
receivedMessage.headers.get('BOOK-NAME') == 'foo'
@@ -5907,7 +5907,7 @@ receivedMessage.headers.get('BOOK-NAME') == 'foo'
-
messaging.send(new BookReturned('foo'), [sample: 'header'], 'input')
+
messaging.send(new BookReturned('foo'), [sample: 'header'], 'input')
@@ -5915,7 +5915,7 @@ receivedMessage.headers.get('BOOK-NAME') == 'foo'
-
Message<?> receivedMessage = messaging.receive('outputTest')
+
Message<?> receivedMessage = messaging.receive('outputTest')
@@ -5923,7 +5923,7 @@ receivedMessage.headers.get('BOOK-NAME') == 'foo'
-
receivedMessage != null
+receivedMessage != null
assertJsons(receivedMessage.payload)
receivedMessage.headers.get('BOOK-NAME') == 'foo'
@@ -5936,7 +5936,7 @@ receivedMessage.headers.get('BOOK-NAME') == 'foo'
-
messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')
+
messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')
@@ -5980,7 +5980,7 @@ Remember to annotate your test class with
@AutoConfigureStubRunner.
-
└── .m2
+└── .m2
└── repository
└── io
└── codearte
@@ -5999,7 +5999,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
├── META-INF
+├── META-INF
│ └── MANIFEST.MF
└── repository
├── accurest
@@ -6014,7 +6014,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
Contract.make {
+Contract.make {
label 'return_book_1'
input { triggeredBy('bookReturnedTriggered()') }
outputMessage {
@@ -6030,7 +6030,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
Contract.make {
+Contract.make {
label 'return_book_2'
input {
messageFrom('bookStorage')
@@ -6054,7 +6054,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
stubrunner.repositoryRoot: classpath:m2repo/repository/
+stubrunner.repositoryRoot: classpath:m2repo/repository/
stubrunner.ids: org.springframework.cloud.contract.verifier.stubs:streamService:0.0.1-SNAPSHOT:stubs
spring:
@@ -6080,7 +6080,7 @@ debug: true
-
stubFinder.trigger('return_book_1')
+
stubFinder.trigger('return_book_1')
@@ -6088,7 +6088,7 @@ debug: true
-
Message<?> receivedMessage = messaging.receive('returnBook')
+
Message<?> receivedMessage = messaging.receive('returnBook')
@@ -6096,7 +6096,7 @@ debug: true
-
receivedMessage != null
+receivedMessage != null
assertJsons(receivedMessage.payload)
receivedMessage.headers.get('BOOK-NAME') == 'foo'
@@ -6109,7 +6109,7 @@ receivedMessage.headers.get('BOOK-NAME') == 'foo'
-
messaging.send(new BookReturned('foo'), [sample: 'header'], 'bookStorage')
+
messaging.send(new BookReturned('foo'), [sample: 'header'], 'bookStorage')
@@ -6117,7 +6117,7 @@ receivedMessage.headers.get('BOOK-NAME') == 'foo'
-
Message<?> receivedMessage = messaging.receive('returnBook')
+
Message<?> receivedMessage = messaging.receive('returnBook')
@@ -6125,7 +6125,7 @@ receivedMessage.headers.get('BOOK-NAME') == 'foo'
-
receivedMessage != null
+receivedMessage != null
assertJsons(receivedMessage.payload)
receivedMessage.headers.get('BOOK-NAME') == 'foo'
@@ -6138,7 +6138,7 @@ receivedMessage.headers.get('BOOK-NAME') == 'foo'
-
messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')
+
messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')
@@ -6183,7 +6183,7 @@ Remember to annotate your test class with
@AutoConfigureStubRunner.
-
└── .m2
+└── .m2
└── repository
└── com
└── example
@@ -6200,7 +6200,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
├── META-INF
+├── META-INF
│ └── MANIFEST.MF
└── contracts
└── shouldProduceValidPersonData.groovy
@@ -6211,7 +6211,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
Contract.make {
+Contract.make {
// Human readable description
description 'Should produce valid person data'
// Label by means of which the output message can be triggered
@@ -6243,7 +6243,7 @@ Remember to annotate your test class with @AutoConfigureStubRunner.
-
stubrunner:
+stubrunner:
repositoryRoot: classpath:m2repo/repository/
ids: org.springframework.cloud.contract.verifier.stubs.amqp:spring-cloud-contract-amqp-test:0.4.0-SNAPSHOT:stubs
amqp:
@@ -6260,7 +6260,7 @@ server:
-
stubTrigger.trigger("contract-test.person.created.event")
+
stubTrigger.trigger("contract-test.person.created.event")
@@ -6268,7 +6268,7 @@ server:
-
@Bean
+@Bean
public Binding binding() {
return BindingBuilder.bind(new Queue("test.queue")).to(new DirectExchange("contract-test.exchange")).with("#");
}
@@ -6280,7 +6280,7 @@ So the following listener definition is a match and is invoked with the contract
-
@Bean
+@Bean
public SimpleMessageListenerContainer simpleMessageListenerContainer(ConnectionFactory connectionFactory,
MessageListenerAdapter listenerAdapter) {
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
@@ -6297,7 +6297,7 @@ public SimpleMessageListenerContainer simpleMessageListenerContainer(ConnectionF
-
@RabbitListener(bindings = @QueueBinding(
+@RabbitListener(bindings = @QueueBinding(
value = @Queue(value = "test.queue"),
exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true")))
public void handlePerson(Person person) {
@@ -6328,7 +6328,7 @@ The message is directly handed over to the onMessage method of the
-
stubrunner:
+stubrunner:
amqp:
mockConnection: false
@@ -6378,7 +6378,7 @@ Spring Cloud Contract supports defining multiple contracts in a single file!
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
method 'PUT'
url '/api/12'
@@ -6484,7 +6484,7 @@ Groovy Map notation.
-
org.springframework.cloud.contract.spec.Contract.make {
+ org.springframework.cloud.contract.spec.Contract.make {
description('''
given:
An input
@@ -6527,7 +6527,7 @@ or just set the ignored property on the contract itself:
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
ignored()
}
@@ -6541,7 +6541,7 @@ or just set the
ignored property on the contract itself:
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
// Definition of HTTP request part of the contract
// (this can be a valid request or invalid depending
// on type of contract being specified).
@@ -6571,7 +6571,7 @@ or just set the ignored property on the contract itself:
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
// HTTP request method (GET/POST/PUT/DELETE).
method 'GET'
@@ -6591,7 +6591,7 @@ or just set the ignored property on the contract itself:
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
method 'GET'
@@ -6610,7 +6610,7 @@ or just set the ignored property on the contract itself:
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
//...
@@ -6658,7 +6658,7 @@ or just set the ignored property on the contract itself:
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
//...
@@ -6683,7 +6683,7 @@ or just set the ignored property on the contract itself:
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
//...
@@ -6706,7 +6706,7 @@ or just set the ignored property on the contract itself:
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
//...
}
@@ -6737,7 +6737,7 @@ body and one to set them in a separate section called testMatchers
-
value(consumer(...), producer(...))
+value(consumer(...), producer(...))
value(c(...), p(...))
value(stub(...), test(...))
value(client(...), server(...))
@@ -6748,7 +6748,7 @@ value(client(...), server(...))
-
$(consumer(...), producer(...))
+$(consumer(...), producer(...))
$(c(...), p(...))
$(stub(...), test(...))
$(client(...), server(...))
@@ -6770,7 +6770,7 @@ for your test and your server side tests.
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
method('GET')
url $(consumer(~/\/[0-9]{2}/), producer('/12'))
@@ -6802,7 +6802,7 @@ provide the generated string that matches the provided regular expression. For e
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
method 'PUT'
url value(consumer(regex('/foo/[0-9]{5}')))
@@ -6833,7 +6833,7 @@ provide the generated string that matches the provided regular expression. For e
-
protected static final Pattern TRUE_OR_FALSE = Pattern.compile(/(true|false)/)
+protected static final Pattern TRUE_OR_FALSE = Pattern.compile(/(true|false)/)
protected static final Pattern ONLY_ALPHA_UNICODE = Pattern.compile(/[\p{L}]*/)
protected static final Pattern NUMBER = Pattern.compile('-?\\d*(\\.\\d+)?')
protected static final Pattern IP_ADDRESS = Pattern.compile('([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])')
@@ -6914,7 +6914,7 @@ String nonBlank() {
-
Contract dslWithOptionalsInString = Contract.make {
+Contract dslWithOptionalsInString = Contract.make {
priority 1
request {
method POST()
@@ -6961,7 +6961,7 @@ String nonBlank() {
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
priority 1
request {
method 'POST'
@@ -6994,7 +6994,7 @@ String nonBlank() {
-
"""
+"""
given:
def request = given()
.header("Content-Type", "application/json")
@@ -7018,7 +7018,7 @@ String nonBlank() {
-
'''
+'''
{
"request" : {
"url" : "/users/password",
@@ -7058,7 +7058,7 @@ in the configuration. Example:
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
method 'PUT'
url $(consumer(regex('^/api/[0-9]{2}$')), producer('/api/12'))
@@ -7086,7 +7086,7 @@ in the configuration. Example:
-
abstract class BaseMockMvcSpec extends Specification {
+abstract class BaseMockMvcSpec extends Specification {
def setup() {
RestAssuredMockMvc.standaloneSetup(new PairIdController())
@@ -7157,7 +7157,7 @@ of elements from the HTTP request. You can use the following options:
-
Contract contractDsl = Contract.make {
+Contract contractDsl = Contract.make {
request {
method 'GET'
url('/api/v1/xxxx') {
@@ -7197,7 +7197,7 @@ of elements from the HTTP request. You can use the following options:
-
// given:
+// given:
MockMvcRequestSpecification request = given()
.header("Authorization", "secret")
.header("Authorization", "secret2")
@@ -7233,7 +7233,7 @@ of elements from the HTTP request. You can use the following options:
-
{
+{
"request" : {
"urlPath" : "/api/v1/xxxx",
"method" : "POST",
@@ -7270,7 +7270,7 @@ response body
-
{
+{
"url" : "/api/v1/xxxx?foo=bar&foo=bar2",
"param" : "bar",
"paramIndex" : "bar2",
@@ -7384,7 +7384,7 @@ will result in calling a foo method to which the value matching the
-
Contract contractDsl = Contract.make {
+Contract contractDsl = Contract.make {
request {
method 'GET'
urlPath '/get'
@@ -7528,7 +7528,7 @@ assertions and the one from matchers with an and section):
-
// given:
+// given:
MockMvcRequestSpecification request = given()
.header("Content-Type", "application/json")
.body("{\"duck\":123,\"alpha\":\"abc\",\"number\":123,\"aBoolean\":true,\"date\":\"2017-01-01\",\"dateTime\":\"2017-01-01T01:23:45\",\"time\":\"01:02:34\",\"valueWithoutAMatcher\":\"foo\",\"valueWithTypeMatch\":\"string\"}");
@@ -7572,7 +7572,7 @@ assertions and the one from matchers with an and section):
-
'''
+ '''
{
"request" : {
"urlPath" : "/get",
@@ -7640,7 +7640,7 @@ assertions and the one from matchers with an and section):
-
testMode === 'JAXRSCLIENT'
+
testMode === 'JAXRSCLIENT'
@@ -7648,7 +7648,7 @@ assertions and the one from matchers with an and section):
-
'''
+'''
// when:
Response response = webTarget
.path("/users")
@@ -7683,7 +7683,7 @@ section a async() method. Example:
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
method GET()
url '/get'
@@ -7721,7 +7721,7 @@ on the PRODUCER side. The autogenerated tests need to be using
Maven
-
<plugin>
+<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>${spring-cloud-contract.version}</version>
@@ -7735,7 +7735,7 @@ on the PRODUCER side. The autogenerated tests need to be using
Gradle
-
contracts {
+contracts {
testMode = 'EXPLICIT'
}
@@ -7749,7 +7749,7 @@ real requests and you need to setup your generated test’s base class to wo
-
org.springframework.cloud.contract.spec.Contract.make {
+org.springframework.cloud.contract.spec.Contract.make {
request {
method 'GET'
url '/my-context-path/url'
@@ -7765,7 +7765,7 @@ real requests and you need to setup your generated test’s base class to wo
-
import com.jayway.restassured.RestAssured;
+import com.jayway.restassured.RestAssured;
import org.junit.Before;
import org.springframework.boot.context.embedded.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
@@ -7810,7 +7810,7 @@ have that information (e.g. in the stubs you’ll see that you have too call
-
def dsl = Contract.make {
+def dsl = Contract.make {
// Human readable description
description 'Some description'
// Label by means of which the output message can be triggered
@@ -7846,7 +7846,7 @@ we will generate a test that will call that method to trigger the message. On th
-
def dsl = Contract.make {
+def dsl = Contract.make {
description 'Some Description'
label 'some_label'
// input is a message
@@ -7888,7 +7888,7 @@ as presented below (note you can use either $ or value
-
Contract.make {
+Contract.make {
label 'some_label'
input {
messageFrom value(consumer('jms:output'), producer('jms:input'))
@@ -7917,7 +7917,7 @@ as presented below (note you can use either $ or value
-
import org.springframework.cloud.contract.spec.Contract
+import org.springframework.cloud.contract.spec.Contract
[
Contract.make {
@@ -7948,7 +7948,7 @@ two tests that will look more or less like this:
-
package org.springframework.cloud.contract.verifier.tests.com.hello;
+package org.springframework.cloud.contract.verifier.tests.com.hello;
import com.example.TestBase;
import com.jayway.jsonpath.DocumentContext;
@@ -8003,7 +8003,7 @@ index of the contract in the list.
-
should post a user.json
+should post a user.json
1_WithList.json
@@ -8059,7 +8059,7 @@ of:
-
package com.example;
+package com.example;
import java.util.regex.Pattern;
@@ -8114,7 +8114,7 @@ public class PatternUtils {
-
package com.example;
+package com.example;
import org.springframework.cloud.contract.spec.internal.ClientDslProperty;
@@ -8166,7 +8166,7 @@ public class ConsumerUtils {
-
package com.example;
+package com.example;
import org.springframework.cloud.contract.spec.internal.ServerDslProperty;
@@ -8226,7 +8226,7 @@ common jar classes will be visible in your Groovy files.
Maven
-
<dependency>
+<dependency>
<groupId>com.example</groupId>
<artifactId>beer-common</artifactId>
<version>${project.version}</version>
@@ -8237,7 +8237,7 @@ common jar classes will be visible in your Groovy files.
Gradle
-
testCompile("com.example:beer-common:0.0.1-SNAPSHOT")
+
testCompile("com.example:beer-common:0.0.1-SNAPSHOT")
@@ -8249,7 +8249,7 @@ common jar classes will be visible in your Groovy files.
Maven
-
<plugin>
+<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>${spring-cloud-contract.version}</version>
@@ -8277,7 +8277,7 @@ common jar classes will be visible in your Groovy files.
Gradle
-
classpath "com.example:beer-common:0.0.1-SNAPSHOT"
+
classpath "com.example:beer-common:0.0.1-SNAPSHOT"
@@ -8288,7 +8288,7 @@ common jar classes will be visible in your Groovy files.
-
package contracts.beer.rest
+package contracts.beer.rest
import com.example.ConsumerUtils
import com.example.ProducerUtils
@@ -8353,7 +8353,7 @@ stubs for other stub http server implementations).
-
request:
+request:
url: /foo
method: PUT
headers:
@@ -8373,7 +8373,7 @@ response:
-
package org.springframework.cloud.contract.spec
+package org.springframework.cloud.contract.spec
/**
* Converter to be used to convert FROM {@link File} TO {@link Contract}
@@ -8436,7 +8436,7 @@ file in which you provide the fully qualified name of your implementation.
-
# Converters
+# Converters
org.springframework.cloud.contract.spec.ContractConverter=\
org.springframework.cloud.contract.verifier.converter.YamlContractConverter
@@ -8446,7 +8446,7 @@ org.springframework.cloud.contract.verifier.converter.YamlContractConverter
-
package org.springframework.cloud.contract.verifier.converter
+package org.springframework.cloud.contract.verifier.converter
import groovy.transform.CompileStatic
import org.springframework.cloud.contract.spec.Contract
@@ -8533,7 +8533,7 @@ the src/test/resources/contracts folder.
-
{
+{
"provider": {
"name": "Provider"
},
@@ -8600,7 +8600,7 @@ Pact version that you’re using.
Maven
-
<plugin>
+<plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>${spring-cloud-contract.version}</version>
@@ -8626,7 +8626,7 @@ Pact version that you’re using.
Gradle
-
classpath "org.springframework.cloud:spring-cloud-contract-spec-pact:${findProperty('verifierVersion') ?: verifierVersion}"
+classpath "org.springframework.cloud:spring-cloud-contract-spec-pact:${findProperty('verifierVersion') ?: verifierVersion}"
classpath 'au.com.dius:pact-jvm-model:2.4.18'
@@ -8635,7 +8635,7 @@ classpath 'au.com.dius:pact-jvm-model:2.4.18'
-
@Test
+@Test
public void validate_shouldMarkClientAsFraud() throws Exception {
// given:
MockMvcRequestSpecification request = given()
@@ -8662,7 +8662,7 @@ public void validate_shouldMarkClientAsFraud() throws Exception {
-
{
+{
"uuid" : "996ae5ae-6834-4db6-8fac-358ca187ab62",
"request" : {
"url" : "/fraudcheck",
@@ -8699,7 +8699,7 @@ Pact version that you’re using.
Maven
-
<dependency>
+<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-spec-pact</artifactId>
<scope>test</scope>
@@ -8715,7 +8715,7 @@ Pact version that you’re using.
Gradle
-
testCompile "org.springframework.cloud:spring-cloud-contract-spec-pact"
+testCompile "org.springframework.cloud:spring-cloud-contract-spec-pact"
testCompile 'au.com.dius:pact-jvm-model:2.4.18'
@@ -8734,7 +8734,7 @@ your own implementation to do that.
-
package org.springframework.cloud.contract.verifier.builder
+package org.springframework.cloud.contract.verifier.builder
import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties
import org.springframework.cloud.contract.verifier.file.ContractMetadata
@@ -8774,7 +8774,7 @@ a proper spring.factories file. Example:
-
org.springframework.cloud.contract.verifier.builder.SingleTestGenerator=/
+org.springframework.cloud.contract.verifier.builder.SingleTestGenerator=/
com.example.MyGenerator
@@ -8787,7 +8787,7 @@ com.example.MyGenerator
-
package org.springframework.cloud.contract.verifier.converter
+package org.springframework.cloud.contract.verifier.converter
import groovy.transform.CompileStatic
import org.springframework.cloud.contract.spec.Contract
@@ -8832,7 +8832,7 @@ a proper spring.factories file. Example:
-
# Stub converters
+# Stub converters
org.springframework.cloud.contract.verifier.converter.StubGenerator=\
org.springframework.cloud.contract.verifier.wiremock.DslToWireMockClientConverter
@@ -8870,7 +8870,7 @@ You wrote a proper stub generator and your stubs got placed in a JAR file.
-
package org.springframework.cloud.contract.stubrunner.provider.moco
+package org.springframework.cloud.contract.stubrunner.provider.moco
import com.github.dreamhead.moco.bootstrap.arg.HttpArgs
import com.github.dreamhead.moco.runner.JsonRunner
@@ -8938,7 +8938,7 @@ class MocoHttpServerStub implements HttpServerStub {
-
org.springframework.cloud.contract.stubrunner.HttpServerStub=\
+org.springframework.cloud.contract.stubrunner.HttpServerStub=\
org.springframework.cloud.contract.stubrunner.provider.moco.MocoHttpServerStub
@@ -8967,7 +8967,7 @@ implementation of the
StubDownloaderBuilder
-
package com.example;
+package com.example;
class CustomStubDownloaderBuilder implements StubDownloaderBuilder {
@@ -8994,7 +8994,7 @@ class CustomStubDownloaderBuilder implements StubDownloaderBuilder {
-
# Example of a custom Stub Downloader Provider
+# Example of a custom Stub Downloader Provider
org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder=\
com.example.CustomStubDownloaderBuilder
@@ -9095,7 +9095,7 @@ part of your test. Here’s a simple example:
-
@RunWith(SpringRunner.class)
+@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@AutoConfigureWireMock(port = 0)
public class WiremockForDocsTests {
@@ -9202,7 +9202,7 @@ class to obtain an Options instance:
-
@RunWith(SpringRunner.class)
+@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class WiremockForDocsClassRuleTests {
@@ -9250,7 +9250,7 @@ e.g.
-
@Bean
+@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
}
@@ -9264,7 +9264,7 @@ to add the @AutoConfigureHttpClient annotation as well:
-
@RunWith(SpringRunner.class)
+@RunWith(SpringRunner.class)
@SpringBootTest("app.baseUrl=https://localhost:6443")
@AutoConfigureHttpClient
public class WiremockHttpsServerApplicationTests {
@@ -9293,7 +9293,7 @@ Spring MockRestServiceServer. Here’s an example:
-
@RunWith(SpringRunner.class)
+@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.NONE)
public class WiremockForDocsMockServerApplicationTests {
@@ -9351,7 +9351,7 @@ automatically in the restdocs output directory. For example:
-
@RunWith(SpringRunner.class)
+@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureRestDocs(outputDir = "target/snippets")
@AutoConfigureMockMvc
@@ -9390,7 +9390,7 @@ example:
-
@RunWith(SpringRunner.class)
+@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureRestDocs(outputDir = "target/snippets")
@AutoConfigureMockMvc
@@ -9424,7 +9424,7 @@ created stub. Example:
-
@Test
+@Test
public void contextLoads() throws Exception {
mockMvc.perform(post("/resource")
.content("{\"id\":\"123456\",\"message\":\"Hello World\"}"))
@@ -9446,7 +9446,7 @@ will generate a stub something like this: