From 6ac3aea3cdbfa259e479d5c5617b631fd10cf164 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Fri, 14 Jun 2019 17:10:50 +0200 Subject: [PATCH] Added links --- .../_generating_contracts_using_restdocs.html | 64 +- multi/_generating_stubs_using_restdocs.html | 98 +- multi/_migrations.html | 88 +- ...axed_ssl_validation_for_rest_template.html | 37 +- multi/_spring_cloud_contract.html | 19 +- multi/_spring_cloud_contract_verifier.html | 4160 +--------- multi/_spring_cloud_contract_wiremock.html | 97 +- multi/_wiremock_and_spring_mvc_mocks.html | 44 +- multi/css/highlight.css | 35 - multi/css/manual-multipage.css | 9 - multi/css/manual-singlepage.css | 6 - multi/css/manual.css | 342 - multi/images/background.png | Bin 18255 -> 0 bytes multi/images/callouts/1.png | Bin 329 -> 0 bytes multi/images/callouts/2.png | Bin 353 -> 0 bytes multi/images/callouts/3.png | Bin 350 -> 0 bytes multi/images/caution.png | Bin 2099 -> 0 bytes multi/images/important.png | Bin 2085 -> 0 bytes multi/images/logo.png | Bin 4387 -> 0 bytes multi/images/note.png | Bin 2257 -> 0 bytes multi/images/sts_exception.png | Bin 66176 -> 0 bytes multi/images/tip.png | Bin 931 -> 0 bytes multi/images/warning.png | Bin 2130 -> 0 bytes multi/images/web-selected.png | Bin 182685 -> 0 bytes multi/multi__contract_dsl.html | 1954 +---- multi/multi__customization.html | 222 +- ...__generating_contracts_using_restdocs.html | 64 +- ...ulti__generating_stubs_using_restdocs.html | 98 +- multi/multi__links.html | 19 +- multi/multi__migrations.html | 101 +- multi/multi__pluggable_architecture.html | 465 +- ...axed_ssl_validation_for_rest_template.html | 37 +- multi/multi__spring_cloud_contract.html | 20 +- multi/multi__spring_cloud_contract_faq.html | 707 +- ...ti__spring_cloud_contract_stub_runner.html | 873 +- ...multi__spring_cloud_contract_verifier.html | 4160 +--------- ..._cloud_contract_verifier_introduction.html | 848 +- ...ing_cloud_contract_verifier_messaging.html | 265 +- ..._spring_cloud_contract_verifier_setup.html | 699 +- ...multi__spring_cloud_contract_wiremock.html | 328 +- multi/multi__stub_runner_for_messaging.html | 299 +- ...lti__using_the_pluggable_architecture.html | 476 +- .../multi__wiremock_and_spring_mvc_mocks.html | 44 +- multi/multi_contract-dsl.html | 2213 +----- multi/multi_pr01.html | 17 +- multi/multi_spring-cloud-contract.html | 16 +- multi/multi_stub-runner-for-messaging.html | 365 +- multi/pr01.html | 17 +- multi/spring-cloud-contract.html | 16 +- single/css/highlight.css | 35 - single/css/manual-multipage.css | 9 - single/css/manual-singlepage.css | 6 - single/css/manual.css | 342 - single/images/background.png | Bin 18255 -> 0 bytes single/images/callouts/1.png | Bin 329 -> 0 bytes single/images/callouts/2.png | Bin 353 -> 0 bytes single/images/callouts/3.png | Bin 350 -> 0 bytes single/images/caution.png | Bin 2099 -> 0 bytes single/images/important.png | Bin 2085 -> 0 bytes single/images/logo.png | Bin 4387 -> 0 bytes single/images/note.png | Bin 2257 -> 0 bytes single/images/sts_exception.png | Bin 66176 -> 0 bytes single/images/tip.png | Bin 931 -> 0 bytes single/images/warning.png | Bin 2130 -> 0 bytes single/images/web-selected.png | Bin 182685 -> 0 bytes single/spring-cloud-contract.html | 7025 +---------------- 66 files changed, 348 insertions(+), 26391 deletions(-) delete mode 100644 multi/css/highlight.css delete mode 100644 multi/css/manual-multipage.css delete mode 100644 multi/css/manual-singlepage.css delete mode 100644 multi/css/manual.css delete mode 100644 multi/images/background.png delete mode 100644 multi/images/callouts/1.png delete mode 100644 multi/images/callouts/2.png delete mode 100644 multi/images/callouts/3.png delete mode 100644 multi/images/caution.png delete mode 100644 multi/images/important.png delete mode 100644 multi/images/logo.png delete mode 100644 multi/images/note.png delete mode 100644 multi/images/sts_exception.png delete mode 100644 multi/images/tip.png delete mode 100644 multi/images/warning.png delete mode 100644 multi/images/web-selected.png delete mode 100644 single/css/highlight.css delete mode 100644 single/css/manual-multipage.css delete mode 100644 single/css/manual-singlepage.css delete mode 100644 single/css/manual.css delete mode 100644 single/images/background.png delete mode 100644 single/images/callouts/1.png delete mode 100644 single/images/callouts/2.png delete mode 100644 single/images/callouts/3.png delete mode 100644 single/images/caution.png delete mode 100644 single/images/important.png delete mode 100644 single/images/logo.png delete mode 100644 single/images/note.png delete mode 100644 single/images/sts_exception.png delete mode 100644 single/images/tip.png delete mode 100644 single/images/warning.png delete mode 100644 single/images/web-selected.png diff --git a/multi/_generating_contracts_using_restdocs.html b/multi/_generating_contracts_using_restdocs.html index 7f1b47d3c0..a5ffb82f50 100644 --- a/multi/_generating_contracts_using_restdocs.html +++ b/multi/_generating_contracts_using_restdocs.html @@ -1,53 +1,13 @@ - - - 7. Generating Contracts using RestDocs

7. Generating Contracts using RestDocs

Another thing that can be generated with Spring RestDocs is the Spring Cloud -Contract DSL file and documentation. If you combine that with Spring Cloud -WireMock then you’re getting both the contracts and stubs.

Why would you want to use this feature? Some people in the community asked questions -about situation in which they would like to move to DSL based contract definition -but they already have a lot of Spring MVC tests. Using this feature allows you to generate -the contract files that you can later modify and move to proper folders so that the -plugin picks them up.

[Tip]Tip

You might wonder why this functionality is in the WireMock module. -Come to think of it, it does make sense since it makes little sense to generate -only contracts and not generate the stubs. That’s why we suggest to do both.

Let’s imagine the following test:

		this.mockMvc.perform(post("/foo")
-					.accept(MediaType.APPLICATION_PDF)
-					.accept(MediaType.APPLICATION_JSON)
-					.contentType(MediaType.APPLICATION_JSON)
-					.content("{\"foo\": 23 }"))
-				.andExpect(status().isOk())
-				.andExpect(content().string("bar"))
-				// first WireMock
-				.andDo(WireMockRestDocs.verify()
-						.jsonPath("$[?(@.foo >= 20)]")
-						.contentType(MediaType.valueOf("application/json"))
-						.stub("shouldGrantABeerIfOldEnough"))
-				// then Contract DSL documentation
-				.andDo(document("index", SpringCloudContractRestDocs.dslContract()));

This will lead in the creation of the stub as presented in the previous -section, contract will get generated and a documentation file too.

The contract will be called index.groovy and look more like this.

import org.springframework.cloud.contract.spec.Contract
+
 
-Contract.make {
-    request {
-        method 'POST'
-        url '/foo'
-        body('''
-            {"foo": 23 }
-        ''')
-        headers {
-            header('''Accept''', '''application/json''')
-            header('''Content-Type''', '''application/json''')
-        }
-    }
-    response {
-        status 200
-        body('''
-        bar
-        ''')
-        headers {
-            header('''Content-Type''', '''application/json;charset=UTF-8''')
-            header('''Content-Length''', '''3''')
-        }
-        testMatchers {
-            jsonPath('$[?(@.foo >= 20)]', byType())
-        }
-    }
-}

the generated document (example for Asciidoc) will contain a formatted contract -(the location of this file would be index/dsl-contract.adoc).

\ No newline at end of file + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/_generating_stubs_using_restdocs.html b/multi/_generating_stubs_using_restdocs.html index 2d5d2f5ff6..a5ffb82f50 100644 --- a/multi/_generating_stubs_using_restdocs.html +++ b/multi/_generating_stubs_using_restdocs.html @@ -1,93 +1,13 @@ - - - 6. Generating Stubs using RestDocs

6. Generating Stubs using RestDocs

Spring RestDocs can be -used to generate documentation (e.g. in asciidoctor format) for an -HTTP API with Spring MockMvc or Rest Assured. At the same time as you -generate documentation for your API, you can also generate WireMock -stubs, by using Spring Cloud Contract WireMock. Just write your normal -RestDocs test cases and use @AutoConfigureRestDocs to have stubs -automatically in the restdocs output directory. For example:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureRestDocs(outputDir = "target/snippets")
-@AutoConfigureMockMvc
-public class ApplicationTests {
+
 
-	@Autowired
-	private MockMvc mockMvc;
+
+
 
-	@Test
-	public void contextLoads() throws Exception {
-		mockMvc.perform(get("/resource"))
-				.andExpect(content().string("Hello World"))
-				.andDo(document("resource"));
-	}
-}

From this test will be generated a WireMock stub at -"target/snippets/stubs/resource.json". It matches all GET requests to -the "/resource" path.

Without any additional configuration this will create a stub with a -request matcher for the HTTP method and all headers except "host" and -"content-length". To match the request more precisely, for example to -match the body of a POST or PUT, we need to explicitly create a -request matcher. This will do two things: 1) create a stub that only -matches the way you specify, 2) assert that the request in the test -case also matches the same conditions.

The main entry point for this is WireMockRestDocs.verify() which can -be used as a substitute for the document() convenience method. For -example:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureRestDocs(outputDir = "target/snippets")
-@AutoConfigureMockMvc
-public class ApplicationTests {
+
 
-	@Autowired
-	private MockMvc mockMvc;
+Page Redirection
 
-	@Test
-	public void contextLoads() throws Exception {
-		mockMvc.perform(post("/resource")
-                .content("{\"id\":\"123456\",\"message\":\"Hello World\"}"))
-				.andExpect(status().isOk())
-				.andDo(verify().jsonPath("$.id")
-                        .stub("resource"));
-	}
-}

So this contract is saying: any valid POST with an "id" field will get -back an the same response as in this test. You can chain together -calls to .jsonPath() to add additional matchers. The -JayWay documentation can help you -to get up to speed with JSON Path if it is unfamiliar to you.

Instead of the jsonPath and contentType convenience methods, you -can also use the WireMock APIs to verify the request matches the -created stub. Example:

@Test
-public void contextLoads() throws Exception {
-	mockMvc.perform(post("/resource")
-               .content("{\"id\":\"123456\",\"message\":\"Hello World\"}"))
-			.andExpect(status().isOk())
-			.andDo(verify()
-					.wiremock(WireMock.post(
-						urlPathEquals("/resource"))
-						.withRequestBody(matchingJsonPath("$.id"))
-                       .stub("post-resource"));
-}

The WireMock API is rich - you can match headers, query parameters, -and request body by regex as well as by json path - so this can useful -to create stubs with a wider range of parameters. The above example -will generate a stub something like this:

post-resource.json.  -

{
-  "request" : {
-    "url" : "/resource",
-    "method" : "POST",
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$.id"
-    }]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "Hello World",
-    "headers" : {
-      "X-Application-Context" : "application:-1",
-      "Content-Type" : "text/plain"
-    }
-  }
-}

-

[Note]Note

You can use either the wiremock() method or the jsonPath() -and contentType() methods to create request matchers, but not both.

On the consumer side, you can make the resource.json generated above -available on the classpath (by publishing stubs as JARs for example). -After that, you can create a stub using WireMock in a -number of different ways, including as described above using -@AutoConfigureWireMock(stubs="classpath:resource.json").

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/_migrations.html b/multi/_migrations.html index 32198abe56..a5ffb82f50 100644 --- a/multi/_migrations.html +++ b/multi/_migrations.html @@ -1,83 +1,13 @@ - - - 8. Migrations

8. Migrations

In the following document we will write about necessary migration steps between versions.

8.1 1.0.x → 1.1.x

8.1.1 New structure of generated stubs

In 1.1.x we have introduced a changed structure of generated stubs. So if you’ve -been using the following @AutoConfigureWireMock notation to use the stubs from classpath

@AutoConfigureWireMock(stubs = "classpath:/customer-stubs/mappings", port = 8084)

It will no longer work with the new stubs. You have to either change the location of stubs -to : classpath:…​/META-INF/groupId/artifactId/version/mappings as follows

@AutoConfigureWireMock(stubs = "classpath:customer-stubs/META-INF/travel.components/customer-contract/1.0.2-SNAPSHOT/mappings/", port = 8084)

Or migrate to the new classpath based @AutoConfigureStubRunner.

If however you don’t want to do that and you want to remain with the old structure -just set your plugin tasks accordingly. Example for the structure presented in the -snippet above.

Maven.  -

<!-- start of pom.xml -->
+
 
-<properties>
-    <!-- we don't want the verifier to do a jar for us -->
-    <spring.cloud.contract.verifier.skip>true</spring.cloud.contract.verifier.skip>
-</properties>
+
+
 
-<!-- ... -->
+
 
-<!-- You need to set up the assembly plugin -->
-<build>
-    <plugins>
-        <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-assembly-plugin</artifactId>
-            <executions>
-                <execution>
-                    <id>stub</id>
-                    <phase>prepare-package</phase>
-                    <goals>
-                        <goal>single</goal>
-                    </goals>
-                    <inherited>false</inherited>
-                    <configuration>
-                        <attach>true</attach>
-                        <descriptor>${basedir}/src/assembly/stub.xml</descriptor>
-                    </configuration>
-                </execution>
-            </executions>
-        </plugin>
-    </plugins>
-</build>
-<!-- end of pom.xml -->
+Page Redirection
 
-<!-- start of stub.xml-->
-
-<assembly
-	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>stubs</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>${project.build.directory}/snippets/stubs</directory>
-			<outputDirectory>customer-stubs/mappings</outputDirectory>
-			<includes>
-				<include>**/*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${basedir}/src/test/resources/contracts</directory>
-			<outputDirectory>customer-stubs/contracts</outputDirectory>
-			<includes>
-				<include>**/*.groovy</include>
-			</includes>
-		</fileSet>
-	</fileSets>
-</assembly>
-
-<!-- end of stub.xml-->

-

Gradle.  -

task copyStubs(type: Copy, dependsOn: 'generateWireMockClientStubs') {
-//    Preserve directory structure from 1.0.X of spring-cloud-contract
-    from "${project.buildDir}/resources/main/customer-stubs/META-INF/${project.group}/${project.name}/${project.version}"
-    into "${project.buildDir}/resources/main/customer-stubs"
-}

-

8.2 1.1.x → 1.2.x

8.2.1 Custom HttpServerStub

By introducing a method String registeredMappings() in the public interface -HttpServerStub, if you wrote a custom HttpServerStub implementation, you’ll -have to implement that method too. It should return a String representing -all mappings available in a single HttpServerStub. Related to -issue 355.

8.2.2 New packages for generated tests

The flow for setting the generated tests package name will look like this:

  • pick basePackageForTests
  • if basePackageForTests wasn’t set pick the package from baseClassForTests
  • if baseClassForTests wasn’t set pick packageWithBaseClasses
  • if nothing got set pick the default org.springframework.cloud.contract.verifier.tests value

Related to -issue 260.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/_relaxed_ssl_validation_for_rest_template.html b/multi/_relaxed_ssl_validation_for_rest_template.html index b9f7e4347d..a5ffb82f50 100644 --- a/multi/_relaxed_ssl_validation_for_rest_template.html +++ b/multi/_relaxed_ssl_validation_for_rest_template.html @@ -1,26 +1,13 @@ - - - 4. Relaxed SSL Validation for Rest Template

4. Relaxed SSL Validation for Rest Template

WireMock allows you to stub a "secure" server with an "https" URL protocol. If your application wants to -contact that stub server in an integration test, then it will find that the SSL certificates are not -valid (it’s the usual problem with self-installed certificates). The best option is often to just -re-configure the client to use "http", but if that’s not open to you then you can ask Spring to configure -an HTTP client that ignores SSL validation errors (just for tests).

To make this work with minimum fuss you need to be using the Spring Boot RestTemplateBuilder in your app, -e.g.

@Bean
-public RestTemplate restTemplate(RestTemplateBuilder builder) {
-	return builder.build();
-}

This is because the builder is passed through callbacks to initalize it, so the SSL validation can be set up -in the client at that point. This will happen automatically in your test if you are using the -@AutoConfigureWireMock annotation (or the stub runner). If you are using the JUnit @Rule approach you need -to add the @AutoConfigureHttpClient annotation as well:

@RunWith(SpringRunner.class)
-@SpringBootTest("app.baseUrl=https://localhost:6443")
-@AutoConfigureHttpClient
-public class WiremockHttpsServerApplicationTests {
+
 
-	@ClassRule
-	public static WireMockClassRule wiremock = new WireMockClassRule(
-			WireMockSpring.options().httpsPort(6443));
-...
-}

If you are using spring-boot-starter-test then you will have the Apache HTTP client on the classpath and it will -be selected by the RestTemplateBuilder and configured to ignore SSL errors. If you are using the default java.net -client you don’t need the annotation (but it won’t do any harm). There is no support currently for other clients, but -it may be added in future releases.

\ No newline at end of file + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/_spring_cloud_contract.html b/multi/_spring_cloud_contract.html index 1c9de414d0..a5ffb82f50 100644 --- a/multi/_spring_cloud_contract.html +++ b/multi/_spring_cloud_contract.html @@ -1,6 +1,13 @@ - - - 1. Spring Cloud Contract

1. Spring Cloud Contract

What you always need is confidence in pushing new features into a new application or service in a distributed system. -This project provides support for Consumer Driven Contracts and service schemas in Spring applications, covering a -range of options for writing tests, publishing them as assets, asserting that a contract is kept by producers -and consumers, for HTTP and message-based interactions.

\ No newline at end of file + + + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/_spring_cloud_contract_verifier.html b/multi/_spring_cloud_contract_verifier.html index a62f5ce142..a5ffb82f50 100644 --- a/multi/_spring_cloud_contract_verifier.html +++ b/multi/_spring_cloud_contract_verifier.html @@ -1,4155 +1,13 @@ - - - 2. Spring Cloud Contract Verifier

2. Spring Cloud Contract Verifier

2.1 Introduction

[Tip]Tip

The Accurest project was initially started by Marcin Grzejszczak and Jakub Kubrynski (codearte.io)

Just to make long story short - Spring Cloud Contract Verifier is a tool that enables Consumer Driven Contract (CDC) development of JVM-based applications. It is shipped -with Contract Definition Language (DSL). Contract definitions are used to produce following resources:

  • JSON stub definitions to be used by WireMock when doing integration testing on the client code (client tests). -Test code must still be written by hand, test data is produced by Spring Cloud Contract Verifier.
  • Messaging routes if you’re using one. We’re integrating with Spring Integration, Spring Cloud Stream, Spring AMQP and Apache Camel. You can however set your own integrations if you want to
  • Acceptance tests (in JUnit or Spock) used to verify if server-side implementation of the API is compliant with the contract (server tests). -Full test is generated by Spring Cloud Contract Verifier.

Spring Cloud Contract Verifier moves TDD to the level of software architecture.

2.1.1 Why?

Let us assume that we have a system comprising of multiple microservices:

Microservices Architecture

Testing issues

If we wanted to test the application in top left corner if it can communicate with other services then we could do one of two things:

  • deploy all microservices and perform end to end tests
  • mock other microservices in unit / integration tests

Both have their advantages but also a lot of disadvantages. Let’s focus on the latter.

Deploy all microservices and perform end to end tests

Advantages:

  • simulates production
  • tests real communication between services

Disadvantages:

  • to test one microservice we would have to deploy 6 microservices, a couple of databases etc.
  • the environment where the tests would be conducted would be locked for a single suite of tests (i.e. nobody else would be able to run the tests in the meantime).
  • long to run
  • very late feedback
  • extremely hard to debug

Mock other microservices in unit / integration tests

Advantages:

  • very fast feedback
  • no infrastructure requirements

Disadvantages:

  • the implementor of the service creates stubs thus they might have nothing to do with the reality
  • you can go to production with passing tests and failing production

To solve the aforementioned issues Spring Cloud Contract Verifier with Stub Runner were created. Their main idea is to give you very fast feedback, without the need -to set up the whole world of microservices. If you work on stubs then the only applications you need are those that your application is using directly.

Stubbed Services

Spring Cloud Contract Verifier gives you the certainty that the stubs that you’re using were created by the service that you’re calling. Also if you can use them it means that they were -tested against the producer’s side. In other words - you can trust those stubs.

2.1.2 Purposes

The main purposes of Spring Cloud Contract Verifier with Stub Runner are:

  • to ensure that WireMock / Messaging stubs (used when developing the client) are doing exactly what actual server-side implementation will do,
  • to promote ATDD method and Microservices architectural style,
  • to provide a way to publish changes in contracts that are immediately visible on both sides,
  • to generate boilerplate test code used on the server side.
[Important]Important

Spring Cloud Contract Verifier’s purpose is NOT to start writing business features in the contracts. -Let’s assume that we have a business use case of fraud check. If a user can be a fraud for 100 different reasons, -we would assume that you would create 2 contracts. One for the positive and one for the negative fraud case. -Contract tests are used to test contracts between applications and not to simulate full behaviour.

2.1.3 How

Define the contract

As consumers we need to define what exactly we want to achieve. We need to formulate our expectations. That’s why we write the following contract.

Let’s assume that we’d like to send the request containing the id of the client and the amount he wants to borrow from us. We’d like to send it to the /fraudcheck url via the PUT method.

package contracts
+
 
-org.springframework.cloud.contract.spec.Contract.make {
-	request { // (1)
-		method 'PUT' // (2)
-		url '/fraudcheck' // (3)
-		body([ // (4)
-			   "client.id": $(regex('[0-9]{10}')),
-			   loanAmount: 99999
-		])
-		headers { // (5)
-			contentType('application/json')
-		}
-	}
-	response { // (6)
-		status 200 // (7)
-		body([ // (8)
-			   fraudCheckStatus: "FRAUD",
-			   "rejection.reason": "Amount too high"
-		])
-		headers { // (9)
-			contentType('application/json')
-		}
-	}
-}
+
+
 
-/*
-From the Consumer perspective, when shooting a request in the integration test:
+
 
-(1) - If the consumer sends a request
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `clientId` that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the response will be sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` equal to `application/json`
+Page Redirection
 
-From the Producer perspective, in the autogenerated producer-side test:
-
-(1) - A request will be sent to the producer
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `clientId` that will have a generated value that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the test will assert if the response has been sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` matching `application/json.*`
- */

Client Side

Spring Cloud Contract will generate stubs, which you can use during client side testing. -You will have a WireMock instance / Messaging route up and running that simulates the service Y. -You would like to feed that instance with a proper stub definition.

At some point in time you need to send a request to the Fraud Detection service.

ResponseEntity<FraudServiceResponse> response =
-		restTemplate.exchange("http://localhost:" + port + "/fraudcheck", HttpMethod.PUT,
-				new HttpEntity<>(request, httpHeaders),
-				FraudServiceResponse.class);

Annotate your test class with @AutoConfigureStubRunner. In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators.

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment=WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, workOffline = true)
-@DirtiesContext
-public class LoanApplicationServiceTests {

After that, during the tests Spring Cloud Contract will automatically find the stubs (simulating the real service) in Maven repository and expose them on configured (or random) port.

Server Side

Being a service Y since you are developing your stub, you need to be sure that it’s actually resembling your -concrete implementation. You can’t have a situation where your stub acts in one way and your application on -production behaves in a different way.

That’s why from the provided stub acceptance tests will be generated that will ensure -that your application behaves in the same way as you define in your stub.

The autogenerated test would look like this:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-    // given:
-        MockMvcRequestSpecification request = given()
-                .header("Content-Type", "application/vnd.fraud.v1+json")
-                .body("{\"client.id\":\"1234567890\",\"loanAmount\":99999}");
-
-    // when:
-        ResponseOptions response = given().spec(request)
-                .put("/fraudcheck");
-
-    // then:
-        assertThat(response.statusCode()).isEqualTo(200);
-        assertThat(response.header("Content-Type")).matches("application/vnd.fraud.v1.json.*");
-    // and:
-        DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-        assertThatJson(parsedJson).field("['fraudCheckStatus']").matches("[A-Z]{5}");
-        assertThatJson(parsedJson).field("['rejection.reason']").isEqualTo("Amount too high");
-}

2.1.4 Step by step guide to CDC

Let’s take an example of Fraud Detection and Loan Issuance process. The business scenario is such that we want to issue loans to people but don’t want them to steal the money from us. The current implementation of our system grants loans to everybody.

Let’s assume that the Loan Issuance is a client to the -Fraud Detection server. In the current sprint we are required to develop a new feature - if a client wants to borrow too much money then we mark him as fraud.

Technical remark - Fraud Detection will have artifact id http-server, Loan Issuance http-client and both have group id com.example.

Social remark - both client and server development teams need to communicate directly and discuss changes while -going through the process. CDC is all about communication.

The server side code is available here and the client side code here.

[Tip]Tip

In this case the ownership of the contracts lays on the producer side. It means that physically -all the contract are present in the producer’s repository

Technical note

If using the SNAPSHOT / Milestone / Release Candidate versions please add the following section to your

Maven.  -

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

-

Gradle.  -

repositories {
-	mavenCentral()
-	mavenLocal()
-	maven { url "https://repo.spring.io/snapshot" }
-	maven { url "https://repo.spring.io/milestone" }
-	maven { url "https://repo.spring.io/release" }
-}

-

Consumer side (Loan Issuance)

As a developer of the Loan Issuance service (a consumer of the Fraud Detection server):

start doing TDD by writing a test to your feature

@Test
-public void shouldBeRejectedDueToAbnormalLoanAmount() {
-	// given:
-	LoanApplication application = new LoanApplication(new Client("1234567890"),
-			99999);
-	// when:
-	LoanApplicationResult loanApplication = service.loanApplication(application);
-	// then:
-	assertThat(loanApplication.getLoanApplicationStatus())
-			.isEqualTo(LoanApplicationStatus.LOAN_APPLICATION_REJECTED);
-	assertThat(loanApplication.getRejectionReason()).isEqualTo("Amount too high");
-}

We’ve just written a test of our new feature. If a loan application for a big amount is received we should reject that loan application with some description.

write the missing implementation

At some point in time you need to send a request to the Fraud Detection service. Let’s assume that we’d like to send the request containing the id of the client and the amount he wants to borrow from us. We’d like to send it to the /fraudcheck url via the PUT method.

ResponseEntity<FraudServiceResponse> response =
-		restTemplate.exchange("http://localhost:" + port + "/fraudcheck", HttpMethod.PUT,
-				new HttpEntity<>(request, httpHeaders),
-				FraudServiceResponse.class);

For simplicity we’ve hardcoded the port of the Fraud Detection service at 8080 and our application is running on 8090.

If we’d start the written test it would obviously break since we have no service running on port 8080.

clone the Fraud Detection service repository locally

We’ll start playing around with the server side contract. That’s why we need to first clone it.

git clone https://your-git-server.com/server-side.git local-http-server-repo

define the contract locally in the repo of Fraud Detection service

As consumers we need to define what exactly we want to achieve. We need to formulate our expectations. That’s why we write the following contract.

[Important]Important

We’re placing the contract under src/test/resources/contracts/fraud folder. The fraud folder -is important cause we’ll reference that folder in the producer’s test base class name.

package contracts
-
-org.springframework.cloud.contract.spec.Contract.make {
-	request { // (1)
-		method 'PUT' // (2)
-		url '/fraudcheck' // (3)
-		body([ // (4)
-			   "client.id": $(regex('[0-9]{10}')),
-			   loanAmount: 99999
-		])
-		headers { // (5)
-			contentType('application/json')
-		}
-	}
-	response { // (6)
-		status 200 // (7)
-		body([ // (8)
-			   fraudCheckStatus: "FRAUD",
-			   "rejection.reason": "Amount too high"
-		])
-		headers { // (9)
-			contentType('application/json')
-		}
-	}
-}
-
-/*
-From the Consumer perspective, when shooting a request in the integration test:
-
-(1) - If the consumer sends a request
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `clientId` that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the response will be sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` equal to `application/json`
-
-From the Producer perspective, in the autogenerated producer-side test:
-
-(1) - A request will be sent to the producer
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `clientId` that will have a generated value that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the test will assert if the response has been sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` matching `application/json.*`
- */

The Contract is written using a statically typed Groovy DSL. You might be wondering what are those -value(client(…​), server(…​)) parts. By using this notation Spring Cloud Contract allows you to -define parts of a JSON / URL / etc. which are dynamic. In case of an identifier or a timestamp you -don’t want to hardcode a value. You want to allow some different ranges of values. That’s why for -the consumer side you can set regular expressions matching those values. You can provide the body -either by means of a map notation or String with interpolations. -Consult the docs -for more information. We highly recommend using the map notation!

[Tip]Tip

It’s really important that you understand the map notation to set up contracts. Please read the -Groovy docs regarding JSON

The aforementioned contract is an agreement between two sides that:

  • if an HTTP request is sent with

    • a method PUT on an endpoint /fraudcheck
    • JSON body with client.id matching the regular expression [0-9]{10} and loanAmount equal to 99999
    • and with a header Content-Type equal to application/vnd.fraud.v1+json
  • then an HTTP response would be sent to the consumer that

    • has status 200
    • contains JSON body with the fraudCheckStatus field containing a value FRAUD and the rejectionReason field having value Amount too high
    • and a Content-Type header with a value of application/vnd.fraud.v1+json

Once we’re ready to check the API in practice in the integration tests we need to just install the stubs locally

add the Spring Cloud Contract Verifier plugin

We can add either Maven or Gradle plugin - in this example we’ll show how to add Maven. First we need to add the Spring Cloud Contract BOM.

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-dependencies.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Next, the Spring Cloud Contract Verifier Maven plugin

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-</plugin>

Since the plugin was added we get the Spring Cloud Contract Verifier features which from the provided contracts:

  • generate and run tests
  • produce and install stubs

We don’t want to generate tests since we, as consumers, want only to play with the stubs. That’s why we need to skip the tests generation and execution. When we execute:

cd local-http-server-repo
-./mvnw clean install -DskipTests

In the logs we’ll see something like this:

[INFO] --- spring-cloud-contract-maven-plugin:1.0.0.BUILD-SNAPSHOT:generateStubs (default-generateStubs) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar
-[INFO]
-[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar
-[INFO]
-[INFO] --- spring-boot-maven-plugin:1.5.5.BUILD-SNAPSHOT:repackage (default) @ http-server ---
-[INFO]
-[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ http-server ---
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.jar
-[INFO] Installing /some/path/http-server/pom.xml to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.pom
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar

This line is extremely important

[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar

It’s confirming that the stubs of the http-server have been installed in the local repository.

run the integration tests

In order to profit from the Spring Cloud Contract Stub Runner functionality of automatic stub downloading you have to do the following in our consumer side project (Loan Application service).

Add the Spring Cloud Contract BOM

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-dependencies.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Add the dependency to Spring Cloud Contract Stub Runner

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-	<scope>test</scope>
-</dependency>

Annotate your test class with @AutoConfigureStubRunner. In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators. Also provide the offline work switch since you’re playing with the collaborators offline (optional step).

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment=WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, workOffline = true)
-@DirtiesContext
-public class LoanApplicationServiceTests {

Now if you run your tests you’ll see sth like this:

2016-07-19 14:22:25.403  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Desired version is + - will try to resolve the latest version
-2016-07-19 14:22:25.438  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved version is 0.0.1-SNAPSHOT
-2016-07-19 14:22:25.439  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolving artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT using remote repositories []
-2016-07-19 14:22:25.451  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar
-2016-07-19 14:22:25.465  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacking stub from JAR [URI: file:/path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar]
-2016-07-19 14:22:25.475  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacked file to [/var/folders/0p/xwq47sq106x1_g3dtv6qfm940000gq/T/contracts100276532569594265]
-2016-07-19 14:22:27.737  INFO 41050 --- [           main] o.s.c.c.stubrunner.StubRunnerExecutor    : All stubs are now running RunningStubs [namesAndPorts={com.example:http-server:0.0.1-SNAPSHOT:stubs=8080}]

Which means that Stub Runner has found your stubs and started a server for app with group id com.example, artifact id http-server with version 0.0.1-SNAPSHOT of the stubs and with stubs classifier on port 8080.

file a PR

What we did until now is an iterative process. We can play around with the contract, install it locally and work on the consumer side until we’re happy with the contract.

Once we’re satisfied with the results and the test passes publish a PR to the server side. Currently the consumer side work is done.

Producer side (Fraud Detection server)

As a developer of the Fraud Detection server (a server to the Loan Issuance service):

initial implementation

As a reminder here you can see the initial implementation

@RequestMapping(value = "/fraudcheck", method = PUT)
-public FraudCheckResult fraudCheck(@RequestBody FraudCheck fraudCheck) {
-return new FraudCheckResult(FraudCheckStatus.OK, NO_REASON);
-}

take over the PR

git checkout -b contract-change-pr master
-git pull https://your-git-server.com/server-side-fork.git contract-change-pr

You have to add the dependencies needed by the autogenerated tests

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>

In the configuration of the Maven plugin we passed the packageWithBaseClasses property

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-</plugin>
[Important]Important

We’ve decided to use the "convention based" naming by setting the packageWithBaseClasses property. -That means that 2 last packages will be combined into a name of the base test class. In our case the contracts -were placed under src/test/resources/contracts/fraud. Since we don’t have 2 packages starting from the contracts -folder we’re picking only one which is fraud. We’re adding the Base suffix and we’re capitalizing fraud. -That gives us the FraudBase test class name.

That’s because all the generated tests will extend that class. Over there you can set up your Spring Context or -whatever is necessary. In our case we’re using Rest Assured MVC to start the server side FraudDetectionController.

package com.example.fraud;
-
-import org.junit.Before;
-
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-
-public class FraudBase {
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.standaloneSetup(new FraudDetectionController(),
-				new FraudStatsController(stubbedStatsProvider()));
-	}
-
-	private StatsProvider stubbedStatsProvider() {
-		return fraudType -> {
-			switch (fraudType) {
-			case DRUNKS:
-				return 100;
-			case ALL:
-				return 200;
-			}
-			return 0;
-		};
-	}
-
-	public void assertThatRejectionReasonIsNull(Object rejectionReason) {
-		assert rejectionReason == null;
-	}
-}

Now, if you run the ./mvnw clean install you would get sth like this:

Results :
-
-Tests in error:
-  ContractVerifierTest.validate_shouldMarkClientAsFraud:32 » IllegalState Parsed...

That’s because you have a new contract from which a test was generated and it failed since you haven’t implemented the feature. The autogenerated test would look like this:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-    // given:
-        MockMvcRequestSpecification request = given()
-                .header("Content-Type", "application/vnd.fraud.v1+json")
-                .body("{\"client.id\":\"1234567890\",\"loanAmount\":99999}");
-
-    // when:
-        ResponseOptions response = given().spec(request)
-                .put("/fraudcheck");
-
-    // then:
-        assertThat(response.statusCode()).isEqualTo(200);
-        assertThat(response.header("Content-Type")).matches("application/vnd.fraud.v1.json.*");
-    // and:
-        DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-        assertThatJson(parsedJson).field("['fraudCheckStatus']").matches("[A-Z]{5}");
-        assertThatJson(parsedJson).field("['rejection.reason']").isEqualTo("Amount too high");
-}

As you can see all the producer() parts of the Contract that were present in the value(consumer(…​), producer(…​)) blocks got injected into the test.

What’s important here to note is that on the producer side we also are doing TDD. We have expectations in form of a test. This test is shooting a request to our own application to an URL, headers and body defined in the contract. It also is expecting very precisely defined values in the response. In other words you have is your red part of red, green and refactor. Time to convert the red into the green.

write the missing implementation

Now since we now what is the expected input and expected output let’s write the missing implementation.

@RequestMapping(value = "/fraudcheck", method = PUT)
-public FraudCheckResult fraudCheck(@RequestBody FraudCheck fraudCheck) {
-if (amountGreaterThanThreshold(fraudCheck)) {
-	return new FraudCheckResult(FraudCheckStatus.FRAUD, AMOUNT_TOO_HIGH);
-}
-return new FraudCheckResult(FraudCheckStatus.OK, NO_REASON);
-}

If we execute ./mvnw clean install again the tests will pass. Since the Spring Cloud Contract Verifier plugin adds the tests to the generated-test-sources you can actually run those tests from your IDE.

deploy your app

Once you’ve finished your work it’s time to deploy your change. First merge the branch

git checkout master
-git merge --no-ff contract-change-pr
-git push origin master

Then we assume that your CI would run sth like ./mvnw clean deploy which would publish both the application and the stub artifcats.

Consumer side (Loan Issuance) final step

As a developer of the Loan Issuance service (a consumer of the Fraud Detection server):

merge branch to master

git checkout master
-git merge --no-ff contract-change-pr

work online

Now you can disable the offline work for Spring Cloud Contract Stub Runner and provide where the repository with your stubs is placed. At this moment the stubs of the server side will be automatically downloaded from Nexus / Artifactory. -You can switch off the value of the workOffline parameter in your annotation. Below you can see an -example of achieving the same by changing the properties.

stubrunner:
-  ids: 'com.example:http-server-dsl:+:stubs:8080'
-  repositoryRoot: https://repo.spring.io/libs-snapshot

And that’s it!

2.1.5 Dependencies

The best way to add the dependencies is to just use the proper starter dependency.

For stub-runner use spring-cloud-starter-stub-runner and when you’re using a plugin just add -spring-cloud-starter-contract-verifier.

2.1.6 Additional links

Below you can find some resources related to Spring Cloud Contract Verifier and Stub Runner. Note that some can be outdated since the Spring Cloud Contract Verifier project -is under constant development.

Spring Cloud Contract video

You can check out the video from the Warsaw JUG about Spring Cloud Contract:

2.1.7 Samples

Here you can find some samples.

2.2 FAQ

2.2.1 Why use Spring Cloud Contract Verifier and not X ?

For the time being Spring Cloud Contract Verifier is a JVM based tool. So it could be your first pick when you’re already creating -software for the JVM. This project has a lot of really interesting features but especially quite a few of them definitely make -Spring Cloud Contract Verifier stand out on the "market" of Consumer Driven Contract (CDC) tooling. Out of many the most interesting are:

  • Possibility to do CDC with messaging
  • Clear and easy to use, statically typed DSL
  • Possibility to copy paste your current JSON file to the contract and only edit its elements
  • Automatic generation of tests from the defined Contract
  • Stub Runner functionality - the stubs are automatically downloaded at runtime from Nexus / Artifactory
  • Spring Cloud integration - no discovery service is needed for integration tests

2.2.2 What is this value(consumer(), producer()) ?

One of the biggest challenges related to stubs is their reusability. Only if they can be vastly used, will they serve their purpose. -What typically makes that difficult are the hard-coded values of request / response elements. For example dates or ids. -Imagine the following JSON request

{
-    "time" : "2016-10-10 20:10:15",
-    "id" : "9febab1c-6f36-4a0b-88d6-3b6a6d81cd4a",
-    "body" : "foo"
-}

and JSON response

{
-    "time" : "2016-10-10 21:10:15",
-    "id" : "c4231e1f-3ca9-48d3-b7e7-567d55f0d051",
-    "body" : "bar"
-}

Imagine the pain required to set proper value of the time field (let’s assume that this content is generated by the -database) by changing the clock in the system or providing stub implementations of data providers. The same is related -to the field called id. Will you create a stubbed implementation of UUID generator? Makes little sense…​

So as a consumer you would like to send a request that matches any form of a time or any UUID. That way your system -will work as usual - will generate data and you won’t have to stub anything out. Let’s assume that in case of the aforementioned -JSON the most important part is the body field. You can focus on that and provide matching for other fields. In other words -you would like the stub to work like this:

{
-    "time" : "SOMETHING THAT MATCHES TIME",
-    "id" : "SOMETHING THAT MATCHES UUID",
-    "body" : "foo"
-}

As far as the response goes as a consumer you need a concrete value that you can operate on. So such a JSON is valid

{
-    "time" : "2016-10-10 21:10:15",
-    "id" : "c4231e1f-3ca9-48d3-b7e7-567d55f0d051",
-    "body" : "bar"
-}

As you could see in the previous sections we generate tests from contracts. So from the producer’s side the situation looks -much different. We’re parsing the provided contract and in the test we want to send a real request to your endpoints. -So for the case of a producer for the request we can’t have any sort of matching. We need concrete values that the -producer’s backend can work on. Such a JSON would be a valid one:

{
-    "time" : "2016-10-10 20:10:15",
-    "id" : "9febab1c-6f36-4a0b-88d6-3b6a6d81cd4a",
-    "body" : "foo"
-}

On the other hand from the point of view of the validity of the contract the response doesn’t necessarily have to -contain concrete values of time or id. Let’s say that you generate those on the producer side - again, you’d -have to do a lot of stubbing to ensure that you always return the same values. That’s why from the producer’s side -what you might want is the following response:

{
-    "time" : "SOMETHING THAT MATCHES TIME",
-    "id" : "SOMETHING THAT MATCHES UUID",
-    "body" : "bar"
-}

How can you then provide one time a matcher for the consumer and a concrete value for the producer and vice versa? -In Spring Cloud Contract we’re allowing you to provide a dynamic value. That means that it can differ for both -sides of the communication. You can pass the values:

Either via the value method

value(consumer(...), producer(...))
-value(stub(...), test(...))
-value(client(...), server(...))

or using the $() method

$(consumer(...), producer(...))
-$(stub(...), test(...))
-$(client(...), server(...))

You can read more about this in the Contract DSL section.

Calling value() or $() tells Spring Cloud Contract that you will be passing a dynamic value. -Inside the consumer() method you pass the value that should be used on the consumer side (in the generated stub). -Inside the producer() method you pass the value that should be used on the producer side (in the generated test).

[Tip]Tip

If on one side you have passed the regular expression and you haven’t passed the other, then the -other side will get auto-generated.

Most often you will use that method together with the regex helper method. E.g. consumer(regex('[0-9]{10}')).

To sum it up the contract for the aforementioned scenario would look more or less like this (the regular expression -for time and UUID are simplified and most likely invalid but we want to keep things very simple in this example):

org.springframework.cloud.contract.spec.Contract.make {
-				request {
-					method 'GET'
-					url '/someUrl'
-					body([
-					    time : value(consumer(regex('[0-9]{4}-[0-9]{2}-[0-9]{2} [0-2][0-9]-[0-5][0-9]-[0-5][0-9]')),
-					    id: value(consumer(regex('[0-9a-zA-z]{8}-[0-9a-zA-z]{4}-[0-9a-zA-z]{4}-[0-9a-zA-z]{12}'))
-					    body: "foo"
-					])
-				}
-			response {
-				status 200
-				body([
-					    time : value(producer(regex('[0-9]{4}-[0-9]{2}-[0-9]{2} [0-2][0-9]-[0-5][0-9]-[0-5][0-9]')),
-					    id: value([producer(regex('[0-9a-zA-z]{8}-[0-9a-zA-z]{4}-[0-9a-zA-z]{4}-[0-9a-zA-z]{12}'))
-					    body: "bar"
-					])
-			}
-}
[Important]Important

Please read the Groovy docs related to JSON to understand how to -properly structure the request / response bodies.

2.2.3 How to do Stubs versioning?

API Versioning

Let’s try to answer a question what versioning really means. If you’re referring to the API version then there are -different approaches.

  • use Hypermedia, links and do not version your API by any means
  • pass versions through headers / urls

I will not try to answer a question which approach is better. Whatever suit your needs and allows you to generate -business value should be picked.

Let’s assume that you do version your API. In that case you should provide as many contracts as many versions you support. -You can create a subfolder for every version or append it to th contract name - whatever suits you more.

JAR versioning

If by versioning you mean the version of the JAR that contains the stubs then there are essentially two main approaches.

Let’s assume that you’re doing Continuous Delivery / Deployment which means that you’re generating a new version of -the jar each time you go through the pipeline and that jar can go to production at any time. For example your jar version -looks like this (it got built on the 20.10.2016 at 20:15:21) :

1.0.0.20161020-201521-RELEASE

In that case your generated stub jar will look like this.

1.0.0.20161020-201521-RELEASE-stubs.jar

In this case you should inside your application.yml or @AutoConfigureStubRunner when referencing stubs provide the - latest version of the stubs. You can do that by passing the + sign. Example

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:8080"})

If the versioning however is fixed (e.g. 1.0.4.RELEASE or 2.1.1) then you have to set the concrete value of the jar -version. Example for 2.1.1.

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:2.1.1:stubs:8080"})

Dev or prod stubs

You can manipulate the classifier to run the tests against current development version of the stubs of other services - or the ones that were deployed to production. If you alter your build to deploy the stubs with the prod-stubs classifier - once you reach production deployment then you can run tests in one case with dev stubs and one with prod stubs.

Example of tests using development version of stubs

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:8080"})

Example of tests using production version of stubs

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:prod-stubs:8080"})

You can pass those values also via properties from your deployment pipeline.

2.2.4 Common repo with contracts

Another way of storing contracts other than having them with the producer is keeping them in a common place. -It can be related to security issues where the consumers can’t clone the producer’s code. Also if you keep -contracts in a single place then you, as a producer, will know how many consumers you have and which -consumer will you break with your local changes.

Repo structure

Let’s assume that we have a producer with coordinates com.example:server and 3 consumers: client1, -client2, client3. Then in the repository with common contracts you would have the following setup -(which you can checkout here:

├── com
-│   └── example
-│       └── server
-│           ├── client1
-│           │   └── expectation.groovy
-│           ├── client2
-│           │   └── expectation.groovy
-│           ├── client3
-│           │   └── expectation.groovy
-│           └── pom.xml
-├── mvnw
-├── mvnw.cmd
-├── pom.xml
-└── src
-    └── assembly
-        └── contracts.xml

As you can see the under the slash-delimited groupid / artifact id folder (com/example/server) you have -expectations of the 3 consumers (client1, client2 and client3). Expectations are the standard Groovy DSL -contract files as described throughout this documentation. This repository has to produce a JAR file that maps -one to one to the contents of the repo.

Example of a pom.xml inside the server folder.

<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<groupId>com.example</groupId>
-	<artifactId>server</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
-
-	<name>Server Stubs</name>
-	<description>POM used to install locally stubs for consumer side</description>
-
-	<parent>
-		<groupId>org.springframework.boot</groupId>
-		<artifactId>spring-boot-starter-parent</artifactId>
-		<version>1.5.4.RELEASE</version>
-		<relativePath />
-	</parent>
-
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<java.version>1.8</java.version>
-		<spring-cloud-contract.version>1.2.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
-		<spring-cloud-dependencies.version>Edgware.BUILD-SNAPSHOT</spring-cloud-dependencies.version>
-		<excludeBuildFolders>true</excludeBuildFolders>
-	</properties>
-
-	<dependencyManagement>
-		<dependencies>
-			<dependency>
-				<groupId>org.springframework.cloud</groupId>
-				<artifactId>spring-cloud-dependencies</artifactId>
-				<version>${spring-cloud-dependencies.version}</version>
-				<type>pom</type>
-				<scope>import</scope>
-			</dependency>
-		</dependencies>
-	</dependencyManagement>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.springframework.cloud</groupId>
-				<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-				<version>${spring-cloud-contract.version}</version>
-				<extensions>true</extensions>
-				<configuration>
-					<!-- By default it would search under src/test/resources/ -->
-					<contractsDirectory>${project.basedir}</contractsDirectory>
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
-
-	<repositories>
-		<repository>
-			<id>spring-snapshots</id>
-			<name>Spring Snapshots</name>
-			<url>https://repo.spring.io/snapshot</url>
-			<snapshots>
-				<enabled>true</enabled>
-			</snapshots>
-		</repository>
-		<repository>
-			<id>spring-milestones</id>
-			<name>Spring Milestones</name>
-			<url>https://repo.spring.io/milestone</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</repository>
-		<repository>
-			<id>spring-releases</id>
-			<name>Spring Releases</name>
-			<url>https://repo.spring.io/release</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</repository>
-	</repositories>
-	<pluginRepositories>
-		<pluginRepository>
-			<id>spring-snapshots</id>
-			<name>Spring Snapshots</name>
-			<url>https://repo.spring.io/snapshot</url>
-			<snapshots>
-				<enabled>true</enabled>
-			</snapshots>
-		</pluginRepository>
-		<pluginRepository>
-			<id>spring-milestones</id>
-			<name>Spring Milestones</name>
-			<url>https://repo.spring.io/milestone</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</pluginRepository>
-		<pluginRepository>
-			<id>spring-releases</id>
-			<name>Spring Releases</name>
-			<url>https://repo.spring.io/release</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</pluginRepository>
-	</pluginRepositories>
-
-</project>

As you can see there are no dependencies other than the Spring Cloud Contract Maven Plugin. -Those poms are necessary for the consumer side to run mvn clean install -DskipTests to locally install - stubs of the producer project.

The pom.xml in the root folder can look like this:

<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<groupId>com.example.standalone</groupId>
-	<artifactId>contracts</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
-
-	<name>Contracts</name>
-	<description>Contains all the Spring Cloud Contracts, well, contracts. JAR used by the producers to generate tests and stubs</description>
-
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-	</properties>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-assembly-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>contracts</id>
-						<phase>prepare-package</phase>
-						<goals>
-							<goal>single</goal>
-						</goals>
-						<configuration>
-							<attach>true</attach>
-							<descriptor>${basedir}/src/assembly/contracts.xml</descriptor>
-							<!-- If you want an explicit classifier remove the following line -->
-							<appendAssemblyId>false</appendAssemblyId>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-
-</project>

It’s using the assembly plugin in order to build the JAR with all the contracts. Example of such setup is here:

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-		  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>project</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>${project.basedir}</directory>
-			<outputDirectory>/</outputDirectory>
-			<useDefaultExcludes>true</useDefaultExcludes>
-			<excludes>
-				<exclude>**/${project.build.directory}/**</exclude>
-				<exclude>mvnw</exclude>
-				<exclude>mvnw.cmd</exclude>
-				<exclude>.mvn/**</exclude>
-				<exclude>src/**</exclude>
-			</excludes>
-		</fileSet>
-	</fileSets>
-</assembly>

Workflow

The workflow would look similar to the one presented in the Step by step guide to CDC. The only difference - is that the producer doesn’t own the contracts anymore. So the consumer and the producer have to work on - common contracts in a common repository.

Consumer

When the consumer wants to work on the contracts offline, instead of cloning the producer code, the -consumer team clones the common repository, goes to the required producer’s folder (e.g. com/example/server) -and runs mvn clean install -DskipTests to install locally the stubs converted from the contracts.

[Tip]Tip

You need to have Maven installed locally

Producer

As a producer it’s enough to alter the Spring Cloud Contract Verifier to provide the URL and the dependency -of the JAR containing the contracts:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<contractsRepositoryUrl>http://link/to/your/nexus/or/artifactory/or/sth</contractsRepositoryUrl>
-		<contractDependency>
-			<groupId>com.example.standalone</groupId>
-			<artifactId>contracts</artifactId>
-		</contractDependency>
-	</configuration>
-</plugin>

With this setup the JAR with groupid com.example.standalone and artifactid contracts will be downloaded -from http://link/to/your/nexus/or/artifactory/or/sth. It will be then unpacked in a local temporary folder -and contracts present under the com/example/server will be picked as the ones used to generate the -tests and the stubs. Due to this convention the producer team will know which consumer teams will be broken -when some incompatible changes are done.

The rest of the flow looks the same.

2.2.5 Can I have multiple base classes for tests?

Yes! Check out the Different base classes for contracts sections -of either Gradle or Maven plugins.

2.2.6 How can I debug the request/response being sent by the generated tests client?

The generated tests all boil down to RestAssured in some form or fashion which relies on Apache HttpClient. HttpClient has a facility called wire logging which logs the entire request and response to HttpClient. Spring Boot has a logging common application property for doing this sort of thing, just add this to your application properties

logging.level.org.apache.http.wire=DEBUG

2.2.7 How can I debug the mapping/request/response being sent by WireMock?

Starting from version 1.2.0 we turn on WireMock logging to -info and the WireMock notifier to being verbose. Now you will -exactly know what request was received by WireMock server and which -matching response definition was picked.

To turn off this feature just bump WireMock logging to ERROR

logging.level.com.github.tomakehurst.wiremock=ERROR

2.2.8 How can I see what got registered in the HTTP server stub?

You can use the mappingsOutputFolder property on @AutoConfigureStubRunner or StubRunnerRule -to dump all mappings per artifact id. Also the port at which the given stub server was -started will be attached.

2.2.9 Can I reference the request from the response?

Yes! With version 1.1.0 we’ve added such a possibility. On the HTTP stub server side we’re providing support -for this for WireMock. In case of other HTTP server stubs you’ll have to implement the approach yourself.

2.2.10 Can I reference text from file?

Yes! With version 1.2.0 we’ve added such a possibility. It’s enough to call file(…​) method in the -DSL and provide a path relative to where the contract lays.

2.3 Spring Cloud Contract Verifier HTTP

2.3.1 Gradle Project

Prerequisites

In order to use Spring Cloud Contract Verifier with WireMock you have to use Gradle or Maven plugin.

[Warning]Warning

If you want to use Spock in your projects you have to add separately -the spock-core and spock-spring modules. Check Spock docs for more information

Add gradle plugin with dependencies
buildscript {
-	repositories {
-		mavenCentral()
-	}
-	dependencies {
-	    classpath "org.springframework.boot:spring-boot-gradle-plugin:${springboot_version}"
-		classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${verifier_version}"
-	}
-}
-
-apply plugin: 'groovy'
-apply plugin: 'spring-cloud-contract'
-
-dependencyManagement {
-	imports {
-		mavenBom "org.springframework.cloud:spring-cloud-contract-dependencies:${verifier_version}"
-	}
-}
-
-dependencies {
-	testCompile 'org.codehaus.groovy:groovy-all:2.4.6'
-	// example with adding Spock core and Spock Spring
-	testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
-	testCompile 'org.spockframework:spock-spring:1.0-groovy-2.4'
-	testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
-}
Gradle and Rest Assured 2.0

By default Rest Assured 3.x is added to the classpath. However in order to give the users the -opportunity to use Rest Assured 2.x it’s enough to add it to the plugins classpath.

buildscript {
-	repositories {
-		mavenCentral()
-	}
-	dependencies {
-	    classpath "org.springframework.boot:spring-boot-gradle-plugin:${springboot_version}"
-		classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${verifier_version}"
-		classpath "com.jayway.restassured:rest-assured:2.5.0"
-		classpath "com.jayway.restassured:spring-mock-mvc:2.5.0"
-	}
-}
-
-depenendencies {
-    // all dependencies
-    // you can exclude rest-assured from spring-cloud-contract-verifier
-    testCompile "com.jayway.restassured:rest-assured:2.5.0"
-    testCompile "com.jayway.restassured:spring-mock-mvc:2.5.0"
-}

That way the plugin will automatically see that Rest Assured 2.x is present on the classpath -and will modify the imports accordingly.

Snapshot versions for Gradle

Add the additional snapshot repository to your build.gradle to use snapshot versions which are automatically uploaded after every successful build:

buildscript {
-	repositories {
-		mavenCentral()
-		mavenLocal()
-		maven { url "https://repo.spring.io/snapshot" }
-		maven { url "https://repo.spring.io/milestone" }
-		maven { url "https://repo.spring.io/release" }
-	}
-}
Add stubs

By default Spring Cloud Contract Verifier is looking for stubs in src/test/resources/contracts directory.

Directory containing stub definitions is treated as a class name, and each stub definition is treated as a single test. -We assume that it contains at least one directory which will be used as test class name. If there is more than one level of nested directories all except the last one will be used as package name. -So with following structure

src/test/resources/contracts/myservice/shouldCreateUser.groovy
-src/test/resources/contracts/myservice/shouldReturnUser.groovy

Spring Cloud Contract Verifier will create test class defaultBasePackage.MyService with two methods

  • shouldCreateUser()
  • shouldReturnUser()

Run plugin

Plugin registers itself to be invoked before check task. You have nothing to do as long as you want it to be part of your build process. If you just want to generate tests please invoke generateContractTests task.

Default setup

Default Gradle Plugin setup creates the following Gradle part of the build (it’s a pseudocode)

contracts {
-    targetFramework = 'JUNIT'
-    testMode = 'MockMvc'
-    generatedTestSourcesDir = project.file("${project.buildDir}/generated-test-sources/contracts")
-    contractsDslDir = "${project.rootDir}/src/test/resources/contracts"
-    basePackageForTests = 'org.springframework.cloud.verifier.tests'
-    stubsOutputDir = project.file("${project.buildDir}/stubs")
-
-    // the following properties are used when you want to provide where the JAR with contract lays
-    contractDependency {
-        stringNotation = ''
-    }
-    contractsPath = ''
-    contractsWorkOffline = false
-    contractRepository {
-        cacheDownloadedContracts(true)
-    }
-}
-
-tasks.create(type: Jar, name: 'verifierStubsJar', dependsOn: 'generateClientStubs') {
-    baseName = project.name
-    classifier = contracts.stubsSuffix
-    from contractVerifier.stubsOutputDir
-}
-
-project.artifacts {
-    archives task
-}
-
-tasks.create(type: Copy, name: 'copyContracts') {
-    from contracts.contractsDslDir
-    into contracts.stubsOutputDir
-}
-
-verifierStubsJar.dependsOn 'copyContracts'
-
-publishing {
-    publications {
-        stubs(MavenPublication) {
-            artifactId project.name
-            artifact verifierStubsJar
-        }
-    }
-}

Configure plugin

To change default configuration just add contracts snippet to your Gradle config

contracts {
-	testMode = 'MockMvc'
-	baseClassForTests = 'org.mycompany.tests'
-	generatedTestSourcesDir = project.file('src/generatedContract')
-}
Configuration options
  • testMode - defines mode for acceptance tests. By default MockMvc which is based on Spring’s MockMvc. It can also be changed to JaxRsClient or to Explicit for real HTTP calls.
  • imports - array with imports that should be included in generated tests (for example ['org.myorg.Matchers']). By default empty array []
  • staticImports - array with static imports that should be included in generated tests(for example ['org.myorg.Matchers.*']). By default empty array []
  • basePackageForTests - specifies base package for all generated tests. If not set the value will be picked from baseClassForTests’s package and from -`packageWithBaseClasses. If neither of these are set then the value will be set to org.springframework.cloud.contract.verifier.tests
  • baseClassForTests - base class for all generated tests. By default spock.lang.Specification if using Spock tests.
  • packageWithBaseClasses - instead of providing a fixed value for base class you can provide a package where all the base classes lay. Takes precedence over baseClassForTests.
  • baseClassMappings - explicitly map contract package to a FQN of a base class. Takes precedence over packageWithBaseClasses and baseClassForTests.
  • ruleClassForTests - specifies Rule which should be added to generated test classes.
  • ignoredFiles - Ant matcher allowing defining stub files for which processing should be skipped. By default empty array []
  • contractsDslDir - directory containing contracts written using the GroovyDSL. By default $rootDir/src/test/resources/contracts
  • generatedTestSourcesDir - test source directory where tests generated from Groovy DSL should be placed. By default $buildDir/generated-test-sources/contractVerifier
  • stubsOutputDir - dir where the generated WireMock stubs from Groovy DSL should be placed
  • targetFramework - the target test framework to be used; currently Spock and JUnit are supported with JUnit being the default framework

The following properties are used when you want to provide where the JAR with contract lays

  • contractDependency - the Dependency that provides groupid:artifactid:version:classifier coordinates. You can use the contractDependency closure to set it up
  • contractsPath - if contract deps are downloaded will default to groupid/artifactid where groupid will be slash separated. Otherwise will scan contracts under provided directory
  • contractsWorkOffline - in order not to download the dependencies each time you can download them once and work offline afterwards (reuse local Maven repo)
Single base class for all tests

When using Spring Cloud Contract Verifier in default MockMvc you need to create a base specification for all generated acceptance tests. In this class you need to point to endpoint which should be verified.

abstract class BaseMockMvcSpec extends Specification {
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new PairIdController())
-	}
-
-	void isProperCorrelationId(Integer correlationId) {
-		assert correlationId == 123456
-	}
-
-	void isEmpty(String value) {
-		assert value == null
-	}
-
-}

In case of using Explicit mode, you can use base class to initialize the whole tested app similarly as in regular integration tests. In case of JAXRSCLIENT mode this base class -should also contain protected WebTarget webTarget field, right now the only option to test JAX-RS API is to start a web server.

Different base classes for contracts

If your base classes differ between contracts you can tell the Spring Cloud Contract plugin which class should get -extended by the autogenerated tests. You have two options:

  • follow a convention by providing the packageWithBaseClasses
  • provide explicit mapping via baseClassMappings

Convention

The convention is such that if you have a contract under e.g. src/test/resources/contract/foo/bar/baz/ and provide the value of the packageWithBaseClasses property -to com.example.base then we will assume that there is a BarBazBase class under com.example.base package. In other words we take last two parts of package -if they exist and form a class with a Base suffix. Takes precedence over baseClassForTests. Example of usage in the contracts closure:

packageWithBaseClasses = 'com.example.base'

Mapping

You can manually map a regular expression of the contract’s package to fully qualified name of the base class for the matched contract. -Let’s take a look at the following example:

baseClassForTests = "com.example.FooBase"
-baseClassMappings {
-	baseClassMapping('.*/com/.*', 'com.example.ComBase')
-	baseClassMapping('.*/bar/.*':'com.example.BarBase')
-}

Let’s assume that you have contracts under - - src/test/resources/contract/com/ - - src/test/resources/contract/foo/

By providing the baseClassForTests we have a fallback in case mapping didn’t succeed (you could also provide -the packageWithBaseClasses as fallback). That way the tests generated from src/test/resources/contract/com/ contracts -will be extending the com.example.ComBase whereas the rest of tests will extend com.example.FooBase.

Invoking generated tests

To ensure that provider side is complaint with defined contracts, you need to invoke:

./gradlew generateContractTests test

Spring Cloud Contract Verifier on consumer side

In consumer service you need to configure Spring Cloud Contract Verifier plugin in exactly the same way as in case of provider. If you don’t want to use Stub Runner then you need to copy contracts stored in -src/test/resources/contracts and generate WireMock json stubs using:

./gradlew generateClientStubs

Note that stubsOutputDir option has to be set for stub generation to work.

When present, json stubs can be used in consumer automated tests.

@ContextConfiguration(loader == SpringApplicationContextLoader, classes == Application)
-class LoanApplicationServiceSpec extends Specification {
-
- @ClassRule
- @Shared
- WireMockClassRule wireMockRule == new WireMockClassRule()
-
- @Autowired
- LoanApplicationService sut
-
- def 'should successfully apply for loan'() {
-   given:
- 	LoanApplication application =
-			new LoanApplication(client: new Client(clientPesel: '12345678901'), amount: 123.123)
-   when:
-	LoanApplicationResult loanApplication == sut.loanApplication(application)
-   then:
-	loanApplication.loanApplicationStatus == LoanApplicationStatus.LOAN_APPLIED
-	loanApplication.rejectionReason == null
- }
-}

Underneath LoanApplication makes a call to FraudDetection service. This request is handled by WireMock server configured using stubs generated by Spring Cloud Contract Verifier.

2.3.2 Using in your Maven project

Add maven plugin

Add the Spring Cloud Contract BOM

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-dependencies.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Next, the Spring Cloud Contract Verifier Maven plugin

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-</plugin>

You can read more in the Spring Cloud Contract Maven Plugin Docs

Maven and Rest Assured 2.0

By default Rest Assured 3.x is added to the classpath. However in order to give the users the -opportunity to use Rest Assured 2.x it’s enough to add it to the plugins classpath.

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <packageWithBaseClasses>com.example</packageWithBaseClasses>
-    </configuration>
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-contract-verifier</artifactId>
-            <version>${spring-cloud-contract.version}</version>
-        </dependency>
-        <dependency>
-           <groupId>com.jayway.restassured</groupId>
-           <artifactId>rest-assured</artifactId>
-           <version>2.5.0</version>
-           <scope>compile</scope>
-        </dependency>
-        <dependency>
-           <groupId>com.jayway.restassured</groupId>
-           <artifactId>spring-mock-mvc</artifactId>
-           <version>2.5.0</version>
-           <scope>compile</scope>
-        </dependency>
-    </dependencies>
-</plugin>
-
-<dependencies>
-    <!-- all dependencies -->
-    <!-- you can exclude rest-assured from spring-cloud-contract-verifier -->
-    <dependency>
-       <groupId>com.jayway.restassured</groupId>
-       <artifactId>rest-assured</artifactId>
-       <version>2.5.0</version>
-       <scope>test</scope>
-    </dependency>
-    <dependency>
-       <groupId>com.jayway.restassured</groupId>
-       <artifactId>spring-mock-mvc</artifactId>
-       <version>2.5.0</version>
-       <scope>test</scope>
-    </dependency>
-</dependencies>

That way the plugin will automatically see that Rest Assured 3.x is present on the classpath -and will modify the imports accordingly.

Snapshot versions for Maven

For Snapshot / Milestone versions you have to add the following section to your pom.xml

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

Add stubs

By default Spring Cloud Contract Verifier is looking for stubs in src/test/resources/contracts directory. -Directory containing stub definitions is treated as a class name, and each stub definition is treated as a single test. -We assume that it contains at least one directory which will be used as test class name. If there is more than one level of nested directories all except the last one will be used as package name. -So with following structure

src/test/resources/contracts/myservice/shouldCreateUser.groovy
-src/test/resources/contracts/myservice/shouldReturnUser.groovy

Spring Cloud Contract Verifier will create test class defaultBasePackage.MyService with two methods - - shouldCreateUser() - - shouldReturnUser()

Run plugin

Plugin goal generateTests is assigned to be invoked in phase generate-test-sources. You have nothing to do as long as you want it to be part of your build process. If you just want to generate tests please invoke generateTests goal.

Configure plugin

To change default configuration just add configuration section to plugin definition or execution definition.

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <executions>
-        <execution>
-            <goals>
-                <goal>convert</goal>
-                <goal>generateStubs</goal>
-                <goal>generateTests</goal>
-            </goals>
-        </execution>
-    </executions>
-    <configuration>
-        <basePackageForTests>org.springframework.cloud.verifier.twitter.place</basePackageForTests>
-        <baseClassForTests>org.springframework.cloud.verifier.twitter.place.BaseMockMvcSpec</baseClassForTests>
-    </configuration>
-</plugin>
Important configuration options
  • testMode - defines mode for acceptance tests. By default MockMvc which is based on Spring’s MockMvc. It can also be changed to JaxRsClient or to Explicit for real HTTP calls.
  • basePackageForTests - specifies base package for all generated tests. If not set the value will be picked from baseClassForTests’s package and from -`packageWithBaseClasses. If neither of these are set then the value will be set to org.springframework.cloud.contract.verifier.tests
  • ruleClassForTests - specifies Rule which should be added to generated test classes.
  • baseClassForTests - base class for generated tests. By default spock.lang.Specification if using Spock tests.
  • contractsDirectory - directory containing contracts written using the GroovyDSL. By default /src/test/resources/contracts.
  • testFramework - the target test framework to be used; currently Spock and JUnit are supported with JUnit being the default framework
  • packageWithBaseClasses - instead of providing a fixed value for base class you can provide a package where all the base classes lay. -The convention is such that if you have a contract under src/test/resources/contract/foo/bar/baz/ and provide the value of this property -to com.example.base then we will assume that there is a BarBazBase class under com.example.base package. Takes precedence -over baseClassForTests
  • baseClassMappings - list of base class mappings that where you have to provide contractPackageRegex which is checked -against the package in which the contract lays and baseClassFQN that maps to fully qualified name of the base class for the matched -contract. If you have a contract under src/test/resources/contract/foo/bar/baz/ and map the property .*com.example.base.BaseClass then -the test class generated from these contracts will extend com.example.base.BaseClass. Takes precedence over packageWithBaseClasses - and baseClassForTests.

If you want to download your contract definitions from a Maven repository you can use

  • contractDependency - the contract dependency that contains all the packaged contracts
  • contractsPath - path to concrete contracts in the JAR with packaged contracts. Defaults to groupid/artifactid where gropuid is slash separated.
  • contractsWorkOffline - if the dependencies should be downloaded or local Maven only should be reused
  • contractsRepositoryUrl - DEPRECATED PROPERTY - please use the contractRepository closure - URL to a repo with the artifacts with contracts, if not provided should use the current Maven ones
  • contractRepository - closure where you can define properties related to repository with contracts

    • username - username to be used to connect to the repo
    • password - username to be used to connect to the repo
    • proxyHost - proxy host to be used to connect to the repo
    • proxyPort - proxy port to be used to connect to the repo
    • cacheDownloadedContracts - if you want to reuse download JARs that contain contract definitions. -We cache only non-snapshot, explicitly provided versions (e.g. + or 1.0.0.BUILD-SNAPSHOT won’t get cached). -By default this feature is turned on.
Single base class for all tests

When using Spring Cloud Contract Verifier in default MockMvc you need to create a base specification for all generated acceptance tests. -In this class you need to point to endpoint which should be verified.

package org.mycompany.tests
-
-import org.mycompany.ExampleSpringController
-import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc
-import spock.lang.Specification
-
-class  MvcSpec extends Specification {
-  def setup() {
-   RestAssuredMockMvc.standaloneSetup(new ExampleSpringController())
-  }
-}

In case of using Explicit mode, you can use base class to initialize the whole tested app similarly as in regular integration tests. In case of JAXRSCLIENT mode this base class should also contain protected WebTarget webTarget field, right now the only option to test JAX-RS API is to start a web server.

Different base classes for contracts

If your base classes differ between contracts you can tell the Spring Cloud Contract plugin which class should get -extended by the autogenerated tests. You have two options:

  • follow a convention by providing the packageWithBaseClasses
  • provide explicit mapping via baseClassMappings

Convention

The convention is such that if you have a contract under e.g. src/test/resources/contract/hello/v1/ and provide the value of the packageWithBaseClasses property -to hello then we will assume that there is a HelloV1Base class under hello package. In other words we take last two parts of package -if they exist and form a class with a Base suffix. Takes precedence over baseClassForTests. Example of usage:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<packageWithBaseClasses>hello</packageWithBaseClasses>
-	</configuration>
-</plugin>

Mapping

You can manually map a regular expression of the contract’s package to fully qualified name of the base class for the matched contract. -You have to provide a list baseClassMappings of baseClassMapping that takes a contractPackageRegex to baseClassFQN mapping. -Let’s take a look at the following example:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<baseClassForTests>com.example.FooBase</baseClassForTests>
-		<baseClassMappings>
-			<baseClassMapping>
-				<contractPackageRegex>.*com.*</contractPackageRegex>
-				<baseClassFQN>com.example.TestBase</baseClassFQN>
-			</baseClassMapping>
-		</baseClassMappings>
-	</configuration>
-</plugin>

Let’s assume that you have contracts under - - src/test/resources/contract/com/ - - src/test/resources/contract/foo/

By providing the baseClassForTests we have a fallback in case mapping didn’t succeed (you could also provide -the packageWithBaseClasses as fallback). That way the tests generated from src/test/resources/contract/com/ contracts -will be extending the com.example.ComBase whereas the rest of tests will extend com.example.FooBase.

Invoking generated tests

Spring Cloud Contract Maven Plugin generates verification code into directory /generated-test-sources/contractVerifier and attach this directory to testCompile goal.

For Groovy Spock code use:

<plugin>
-	<groupId>org.codehaus.gmavenplus</groupId>
-	<artifactId>gmavenplus-plugin</artifactId>
-	<version>1.5</version>
-	<executions>
-		<execution>
-			<goals>
-				<goal>testCompile</goal>
-			</goals>
-		</execution>
-	</executions>
-	<configuration>
-		<testSources>
-			<testSource>
-				<directory>${project.basedir}/src/test/groovy</directory>
-				<includes>
-					<include>**/*.groovy</include>
-				</includes>
-			</testSource>
-			<testSource>
-				<directory>${project.build.directory}/generated-test-sources/contractVerifier</directory>
-				<includes>
-					<include>**/*.groovy</include>
-				</includes>
-			</testSource>
-		</testSources>
-	</configuration>
-</plugin>

To ensure that provider side is complaint with defined contracts, you need to invoke mvn generateTest test

FAQ with Maven Plugin

Maven Plugin and STS

In case you see the following exception while using STS

STS Exception

when you click on the marker you should see sth like this

 plugin:1.1.0.M1:convert:default-convert:process-test-resources) org.apache.maven.plugin.PluginExecutionException: Execution default-convert of goal org.springframework.cloud:spring-
- cloud-contract-maven-plugin:1.1.0.M1:convert failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at
- org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331) at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362) at
-...
- org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: java.lang.NullPointerException at
- org.eclipse.m2e.core.internal.builder.plexusbuildapi.EclipseIncrementalBuildContext.hasDelta(EclipseIncrementalBuildContext.java:53) at
- org.sonatype.plexus.build.incremental.ThreadBuildContext.hasDelta(ThreadBuildContext.java:59) at

In order to fix this issue just provide the following section in your pom.xml

<build>
-    <pluginManagement>
-        <plugins>
-            <!--This plugin's configuration is used to store Eclipse m2e settings
-                only. It has no influence on the Maven build itself. -->
-            <plugin>
-                <groupId>org.eclipse.m2e</groupId>
-                <artifactId>lifecycle-mapping</artifactId>
-                <version>1.0.0</version>
-                <configuration>
-                    <lifecycleMappingMetadata>
-                        <pluginExecutions>
-                             <pluginExecution>
-                                <pluginExecutionFilter>
-                                    <groupId>org.springframework.cloud</groupId>
-                                    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-                                    <versionRange>[1.0,)</versionRange>
-                                    <goals>
-                                        <goal>convert</goal>
-                                    </goals>
-                                </pluginExecutionFilter>
-                                <action>
-                                    <execute />
-                                </action>
-                             </pluginExecution>
-                        </pluginExecutions>
-                    </lifecycleMappingMetadata>
-                </configuration>
-            </plugin>
-        </plugins>
-    </pluginManagement>
-</build>

Spring Cloud Contract Verifier on consumer side

You can actually use the Spring Cloud Contract Verifier also for the consumer side! -You can use the plugin so that it only converts the contracts and generates the stubs. -To achieve that you need to configure Spring Cloud Contract Verifier plugin in exactly -the same way as in case of provider. You need to copy contracts stored in -src/test/resources/contracts and generate WireMock json stubs using: -mvn generateStubs command. By default generated WireMock mapping is -stored in directory target/mappings. Your project should create from -this generated mappings additional artifact with classifier stubs for -easy deploy to maven repository.

Sample configuration:

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${verifier-plugin.version}</version>
-    <executions>
-        <execution>
-            <goals>
-                <goal>convert</goal>
-                <goal>generateStubs</goal>
-            </goals>
-        </execution>
-    </executions>
-</plugin>

When present, json stubs can be used in consumer automated tests.

@RunWith(SpringTestRunner.class)
-@SpringBootTest
-@AutoConfigureStubRunner
-public class LoanApplicationServiceTests {
-
-  @Autowired
-  LoanApplicationService service;
-
-  @Test
-  public void shouldSuccessfullyApplyForLoan() {
-    //given:
- 	LoanApplication application =
-			new LoanApplication(new Client("12345678901"), 123.123);
-    //when:
-	LoanApplicationResult loanApplication = service.loanApplication(application);
-    // then:
-	assertThat(loanApplication.loanApplicationStatus).isEqualTo(LoanApplicationStatus.LOAN_APPLIED);
-	assertThat(loanApplication.rejectionReason).isNull();
-  }
-}

Underneath LoanApplication makes a call to the FraudDetection service. This request is handled by -a WireMock server configured using stubs generated by Spring Cloud Contract Verifier.

2.3.3 Scenarios

It’s possible to handle scenarios with Spring Cloud Contract Verifier. All you need to do is to stick to proper naming convention while creating your contracts. The convention requires to include order number followed by the underscore.

my_contracts_dir\
-  scenario1\
-    1_login.groovy
-    2_showCart.groovy
-    3_logout.groovy

Such tree will cause Spring Cloud Contract Verifier generating WireMock’s scenario with name scenario1 and three steps:

  • login marked as Started pointing to:
  • showCart marked as Step1 pointing to:
  • logout marked as Step2 which will close the scenario.

More details about WireMock scenarios can be found under http://wiremock.org/stateful-behaviour.html

Spring Cloud Contract Verifier will also generate tests with guaranteed order of execution.

2.3.4 Stubs and transitive dependencies

The Maven and Gradle plugin that we’re created are adding the tasks that create the stubs jar for you. What can be problematic -is that when reusing the stubs you can by mistake import all of that stub dependencies! When building a Maven artifact -even though you have a couple of different jars, all of them share one pom:

├── github-webhook-0.0.1.BUILD-20160903.075506-1-stubs.jar
-├── github-webhook-0.0.1.BUILD-20160903.075506-1-stubs.jar.sha1
-├── github-webhook-0.0.1.BUILD-20160903.075655-2-stubs.jar
-├── github-webhook-0.0.1.BUILD-20160903.075655-2-stubs.jar.sha1
-├── github-webhook-0.0.1.BUILD-SNAPSHOT.jar
-├── github-webhook-0.0.1.BUILD-SNAPSHOT.pom
-├── github-webhook-0.0.1.BUILD-SNAPSHOT-stubs.jar
-├── ...
-└── ...

There are three possibilities of working with those dependencies so as not to have any issues with transitive dependencies.

Mark all application dependencies as optional

If in the github-webhook application we would mark all of our dependencies as optional, when you include the -github-webhook stubs in another application (or when that dependency gets downloaded by Stub Runner) then, since -all of the depenencies are optional, they will not get downloaded.

Create a separate artifactid for stubs

If you create a separate artifactid then you can set it up in whatever way you wish. For example by having no dependencies at all.

Exclude dependencies on the consumer side

As a consumer, if you add the stub dependency to your classpath you can explicitly exclude the unwanted dependencies.

2.4 Spring Cloud Contract Verifier Messaging

Spring Cloud Contract Verifier allows you to verify your application that uses messaging as means of communication. -All of our integrations are working with Spring but you can also create one yourself and use it.

2.4.1 Integrations

You can use one of the four integration configurations:

  • Apache Camel
  • Spring Integration
  • Spring Cloud Stream
  • Spring AMQP

Since we’re using Spring Boot then if you have added one of the aforementioned libraries -to the classpath then automatically all the messaging configuration will be set up.

[Important]Important

Remember to put @AutoConfigureMessageVerifier on the base class of your -generated tests. Otherwise messaging part of Spring Cloud Contract Verifier will not work.

[Important]Important

If you want to use Spring Cloud Stream remember to add a -org.springframework.cloud:spring-cloud-stream-test-support dependency.

Maven.  -

<dependency>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-stream-test-support</artifactId>
-    <scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-stream-test-support"

-

2.4.2 Manual Integration Testing

The main interface used by the tests is the org.springframework.cloud.contract.verifier.messaging.MessageVerifier. -It defines how to send and receive messages. You can create your own implementation to achieve the -same goal.

In the a test you can inject a ContractVerifierMessageExchange to send and receive messages that follow the contract. -Then add @AutoConfigureMessageVerifier to your test, e.g.

@RunWith(SpringTestRunner.class)
-@SpringBootTest
-@AutoConfigureMessageVerifier
-public static class MessagingContractTests {
-
-  @Autowired
-  private MessageVerifier verifier;
-  ...
-}
[Note]Note

If your tests require stubs as well, then -@AutoConfigureStubRunner includes the messaging configuration, so -you only need the one annotation.

2.4.3 Publisher side test generation

Having the input or outputMessage sections in your DSL will result in creation of tests on the publisher’s side. By default -JUnit tests will be created, however there is also a possibility to create Spock tests.

There are 3 main scenarios that we should take into consideration:

  • Scenario 1: there is no input message that produces an output one. The output message is triggered by a component -inside the application (e.g. scheduler)
  • Scenario 2: the input message triggers an output message
  • Scenario 3: the input message is consumed and there is no output message
[Important]Important

The destination passed to messageFrom or sentTo can have different meanings for different - messaging implementations. For Stream and Integration it’s first resolved as a destination of a channel, and then if - there is no such destination it’s resolved as a channel name. For Camel that’s a certain component (e.x. jms).

Example for Camel:

Scenario 1 (no input message)

For the given contract:

def contractDsl = Contract.make {
-	label 'some_label'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('activemq:output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-			messagingContentType(applicationJson())
-		}
-	}
-}

The following JUnit test will be created:

'''
- // when:
-  bookReturnedTriggered();
-
- // then:
-  ContractVerifierMessage response = contractVerifierMessaging.receive("activemq:output");
-  assertThat(response).isNotNull();
-  assertThat(response.getHeader("BOOK-NAME")).isNotNull();
-  assertThat(response.getHeader("BOOK-NAME").toString()).isEqualTo("foo");
-  assertThat(response.getHeader("contentType")).isNotNull();
-  assertThat(response.getHeader("contentType").toString()).isEqualTo("application/json");
- // and:
-  DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.getPayload()));
-  assertThatJson(parsedJson).field("bookName").isEqualTo("foo");
-'''

And the following Spock test would be created:

'''
- when:
-  bookReturnedTriggered()
-
- then:
-  ContractVerifierMessage response = contractVerifierMessaging.receive('activemq:output')
-  assert response != null
-  response.getHeader('BOOK-NAME')?.toString()  == 'foo'
-  response.getHeader('contentType')?.toString()  == 'application/json'
- and:
-  DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.payload))
-  assertThatJson(parsedJson).field("bookName").isEqualTo("foo")
-
-'''

Scenario 2 (output triggered by input)

For the given contract:

def contractDsl = Contract.make {
-	label 'some_label'
-	input {
-		messageFrom('jms:input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('jms:output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

The following JUnit test will be created:

'''
-// given:
- ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-  "{\\"bookName\\":\\"foo\\"}"
-, headers()
-  .header("sample", "header"));
-
-// when:
- contractVerifierMessaging.send(inputMessage, "jms:input");
-
-// then:
- ContractVerifierMessage response = contractVerifierMessaging.receive("jms:output");
- assertThat(response).isNotNull();
- assertThat(response.getHeader("BOOK-NAME")).isNotNull();
- assertThat(response.getHeader("BOOK-NAME").toString()).isEqualTo("foo");
-// and:
- DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.getPayload()));
- assertThatJson(parsedJson).field("bookName").isEqualTo("foo");
-'''

And the following Spock test would be created:

"""\
-given:
-   ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-    '''{"bookName":"foo"}''',
-    ['sample': 'header']
-  )
-
-when:
-   contractVerifierMessaging.send(inputMessage, 'jms:input')
-
-then:
-   ContractVerifierMessage response = contractVerifierMessaging.receive('jms:output')
-   assert response !- null
-   response.getHeader('BOOK-NAME')?.toString()  == 'foo'
-and:
-   DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.payload))
-   assertThatJson(parsedJson).field("bookName").isEqualTo("foo")
-"""

Scenario 3 (no output message)

For the given contract:

def contractDsl = Contract.make {
-	label 'some_label'
-	input {
-		messageFrom('jms:delete')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-		assertThat('bookWasDeleted()')
-	}
-}

The following JUnit test will be created:

'''
-// given:
- ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-	"{\\"bookName\\":\\"foo\\"}"
-, headers()
-	.header("sample", "header"));
-
-// when:
- contractVerifierMessaging.send(inputMessage, "jms:delete");
-
-// then:
- bookWasDeleted();
-'''

And the following Spock test would be created:

'''
-given:
-	 ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-		\'\'\'{"bookName":"foo"}\'\'\',
-		['sample': 'header']
-	)
-
-when:
-	 contractVerifierMessaging.send(inputMessage, 'jms:delete')
-
-then:
-	 noExceptionThrown()
-	 bookWasDeleted()
-'''

2.4.4 Consumer Stub Side generation

Unlike the HTTP part - in Messaging we need to publish the Groovy DSL inside the JAR with a stub. Then it’s parsed on the consumer side -and proper stubbed routes are created.

For more information please consult the Stub Runner Messaging sections.

Maven.  -

<dependencies>
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
-	</dependency>
-
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-		<scope>test</scope>
-	</dependency>
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-stream-test-support</artifactId>
-		<scope>test</scope>
-	</dependency>
-</dependencies>
-
-<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>Edgware.BUILD-SNAPSHOT</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

-

Gradle.  -

ext {
-	contractsDir = file("mappings")
-	stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
-}
-
-// Automatically added by plugin:
-// copyContracts - copies contracts to the output folder from which JAR will be created
-// verifierStubsJar - JAR with a provided stub suffix
-// the presented publication is also added by the plugin but you can modify it as you wish
-
-publishing {
-	publications {
-		stubs(MavenPublication) {
-			artifactId "${project.name}-stubs"
-			artifact verifierStubsJar
-		}
-	}
-}

-

2.5 Spring Cloud Contract Stub Runner

One of the issues that you could have encountered while using Spring Cloud Contract Verifier was to pass the generated WireMock JSON stubs from the server side to the client side (or various clients). - The same takes place in terms of client side generation for messaging.

Copying the JSON files / setting the client side for messaging manually is out of the question.

That’s why we’ll introduce Spring Cloud Contract Stub Runner that can download and run the stubs -automatically for you.

2.5.1 Snapshot versions

Add the additional snapshot repository to your build.gradle to use snapshot versions which are automatically uploaded after every successful build:

Maven.  -

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

-

Gradle.  -

buildscript {
-	repositories {
-		mavenCentral()
-		mavenLocal()
-		maven { url "https://repo.spring.io/snapshot" }
-		maven { url "https://repo.spring.io/milestone" }
-		maven { url "https://repo.spring.io/release" }
-	}

-

2.5.2 Publishing stubs as JARs

The easiest approach would be to centralize the way stubs are kept. For example you can keep them as JARs in a Maven repository.

[Tip]Tip

For both Maven and Gradle the setup comes out of the box. But you can customize it if you want to.

Maven.  -

<!-- 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>
-
-<!-- Next add the assembly plugin to your build -->
-<!-- we want the assembly plugin to generate the JAR -->
-<plugin>
-	<groupId>org.apache.maven.plugins</groupId>
-	<artifactId>maven-assembly-plugin</artifactId>
-	<executions>
-		<execution>
-			<id>stub</id>
-			<phase>prepare-package</phase>
-			<goals>
-				<goal>single</goal>
-			</goals>
-			<inherited>false</inherited>
-			<configuration>
-				<attach>true</attach>
-				<descriptor>${basedir}/src/assembly/stub.xml</descriptor>
-			</configuration>
-		</execution>
-	</executions>
-</plugin>
-
-<!-- Finally setup your assembly. Below you can find the contents of src/main/assembly/stub.xml -->
-<assembly
-	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>stubs</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>src/main/java</directory>
-			<outputDirectory>/</outputDirectory>
-			<includes>
-				<include>**com/example/model/*.*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${project.build.directory}/classes</directory>
-			<outputDirectory>/</outputDirectory>
-			<includes>
-				<include>**com/example/model/*.*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${project.build.directory}/snippets/stubs</directory>
-			<outputDirectory>META-INF/${project.groupId}/${project.artifactId}/${project.version}/mappings</outputDirectory>
-			<includes>
-				<include>**/*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${basedir}/src/test/resources/contracts</directory>
-			<outputDirectory>META-INF/${project.groupId}/${project.artifactId}/${project.version}/contracts</outputDirectory>
-			<includes>
-				<include>**/*.groovy</include>
-			</includes>
-		</fileSet>
-	</fileSets>
-</assembly>

-

Gradle.  -

ext {
-	contractsDir = file("mappings")
-	stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
-}
-
-// Automatically added by plugin:
-// copyContracts - copies contracts to the output folder from which JAR will be created
-// verifierStubsJar - JAR with a provided stub suffix
-// the presented publication is also added by the plugin but you can modify it as you wish
-
-publishing {
-	publications {
-		stubs(MavenPublication) {
-			artifactId "${project.name}-stubs"
-			artifact verifierStubsJar
-		}
-	}
-}

-

2.6 Stub Runner Core

Runs stubs for service collaborators. Treating stubs as contracts of services allows to use stub-runner as an implementation of -Consumer Driven Contracts.

Stub Runner allows you to automatically download the stubs of the provided dependencies (or pick those from the classpath), start WireMock servers for them and feed them with proper stub definitions. -For messaging, special stub routes are defined.

2.6.1 Retrieving stubs

You can pick the following options of acquiring stubs

  • Aether based solution that downloads JARs with stubs from Artifactory / Nexus
  • Classpath scanning solution that searches classpath via pattern to retrieve stubs
  • Write your own implementation of the org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder for full customization

The latter example is described in the Custom Stub Runner section.

Stub downloading

If you provide the stubrunner.repositoryRoot or stubrunner.workOffline flag will be set -to true then Stub Runner will connect to the given server and download the required jars. -It will then unpack the JAR to a temporary folder and reference those files in further -contract processing.

Example:

@AutoConfigureStubRunner(repositoryRoot="https://foo.bar", ids = "com.example:beer-api-producer:+:stubs:8095")

Classpath scanning

If you DON’T provide the stubrunner.repositoryRoot and stubrunner.workOffline flag will -be set to false (that’s the default) then classpath will get scanned. Let’s look at the -following example:

@AutoConfigureStubRunner(ids = {
-    "com.example:beer-api-producer:+:stubs:8095",
-    "com.example.foo:bar:1.0.0:superstubs:8096"
-})

If you’ve added the dependencies to your classpath

Maven.  -

<dependency>
-    <groupId>com.example</groupId>
-    <artifactId>beer-api-producer-restdocs</artifactId>
-    <classifier>stubs</classifier>
-    <version>0.0.1-SNAPSHOT</version>
-    <scope>test</scope>
-    <exclusions>
-        <exclusion>
-            <groupId>*</groupId>
-            <artifactId>*</artifactId>
-        </exclusion>
-    </exclusions>
-</dependency>
-<dependency>
-    <groupId>com.example.foo</groupId>
-    <artifactId>bar</artifactId>
-    <classifier>superstubs</classifier>
-    <version>1.0.0</version>
-    <scope>test</scope>
-    <exclusions>
-        <exclusion>
-            <groupId>*</groupId>
-            <artifactId>*</artifactId>
-        </exclusion>
-    </exclusions>
-</dependency>

-

Gradle.  -

testCompile("com.example:beer-api-producer-restdocs:0.0.1-SNAPSHOT:stubs") {
-    transitive = false
-}
-testCompile("com.example.foo:bar:1.0.0:superstubs") {
-    transitive = false
-}

-

Then the following locations on your classpath will get scanned. For com.example:beer-api-producer-restdocs

  • /META-INF/com.example/beer-api-producer-restdocs/*/.*
  • /contracts/com.example/beer-api-producer-restdocs/*/.*
  • /mappings/com.example/beer-api-producer-restdocs/*/.*

and com.example.foo:bar

  • /META-INF/com.example.foo/bar/*/.*
  • /contracts/com.example.foo/bar/*/.*
  • /mappings/com.example.foo/bar/*/.*
[Tip]Tip

As you can see you have to explicitly provide the group and artifact ids when packaging the -producer stubs.

The producer would setup the contracts like this:

└── src
-    └── test
-        └── resources
-            └── contracts
-                └── com.example
-                    └── beer-api-producer-restdocs
-                        └── nested
-                            └── contract3.groovy

To achieve proper stub packaging.

Or using the Maven assembly plugin or -Gradle Jar task you have to create the following -structure in your stubs jar.

└── META-INF
-    └── com.example
-        └── beer-api-producer-restdocs
-            └── 2.0.0
-                ├── contracts
-                │   └── nested
-                │       └── contract2.groovy
-                └── mappings
-                    └── mapping.json

By maintaining this structure classpath gets scanned and you can profit from the messaging / -HTTP stubs without the need to download artifacts.

2.6.2 Running stubs

Limitations

[Important]Important

There might be a problem with StubRunner shutting down ports between tests. You might - have a situation in which you get port conflicts. As long as you use the same context across tests - everything works fine. But when the context are different (e.g. different stubs or different profiles) - then you have to either use @DirtiesContext to shut down the stub servers, or else run them on - different ports per test.

Running using main app

You can set the following options to the main class:

-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'
-                                  (default: stubs)
---maxPort, --maxp <Integer>     Maximum port value to be assigned to
-                                  the WireMock instance. Defaults to
-                                  15000 (default: 15000)
---minPort, --minp <Integer>     Minimum port value to be assigned to
-                                  the WireMock instance. Defaults to
-                                  10000 (default: 10000)
--p, --password                  Password to user when connecting to
-                                  repository
---phost, --proxyHost            Proxy host to use for repository
-                                  requests
---pport, --proxyPort [Integer]  Proxy port to use for repository
-                                  requests
--r, --root                      Location of a Jar containing server
-                                  where you keep your stubs (e.g. http:
-                                  //nexus.
-                                  net/content/repositories/repository)
--s, --stubs                     Comma separated list of Ivy
-                                  representation of jars with stubs.
-                                  Eg. groupid:artifactid1,groupid2:
-                                  artifactid2:classifier
--u, --username                  Username to user when connecting to
-                                  repository
---wo, --workOffline             Switch to work offline. Defaults to
-                                  'false'

HTTP Stubs

Stubs are defined in JSON documents, whose syntax is defined in WireMock documentation

Example:

{
-    "request": {
-        "method": "GET",
-        "url": "/ping"
-    },
-    "response": {
-        "status": 200,
-        "body": "pong",
-        "headers": {
-            "Content-Type": "text/plain"
-        }
-    }
-}

Viewing registered mappings

Every stubbed collaborator exposes list of defined mappings under __/admin/ endpoint.

You can also use the mappingsOutputFolder property to dump the mappings to files. - For annotation based approach it would look like this

@AutoConfigureStubRunner(ids="a.b.c:loanIssuance,a.b.c:fraudDetectionServer",
-mappingsOutputFolder = "target/outputmappings/")

and for the JUnit approach like this:

@ClassRule @Shared StubRunnerRule rule = new StubRunnerRule()
-			.repoRoot("http://some_url")
-			.downloadStub("a.b.c", "loanIssuance")
-			.downloadStub("a.b.c:fraudDetectionServer")
-			.withMappingsOutputFolder("target/outputmappings")

Then if you check out the folder target/outputmappings you would see the following structure

.
-├── fraudDetectionServer_13705
-└── loanIssuance_12255

That means that there were two stubs registered. fraudDetectionServer was registered at port 13705 -and loanIssuance at port 12255. If we take a look at one of the files we would see (for WireMock) -mappings available for the given server:

[{
-  "id" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7",
-  "request" : {
-    "url" : "/name",
-    "method" : "GET"
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "fraudDetectionServer"
-  },
-  "uuid" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7"
-},
-...
-]

Messaging Stubs

Depending on the provided Stub Runner dependency and the DSL the messaging routes are automatically set up.

2.7 Stub Runner JUnit Rule

Stub Runner comes with a JUnit rule thanks to which you can very easily download and run stubs for given group and artifact id:

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

After that rule gets executed Stub Runner connects to your Maven repository and for the given list of dependencies tries to:

  • download them
  • cache them locally
  • unzip them to a temporary folder
  • start a WireMock server for each Maven dependency on a random port from the provided range of ports / provided port
  • feed the WireMock server with all JSON files that are valid WireMock definitions
  • can also send messages (remember to pass an implementation of MessageVerifier interface)

Stub Runner uses Eclipse Aether mechanism to download the Maven dependencies. -Check their docs for more information.

Since the StubRunnerRule implements the StubFinder it allows you to find the started stubs:

package org.springframework.cloud.contract.stubrunner;
-
-import java.net.URL;
-import java.util.Collection;
-import java.util.Map;
-
-import org.springframework.cloud.contract.spec.Contract;
-
-public interface StubFinder extends StubTrigger {
-	/**
-	 * For the given groupId and artifactId tries to find the matching
-	 * URL of the running stub.
-	 *
-	 * @param groupId - might be null. In that case a search only via artifactId takes place
-	 * @return URL of a running stub or throws exception if not found
-	 */
-	URL findStubUrl(String groupId, String artifactId) throws StubNotFoundException;
-
-	/**
-	 * For the given Ivy notation {@code [groupId]:artifactId:[version]:[classifier]} tries to
-	 * find the matching URL of the running stub. You can also pass only {@code artifactId}.
-	 *
-	 * @param ivyNotation - Ivy representation of the Maven artifact
-	 * @return URL of a running stub or throws exception if not found
-	 */
-	URL findStubUrl(String ivyNotation) throws StubNotFoundException;
-
-	/**
-	 * Returns all running stubs
-	 */
-	RunningStubs findAllRunningStubs();
-
-	/**
-	 * Returns the list of Contracts
-	 */
-	Map<StubConfiguration, Collection<Contract>> getContracts();
-}

Example of usage in Spock tests:

@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")
-		.withMappingsOutputFolder("target/outputmappingsforrule")
-
-
-def 'should start WireMock servers'() {
-	expect: 'WireMocks are running'
-		rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance') != null
-		rule.findStubUrl('loanIssuance') != null
-		rule.findStubUrl('loanIssuance') == rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance')
-		rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer') != null
-	and:
-		rule.findAllRunningStubs().isPresent('loanIssuance')
-		rule.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs', 'fraudDetectionServer')
-		rule.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer')
-	and: 'Stubs were registered'
-		"${rule.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
-		"${rule.findStubUrl('fraudDetectionServer').toString()}/name".toURL().text == 'fraudDetectionServer'
-}
-
-def 'should output mappings to output folder'() {
-	when:
-		def url = rule.findStubUrl('fraudDetectionServer')
-	then:
-		new File("target/outputmappingsforrule", "fraudDetectionServer_${url.port}").exists()
-}

Example of usage in JUnit tests:

@Test
-public void should_start_wiremock_servers() throws Exception {
-	// expect: 'WireMocks are running'
-		then(rule.findStubUrl("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")).isNotNull();
-		then(rule.findStubUrl("loanIssuance")).isNotNull();
-		then(rule.findStubUrl("loanIssuance")).isEqualTo(rule.findStubUrl("org.springframework.cloud.contract.verifier.stubs", "loanIssuance"));
-		then(rule.findStubUrl("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")).isNotNull();
-	// and:
-		then(rule.findAllRunningStubs().isPresent("loanIssuance")).isTrue();
-		then(rule.findAllRunningStubs().isPresent("org.springframework.cloud.contract.verifier.stubs", "fraudDetectionServer")).isTrue();
-		then(rule.findAllRunningStubs().isPresent("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")).isTrue();
-	// and: 'Stubs were registered'
-		then(httpGet(rule.findStubUrl("loanIssuance").toString() + "/name")).isEqualTo("loanIssuance");
-		then(httpGet(rule.findStubUrl("fraudDetectionServer").toString() + "/name")).isEqualTo("fraudDetectionServer");
-}

Check the Common properties for JUnit and Spring for more information on how to apply global configuration of Stub Runner.

[Important]Important

To use the JUnit rule together with messaging you have to provide an implementation of the -MessageVerifier interface to the rule builder (e.g. rule.messageVerifier(new MyMessageVerifier())). -If you don’t do this then whenever you try to send a message an exception will be thrown.

2.7.1 Maven settings

The stub downloader honors Maven settings for a different local repository folder. -Authentication details for repositories and profiles are currently not taken into account, so you need to specify it using the properties mentioned above.

2.7.2 Providing fixed ports

You can also run your stubs on fixed ports. You can do it in two different ways. One is to pass it in the properties, and the other via fluent API of -JUnit rule.

2.7.3 Fluent API

When using the StubRunnerRule you can add a stub to download and then pass the port for the last downloaded stub.

@ClassRule public static StubRunnerRule rule = new StubRunnerRule()
-		.repoRoot(repoRoot())
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")
-		.withPort(12345)
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer:12346");

You can see that for this example the following test is valid:

then(rule.findStubUrl("loanIssuance")).isEqualTo(URI.create("http://localhost:12345").toURL());
-then(rule.findStubUrl("fraudDetectionServer")).isEqualTo(URI.create("http://localhost:12346").toURL());

2.7.4 Stub Runner with Spring

Sets up Spring configuration of the Stub Runner project.

By providing a list of stubs inside your configuration file the Stub Runner automatically downloads -and registers in WireMock the selected stubs.

If you want to find the URL of your stubbed dependency you can autowire the StubFinder interface and use -its methods as presented below:

@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
-@SpringBootTest(properties = [" stubrunner.cloud.enabled=false",
-		"stubrunner.camel.enabled=false",
-		'foo=${stubrunner.runningstubs.fraudDetectionServer.port}'])
-@AutoConfigureStubRunner(mappingsOutputFolder = "target/outputmappings/")
-@DirtiesContext
-@ActiveProfiles("test")
-class StubRunnerConfigurationSpec extends Specification {
-
-	@Autowired StubFinder stubFinder
-	@Autowired Environment environment
-	@Value('${foo}') Integer foo
-
-	@BeforeClass
-	@AfterClass
-	void setupProps() {
-		System.clearProperty("stubrunner.repository.root")
-		System.clearProperty("stubrunner.classifier")
-	}
-
-	def 'should start WireMock servers'() {
-		expect: 'WireMocks are running'
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance') != null
-			stubFinder.findStubUrl('loanIssuance') != null
-			stubFinder.findStubUrl('loanIssuance') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance')
-			stubFinder.findStubUrl('loanIssuance') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance')
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT:stubs')
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer') != null
-		and:
-			stubFinder.findAllRunningStubs().isPresent('loanIssuance')
-			stubFinder.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs', 'fraudDetectionServer')
-			stubFinder.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer')
-		and: 'Stubs were registered'
-			"${stubFinder.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
-			"${stubFinder.findStubUrl('fraudDetectionServer').toString()}/name".toURL().text == 'fraudDetectionServer'
-	}
-
-	def 'should throw an exception when stub is not found'() {
-		when:
-			stubFinder.findStubUrl('nonExistingService')
-		then:
-			thrown(StubNotFoundException)
-		when:
-			stubFinder.findStubUrl('nonExistingGroupId', 'nonExistingArtifactId')
-		then:
-			thrown(StubNotFoundException)
-	}
-
-	def 'should register started servers as environment variables'() {
-		expect:
-			environment.getProperty("stubrunner.runningstubs.loanIssuance.port") != null
-			stubFinder.findAllRunningStubs().getPort("loanIssuance") == (environment.getProperty("stubrunner.runningstubs.loanIssuance.port") as Integer)
-		and:
-			environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") != null
-			stubFinder.findAllRunningStubs().getPort("fraudDetectionServer") == (environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") as Integer)
-	}
-
-	def 'should be able to interpolate a running stub in the passed test property'() {
-		given:
-			int fraudPort = stubFinder.findAllRunningStubs().getPort("fraudDetectionServer")
-		expect:
-			fraudPort > 0
-			environment.getProperty("foo", Integer) == fraudPort
-			foo == fraudPort
-	}
-
-	def 'should dump all mappings to a file'() {
-		when:
-			def url = stubFinder.findStubUrl("fraudDetectionServer")
-		then:
-			new File("target/outputmappings/", "fraudDetectionServer_${url.port}").exists()
-	}
-
-	@Configuration
-	@EnableAutoConfiguration
-	static class Config {}
-}

for the following configuration file:

stubrunner:
-  repositoryRoot: classpath:m2repo/repository/
-  ids:
-    - org.springframework.cloud.contract.verifier.stubs:loanIssuance
-    - org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer
-    - org.springframework.cloud.contract.verifier.stubs:bootService
-  cloud:
-    enabled: false
-  camel:
-    enabled: false
-
-spring.cloud:
-  consul.enabled: false
-  service-registry.enabled: false

Instead of using the properties you can also use the properties inside the @AutoConfigureStubRunner. -Below you can find an example of achieving the same result by setting values on the annotation.

@AutoConfigureStubRunner(
-		ids = ["org.springframework.cloud.contract.verifier.stubs:loanIssuance",
-		"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer",
-		"org.springframework.cloud.contract.verifier.stubs:bootService"],
-		repositoryRoot = "classpath:m2repo/repository/")

Stub Runner Spring registers environment variables in the following manner -for every registered WireMock server. Example for Stub Runner ids - com.example:foo, com.example:bar.

  • stubrunner.runningstubs.foo.port
  • stubrunner.runningstubs.bar.port

Which you can reference in your code.

2.8 Stub Runner Spring Cloud

Stub Runner can integrate with Spring Cloud.

For real life examples you can check the

2.8.1 Stubbing Service Discovery

The most important feature of Stub Runner Spring Cloud is the fact that it’s stubbing

  • DiscoveryClient
  • Ribbon ServerList

that means that regardless of the fact whether you’re using Zookeeper, Consul, Eureka or anything else, you don’t need that in your tests. -We’re starting WireMock instances of your dependencies and we’re telling your application whenever you’re using Feign, load balanced RestTemplate -or DiscoveryClient directly, to call those stubbed servers instead of calling the real Service Discovery tool.

For example this test will pass

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'
-	and: 'Stubs can be reached via load service discovery'
-		restTemplate.getForObject('http://loanIssuance/name', String) == 'loanIssuance'
-		restTemplate.getForObject('http://someNameThatShouldMapFraudDetectionServer/name', String) == 'fraudDetectionServer'
-}

for the following configuration file

spring.cloud:
-  zookeeper.enabled: false
-  consul.enabled: false
-eureka.client.enabled: false
-stubrunner:
-  camel.enabled: false
-  idsToServiceIds:
-    ivyNotation: someValueInsideYourCode
-    fraudDetectionServer: someNameThatShouldMapFraudDetectionServer

Test profiles and service discovery

In your integration tests you typically don’t want to call neither a discovery service (e.g. Eureka) -or Config Server. That’s why you create an additional test configuration in which you want to disable -these features.

Due to certain limitations of spring-cloud-commons to achieve this you have disable these properties -via a static block like presented below (example for Eureka)

    //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");
-    }

2.8.2 Additional Configuration

You can match the artifactId of the stub with the name of your app by using the stubrunner.idsToServiceIds: map. -You can disable Stub Runner Ribbon support by providing: stubrunner.cloud.ribbon.enabled equal to false -You can disable Stub Runner support by providing: stubrunner.cloud.enabled equal to false

[Tip]Tip

By default all service discovery will be stubbed. That means that regardless of the fact if you have -an existing DiscoveryClient its results will be ignored. However, if you want to reuse it, just set - stubrunner.cloud.delegate.enabled to true and then your existing DiscoveryClient results will be - merged with the stubbed ones.

2.9 Stub Runner Boot Application

Spring Cloud Contract Stub Runner Boot is a Spring Boot application that exposes REST endpoints to -trigger the messaging labels and to access started WireMock servers.

One of the use-cases is to run some smoke (end to end) tests on a deployed application. -You can check out the Spring Cloud Pipelines -project for more information.

2.9.1 How to use it?

Stub Runner Server

Just add the

compile "org.springframework.cloud:spring-cloud-starter-stub-runner"

Annotate a class with @EnableStubRunnerServer, build a fat-jar and you’re ready to go!

For the properties check the Stub Runner Spring section.

Spring Cloud CLI

Starting from 1.4.0.RELEASE version of the Spring Cloud CLI -project you can start Stub Runner Boot by executing spring cloud stubrunner.

In order to pass the configuration just create a stubrunner.yml file in the current working directory -or a subdirectory called config or in ~/.spring-cloud. The file could look like this -(example for running stubs installed locally)

stubrunner.yml.  -

stubrunner:
-  workOffline: true
-  ids:
-    - com.example:beer-api-producer:+:9876

-

and then just call spring cloud stubrunner from your terminal window to start -the Stub Runner server. It will be available at port 8750.

2.9.2 Endpoints

HTTP

  • GET /stubs - returns a list of all running stubs in ivy:integer notation
  • GET /stubs/{ivy} - returns a port for the given ivy notation (when calling the endpoint ivy can also be artifactId only)

Messaging

For Messaging

  • GET /triggers - returns a list of all running labels in ivy : [ label1, label2 …​] notation
  • POST /triggers/{label} - executes a trigger with label
  • POST /triggers/{ivy}/{label} - executes a trigger with label for the given ivy notation (when calling the endpoint ivy can also be artifactId only)

2.9.3 Example

@ContextConfiguration(classes = StubRunnerBoot, loader = SpringBootContextLoader)
-@SpringBootTest(properties = "spring.cloud.zookeeper.enabled=false")
-@ActiveProfiles("test")
-class StubRunnerBootSpec extends Specification {
-
-	@Autowired StubRunning stubRunning
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning),
-				new TriggerController(stubRunning))
-	}
-
-	def 'should return a list of running stub servers in "full ivy:port" notation'() {
-		when:
-			String response = RestAssuredMockMvc.get('/stubs').body.asString()
-		then:
-			def root = new JsonSlurper().parseText(response)
-			root.'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs' instanceof Integer
-	}
-
-	def 'should return a port on which a [#stubId] stub is running'() {
-		when:
-			def response = RestAssuredMockMvc.get("/stubs/${stubId}")
-		then:
-			response.statusCode == 200
-			response.body.as(Integer) > 0
-		where:
-			stubId << ['org.springframework.cloud.contract.verifier.stubs:bootService:+:stubs',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService:+',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService',
-					   'bootService']
-	}
-
-	def 'should return 404 when missing stub was called'() {
-		when:
-			def response = RestAssuredMockMvc.get("/stubs/a:b:c:d")
-		then:
-			response.statusCode == 404
-	}
-
-	def 'should return a list of messaging labels that can be triggered when version and classifier are passed'() {
-		when:
-			String response = RestAssuredMockMvc.get('/triggers').body.asString()
-		then:
-			def root = new JsonSlurper().parseText(response)
-			root.'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs'?.containsAll(["delete_book","return_book_1","return_book_2"])
-	}
-
-	def 'should trigger a messaging label'() {
-		given:
-			StubRunning stubRunning = Mock()
-			RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning), new TriggerController(stubRunning))
-		when:
-			def response = RestAssuredMockMvc.post("/triggers/delete_book")
-		then:
-			response.statusCode == 200
-		and:
-			1 * stubRunning.trigger('delete_book')
-	}
-
-	def 'should trigger a messaging label for a stub with [#stubId] ivy notation'() {
-		given:
-			StubRunning stubRunning = Mock()
-			RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning), new TriggerController(stubRunning))
-		when:
-			def response = RestAssuredMockMvc.post("/triggers/$stubId/delete_book")
-		then:
-			response.statusCode == 200
-		and:
-			1 * stubRunning.trigger(stubId, 'delete_book')
-		where:
-			stubId << ['org.springframework.cloud.contract.verifier.stubs:bootService:stubs', 'org.springframework.cloud.contract.verifier.stubs:bootService', 'bootService']
-	}
-
-	def 'should throw exception when trigger is missing'() {
-		when:
-			RestAssuredMockMvc.post("/triggers/missing_label")
-		then:
-			Exception e = thrown(Exception)
-			e.message.contains("Exception occurred while trying to return [missing_label] label.")
-			e.message.contains("Available labels are")
-			e.message.contains("org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT:stubs=[]")
-			e.message.contains("org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs=")
-	}
-
-}

2.9.4 Stub Runner Boot with Service Discovery

One of the possibilities of using Stub Runner Boot is to use it as a feed of stubs for "smoke-tests". What does it mean? - Let’s assume that you don’t want to deploy 50 microservice to a test environment in order - to check if your application is working fine. You’ve already executed a suite of tests during the build process - but you would also like to ensure that the packaging of your application is fine. What you can do - is to deploy your application to an environment, start it and run a couple of tests on it to see if - it’s working fine. We can call those tests smoke-tests since their idea is to check only a handful - of testing scenarios.

The problem with this approach is such that if you’re doing microservices most likely you’re - using a service discovery tool. Stub Runner Boot allows you to solve this issue by starting the - required stubs and register them in a service discovery tool. Let’s take a look at an example of - such a setup with Eureka. Let’s assume that Eureka was already running.

@SpringBootApplication
-@EnableStubRunnerServer
-@EnableEurekaClient
-@AutoConfigureStubRunner
-public class StubRunnerBootEurekaExample {
-
-	public static void main(String[] args) {
-		SpringApplication.run(StubRunnerBootEurekaExample.class, args);
-	}
-
-}

As you can see we want to start a Stub Runner Boot server @EnableStubRunnerServer, enable Eureka client @EnableEurekaClient -and we want to have the stub runner feature turned on @AutoConfigureStubRunner.

Now let’s assume that we want to start this application so that the stubs get automatically registered. - We can do it by running the app java -jar ${SYSTEM_PROPS} stub-runner-boot-eureka-example.jar where - ${SYSTEM_PROPS} would contain the following list of properties

-Dstubrunner.repositoryRoot=https://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)
-
-(1) - we tell Stub Runner where all the stubs reside
-(2) - we don't want the default behaviour where the discovery service is stubbed. That's why the stub registration will be picked
-(3) - we provide a list of stubs to download
-(4) - we provide a list of artifactId to serviceId mapping

That way your deployed application can send requests to started WireMock servers via the service -discovery. Most likely points 1-3 could be set by default in application.yml cause they are not -likely to change. That way you can provide only the list of stubs to download whenever you start -the Stub Runner Boot.

2.10 Stubs Per Consumer

There are cases in which 2 consumers of the same endpoint want to have 2 different responses.

[Tip]Tip

This approach also allows you to immediately know which consumer is using which part of your API. -You can remove part of a response that your API produces and you can see which of your autogenerated tests -fails. If none fails then you can safely delete that part of the response cause nobody is using it.

Let’s look at the following example for contract defined for the producer called producer. -There are 2 consumers: foo-consumer and bar-consumer.

Consumer foo-service

request {
-   url '/foo'
-   method GET()
-}
-response {
-    status 200
-    body(
-       foo: "foo"
-    }
-}

Consumer bar-service

request {
-   url '/foo'
-   method GET()
-}
-response {
-    status 200
-    body(
-       bar: "bar"
-    }
-}

You can’t produce for the same request 2 different responses. That’s why you can properly package the -contracts and then profit from the stubsPerConsumer feature.

On the producer side the consumers can have a folder that contains contracts related only to them. -By setting the stubrunner.stubs-per-consumer flag to true we no longer register all stubs but only those that -correspond to the consumer application’s name. In other words we’ll scan the path of every stub and -if it contains the subfolder with name of the consumer in the path only then will it get registered.

On the foo producer side the contracts would look like this

.
-└── contracts
-    ├── bar-consumer
-    │   ├── bookReturnedForBar.groovy
-    │   └── shouldCallBar.groovy
-    └── foo-consumer
-        ├── bookReturnedForFoo.groovy
-        └── shouldCallFoo.groovy

Being the bar-consumer consumer you can either set the spring.application.name or the stubrunner.consumer-name to bar-consumer -Or set the test as follows:

@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/",
-		stubsPerConsumer = true)
-@DirtiesContext
-class StubRunnerStubsPerConsumerSpec extends Specification {
-...
-}

Then only the stubs registered under a path that contains the bar-consumer in its name (i.e. those from the -src/test/resources/contracts/bar-consumer/some/contracts/…​ folder) will be allowed to be referenced.

Or set the consumer name explicitly

@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
-@SpringBootTest
-@AutoConfigureStubRunner(ids = "org.springframework.cloud.contract.verifier.stubs:producerWithMultipleConsumers",
-		repositoryRoot = "classpath:m2repo/repository/",
-		consumerName = "foo-consumer",
-		stubsPerConsumer = true)
-@DirtiesContext
-class StubRunnerStubsPerConsumerWithConsumerNameSpec extends Specification {
-...
-}

Then only the stubs registered under a path that contains the foo-consumer in its name (i.e. those from the -src/test/resources/contracts/foo-consumer/some/contracts/…​ folder) will be allowed to be referenced.

You can check out issue 224 for more -information about the reasons behind this change.

2.11 Common

2.11.1 Common properties for JUnit and Spring

Some of the properties that are repetitive can be set using system properties or configuration properties (for Spring). Here are their names with their default values:

Property nameDefault valueDescription

stubrunner.minPort

10000

Minimal value of a port for a started WireMock with stubs

stubrunner.maxPort

15000

Minimal value of a port for a started WireMock with stubs

stubrunner.repositoryRoot

 

Maven repo url. If blank then will call the local maven repo

stubrunner.classifier

stubs

Default classifier for the stub artifacts

stubrunner.workOffline

false

If true then will not contact any remote repositories to download stubs

stubrunner.ids

 

Array of Ivy notation stubs to download

stubrunner.username

 

Optional username to access the tool that stores the JARs with stubs

stubrunner.password

 

Optional password to access the tool that stores the JARs with stubs

stubrunner.stubsPerConsumer

false

Set to true if you want to use different stubs per each consumer instead of registering all stubs for every consumer

stubrunner.consumerName

 

If you want to use stubs per consumer and want to override the consumer name just change this value

Stub runner stubs ids

You can provide the stubs to download via the stubrunner.ids system property. They follow the following pattern:

groupId:artifactId:version:classifier:port

version, classifier and port are optional.

  • If you don’t provide the port then a random one will be picked
  • If you don’t provide the classifier then the default one will be taken. (NOTE that you can pass an empty classifier like this groupId:artifactId:version:)
  • If you don’t provide the version then the + will be passed and the latest one will be downloaded

Where port means the port of the WireMock server.

[Important]Important

Starting from version 1.0.4 as a version you can provide a range of versions that you would like -the Stub Runner to take into consideration. You can read more about the Aether versioning ranges here.

Taken from Aether Docs:

This scheme accepts versions of any form, interpreting a version as a sequence of numeric and alphabetic segments. The characters '-', '_', and '.' as well as the mere -transitions from digit to letter and vice versa delimit the version segments. Delimiters are treated as equivalent.

Numeric segments are compared mathematically, alphabetic segments are compared lexicographically and case-insensitively. However, the following qualifier strings are -recognized and treated specially: "alpha" = "a" < "beta" = "b" < "milestone" = "m" < "cr" = "rc" < "snapshot" < "final" = "ga" < "sp". All of those well-known qualifiers -are considered smaller/older than other strings. An empty segment/string is equivalent to 0.

In addition to the above mentioned qualifiers, the tokens "min" and "max" may be used as final version segment to denote the smallest/greatest version having a given prefix. -For example, "1.2.min" denotes the smallest version in the 1.2 line, "1.2.max" denotes the greatest version in the 1.2 line. A version range of the form "[M.N.*]" is short for "[M.N.min, M.N.max]".

Numbers and strings are considered incomparable against each other. Where version segments of different kind would collide, comparison will instead assume that the previous -segments are padded with trailing 0 or "ga" segments, respectively, until the kind mismatch is resolved, e.g. "1-alpha" = "1.0.0-alpha" < "1.0.1-ga" = "1.0.1".

2.12 Stub Runner for Messaging

Stub Runner has the functionality to run the published stubs in memory. It can integrate with the following frameworks out of the box

  • Spring Integration
  • Spring Cloud Stream
  • Apache Camel
  • Spring AMQP

It also provides points of entry to integrate with any other solution on the market.

2.12.1 Stub triggering

To trigger a message it’s enough to use the StubTrigger interface:

package org.springframework.cloud.contract.stubrunner;
-
-import java.util.Collection;
-import java.util.Map;
-
-public interface StubTrigger {
-
-	/**
-	 * Triggers an event by a given label for a given {@code groupid:artifactid} notation. You can use only {@code artifactId} too.
-	 *
-	 * Feature related to messaging.
-	 *
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger(String ivyNotation, String labelName);
-
-	/**
-	 * Triggers an event by a given label.
-	 *
-	 * Feature related to messaging.
-	 *
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger(String labelName);
-
-	/**
-	 * Triggers all possible events.
-	 *
-	 * Feature related to messaging.
-	 *
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger();
-
-	/**
-	 * Returns a mapping of ivy notation of a dependency to all the labels it has.
-	 *
-	 * Feature related to messaging.
-	 */
-	Map<String, Collection<String>> labels();
-}

For convenience the StubFinder interface extends StubTrigger so it’s enough to use only one in your tests.

StubTrigger gives you the following options to trigger a message:

Trigger by label

stubFinder.trigger('return_book_1')
Trigger by group and artifact ids
stubFinder.trigger('org.springframework.cloud.contract.verifier.stubs:camelService', 'return_book_1')
Trigger by artifact ids
stubFinder.trigger('camelService', 'return_book_1')

Trigger all messages

stubFinder.trigger()

2.13 Stub Runner Camel

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to integrate with Apache Camel. -For the provided artifacts it will automatically download the stubs and register the required -routes.

2.13.1 Adding it to the project

It’s enough to have both Apache Camel and Spring Cloud Contract Stub Runner on classpath. -Remember to annotate your test class with @AutoConfigureStubRunner.

2.13.2 Examples

Stubs structure

Let us assume that we have the following Maven repository with a deployed stubs for the -camelService application.

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── camelService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── camelService-0.0.1-SNAPSHOT.pom
-                            │   ├── camelService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

And the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Let’s consider the following contracts (let' number it with 1):

Contract.make {
-	label 'return_book_1'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('jms:output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and number 2

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('jms:input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('jms:output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			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
-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
-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'])

2.14 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 will automatically download the stubs and register the required -routes.

2.14.1 Adding it to the project

It’s enough to have both Spring Integration and Spring Cloud Contract Stub Runner on classpath. -Remember to annotate your test class with @AutoConfigureStubRunner.

2.14.2 Examples

Stubs structure

Let us assume that we have the following Maven repository with a deployed stubs for the -integrationService application.

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── integrationService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── integrationService-0.0.1-SNAPSHOT.pom
-                            │   ├── integrationService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

And the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Let’s consider the following contracts (let' number it with 1):

Contract.make {
-	label 'return_book_1'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and number 2

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and the following Spring Integration Route:

<?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"
-			 xsi:schemaLocation="http://www.springframework.org/schema/beans
-			https://www.springframework.org/schema/beans/spring-beans.xsd
-			http://www.springframework.org/schema/integration
-			https://www.springframework.org/schema/integration/spring-integration.xsd">
-
-
-	<!-- REQUIRED FOR TESTING -->
-	<bridge input-channel="output"
-			output-channel="outputTest"/>
-
-	<channel id="outputTest">
-		<queue/>
-	</channel>
-
-</beans:beans>

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 output

Message<?> receivedMessage = messaging.receive('outputTest')

And the received message would pass the following assertions

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.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 output destination.

messaging.send(new BookReturned('foo'), [sample: 'header'], 'input')

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

Message<?> receivedMessage = messaging.receive('outputTest')

And the received message would pass the following assertions

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.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 input destination.

messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')

2.15 Stub Runner Stream

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to integrate with Spring Stream. -For the provided artifacts it will automatically download the stubs and register the required -routes.

[Warning]Warning

In Stub Runner’s integration with Stream the messageFrom or sentTo Strings are resolved -first as a destination of a channel, and then if there is no such destination it’s resolved as a -channel name.

[Important]Important

If you want to use Spring Cloud Stream remember to add a -org.springframework.cloud:spring-cloud-stream-test-support dependency.

Maven.  -

<dependency>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-stream-test-support</artifactId>
-    <scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-stream-test-support"

-

2.15.1 Adding it to the project

It’s enough to have both Spring Cloud Stream and Spring Cloud Contract Stub Runner on classpath. -Remember to annotate your test class with @AutoConfigureStubRunner.

2.15.2 Examples

Stubs structure

Let us assume that we have the following Maven repository with a deployed stubs for the -streamService application.

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── streamService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── streamService-0.0.1-SNAPSHOT.pom
-                            │   ├── streamService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

And the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Let’s consider the following contracts (let' number it with 1):

Contract.make {
-	label 'return_book_1'
-	input { triggeredBy('bookReturnedTriggered()') }
-	outputMessage {
-		sentTo('returnBook')
-		body('''{ "bookName" : "foo" }''')
-		headers { header('BOOK-NAME', 'foo') }
-	}
-}

and number 2

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('bookStorage')
-		messageBody([
-			bookName: 'foo'
-		])
-		messageHeaders { header('sample', 'header') }
-	}
-	outputMessage {
-		sentTo('returnBook')
-		body([
-			bookName: 'foo'
-		])
-		headers { header('BOOK-NAME', 'foo') }
-	}
-}

and the following Spring configuration:

stubrunner.repositoryRoot: classpath:m2repo/repository/
-stubrunner.ids: org.springframework.cloud.contract.verifier.stubs:streamService:0.0.1-SNAPSHOT:stubs
-
-spring:
-  cloud:
-    stream:
-      bindings:
-        output:
-          destination: returnBook
-        input:
-          destination: bookStorage
-
-server:
-  port: 0
-
-debug: true

Scenario 1 (no input message)

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

stubFinder.trigger('return_book_1')

Next we’ll want to listen to the output of the message sent to a channel whose destination is returnBook

Message<?> receivedMessage = messaging.receive('returnBook')

And the received message would pass the following assertions

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.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 bookStorage destination.

messaging.send(new BookReturned('foo'), [sample: 'header'], 'bookStorage')

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

Message<?> receivedMessage = messaging.receive('returnBook')

And the received message would pass the following assertions

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.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 output destination.

messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')

2.16 Stub Runner Spring AMQP

Spring Cloud Contract Verifier Stub Runner’s messaging module provides an easy way to integrate with Spring AMQP’s Rabbit Template. -For the provided artifacts it will automatically download the stubs and register the required -routes.

The integration tries to work standalone, that is without interaction with a running RabbitMQ message broker. -It expects a RabbitTemplate on the application context and uses it as a spring boot test @SpyBean. -Thus it can use the mockito spy functionality to verify and introspect messages sent by the application.

On the message consumer side, it considers all @RabbitListener annotated endpoints as well as all `SimpleMessageListenerContainer`s on the application context.

As messages are usually sent to exchanges in AMQP the message contract contains the exchange name as the destination. -Message listeners on the other side are bound to queues. Bindings connect an exchange to a queue. -If message contracts are triggered the Spring AMQP stub runner integration will look for bindings on the application context that match this exchange. -Then it collects the queues from the Spring exchanges and tries to find messages listeners bound to these queues. -The message is triggered to all matching message listeners.

2.16.1 Adding it to the project

It’s enough to have both Spring AMQP and Spring Cloud Contract Stub Runner on the classpath and set the property stubrunner.amqp.enabled=true. -Remember to annotate your test class with @AutoConfigureStubRunner.

2.16.2 Examples

Stubs structure

Let us assume that we have the following Maven repository with a deployed stubs for the -spring-cloud-contract-amqp-test application.

└── .m2
-    └── repository
-        └── com
-            └── example
-                └── spring-cloud-contract-amqp-test
-                    ├── 0.4.0-SNAPSHOT
-                    │   ├── spring-cloud-contract-amqp-test-0.4.0-SNAPSHOT.pom
-                    │   ├── spring-cloud-contract-amqp-test-0.4.0-SNAPSHOT-stubs.jar
-                    │   └── maven-metadata-local.xml
-                    └── maven-metadata-local.xml

And the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── contracts
-    └── shouldProduceValidPersonData.groovy

Let’s consider the following contract:

Contract.make {
-    // Human readable description
-    description 'Should produce valid person data'
-    // Label by means of which the output message can be triggered
-    label 'contract-test.person.created.event'
-    // input to the contract
-    input {
-        // the contract will be triggered by a method
-        triggeredBy('createPerson()')
-    }
-    // output message of the contract
-    outputMessage {
-        // destination to which the output message will be sent
-        sentTo 'contract-test.exchange'
-        headers {
-            header('contentType': 'application/json')
-            header('__TypeId__': 'org.springframework.cloud.contract.stubrunner.messaging.amqp.Person')
-        }
-        // the body of the output message
-        body ([
-                id: $(consumer(9), producer(regex("[0-9]+"))),
-                name: "me"
-        ])
-    }
-}

and the following Spring configuration:

stubrunner:
-  repositoryRoot: classpath:m2repo/repository/
-  ids: org.springframework.cloud.contract.verifier.stubs.amqp:spring-cloud-contract-amqp-test:0.4.0-SNAPSHOT:stubs
-  amqp:
-    enabled: true
-server:
-  port: 0

Triggering the message

So to trigger a message using the contract above we’ll use the StubTrigger interface as follows.

stubTrigger.trigger("contract-test.person.created.event")

The message has the destination contract-test.exchange so the Spring AMQP stub runner integration looks for bindings related to this exchange.

@Bean
-public Binding binding() {
-	return BindingBuilder.bind(new Queue("test.queue")).to(new DirectExchange("contract-test.exchange")).with("#");
-}

The binding definition binds the queue test.queue. -So the following listener definition is a match and is invoked with the contract message.

@Bean
-public SimpleMessageListenerContainer simpleMessageListenerContainer(ConnectionFactory connectionFactory,
-																		MessageListenerAdapter listenerAdapter) {
-	SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
-	container.setConnectionFactory(connectionFactory);
-	container.setQueueNames("test.queue");
-	container.setMessageListener(listenerAdapter);
-
-	return container;
-}

Also, the following annotated listener represents a match and would be invoked.

@RabbitListener(bindings = @QueueBinding(
-		value = @Queue(value = "test.queue"),
-		exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true")))
-public void handlePerson(Person person) {
-	this.person = person;
-}
[Note]Note

The message is directly handed over to the onMessage method of the MessageListener associated with the matching SimpleMessageListenerContainer.

Spring AMQP Test Configuration

In order to avoid that Spring AMQP is trying to connect to a running broker during our tests we configure a mock ConnectionFactory.

To disable the mocked ConnectionFactory set the property stubrunner.amqp.mockConnection=false

stubrunner:
-  amqp:
-    mockConnection: false

2.17 Contract DSL

[Important]Important

Remember that inside the contract file you have to provide the fully qualified name to -the Contract class and the make static import i.e. org.springframework.cloud.spec.Contract.make { …​ }. -You can also provide an import to the Contract class import org.springframework.cloud.spec.Contract and then call - Contract.make { …​ }

Contract DSL is written in Groovy, but don’t be alarmed if you didn’t use Groovy before. Knowledge of the language is not really needed as our DSL uses only -a tiny subset of it (namely literals, method calls and closures). What’s more the DSL is designed to be programmer-readable without any knowledge of the DSL itself - - it’s statically typed.

[Tip]Tip

Spring Cloud Contract supports defining multiple contracts in a single file!

The Contract is present in the spring-cloud-contract-spec module of the Spring Cloud Contract Verifier repository.

Let’s look at full example of a contract definition.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url '/api/12'
-		headers {
-			header 'Content-Type': 'application/vnd.org.springframework.cloud.contract.verifier.twitter-places-analyzer.v1+json'
-		}
-		body '''\
-		[{
-			"created_at": "Sat Jul 26 09:38:57 +0000 2014",
-			"id": 492967299297845248,
-			"id_str": "492967299297845248",
-			"text": "Gonna see you at Warsaw",
-			"place":
-			{
-				"attributes":{},
-				"bounding_box":
-				{
-					"coordinates":
-						[[
-							[-77.119759,38.791645],
-							[-76.909393,38.791645],
-							[-76.909393,38.995548],
-							[-77.119759,38.995548]
-						]],
-					"type":"Polygon"
-				},
-				"country":"United States",
-				"country_code":"US",
-				"full_name":"Washington, DC",
-				"id":"01fbe706f872cb32",
-				"name":"Washington",
-				"place_type":"city",
-				"url": "https://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
-			}
-		}]
-	'''
-	}
-	response {
-		status 200
-	}
-}

Not all features of the DSL are used in example above. If you didn’t find what you are looking for, please check next paragraphs on this page.

You can easily compile Contracts to WireMock stubs mapping using standalone maven command: mvn org.springframework.cloud:spring-cloud-contract-maven-plugin:convert.

2.17.1 Limitations

[Warning]Warning

Spring Cloud Contract Verifier doesn’t support XML properly. Please use JSON or help us implement this feature.

[Warning]Warning

The support for the verification of size of JSON arrays is experimental. If you want to turn it on please provide -the value of a system property spring.cloud.contract.verifier.assert.size equal to true. By default this feature is set to -false. You can also provide the assertJsonSize property in the plugin configuration.

[Warning]Warning

Due to the fact that JSON structure can have any form it’s sometimes impossible to parse it properly when using -the value(consumer(…​), producer(…​)) notation when using that in GString. That’s why we highly recommend using the -Groovy Map notation.

2.17.2 Common Top-Level elements

Description

You can add a description to your contract that is nothing else but an arbitrary text. Example:

		org.springframework.cloud.contract.spec.Contract.make {
-			description('''
-given:
-	An input
-when:
-	Sth happens
-then:
-	Output
-''')
-		}

Name

You can provide a name of your contract. Let’s assume that you’ve provided a name should register a user. -If you do this then the name of the autogenerated test will be equal to validate_should_register_a_user. -Also the name of the stub will be should_register_a_user.json in case of a WireMock stub.

[Important]Important

Please ensure that the name doesn’t contain any characters that will make the generated test - not possible to compile. Also remember that if you provide the same name for multiple contracts then your - autogenerated tests will fail to compile and your generated stubs will override each other.

Ignoring contracts

If you want to ignore a contract you can either set a value of ignored contracts in the plugin configuration -or just set the ignored property on the contract itself:

org.springframework.cloud.contract.spec.Contract.make {
-	ignored()
-}

Passing values from files

Starting with version 1.2.0 it’s possible to pass values from files. Let’s assume that we have -the following resources in our project.

└── src
-    └── test
-        └── resources
-            └── contracts
-                ├── readFromFile.groovy
-                ├── request.json
-                └── response.json

And our contract looks like this:

import org.springframework.cloud.contract.spec.Contract
-
-Contract.make {
-	request {
-		method('PUT')
-		headers {
-			contentType(applicationJson())
-		}
-		body(file("request.json"))
-		url("/1")
-	}
-	response {
-		status 200
-		body(file("response.json"))
-		headers {
-			contentType(textPlain())
-		}
-	}
-}

and the json files look like this:

request.json

{ "status" : "REQUEST" }

response.json

{ "status" : "RESPONSE" }

When test / stub generation takes place then the contents of the file will be -passed to the body of request / response. All thanks to the file(…​) method. -The argument of that method needs to be a file with location relative to the -folder in which the contract lays.

2.17.3 HTTP Top-Level Elements

Following methods can be called in the top-level closure of a contract definition. Request and response are mandatory, priority is optional.

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).
-	request {
-		//...
-	}
-
-	// Definition of HTTP response part of the contract
-	// (a service implementing this contract should respond
-	// with following response after receiving request
-	// specified in "request" part above).
-	response {
-		//...
-	}
-
-	// Contract priority, which can be used for overriding
-	// contracts (1 is highest). Priority is optional.
-	priority 1
-}

2.17.4 Request

HTTP protocol requires only method and address to be specified in a request. The same information is mandatory in request definition of the Contract.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		// HTTP request method (GET/POST/PUT/DELETE).
-		method 'GET'
-
-		// Path component of request URL is specified as follows.
-		urlPath('/users')
-	}
-
-	response {
-		//...
-	}
-}

It is possible to specify whole url instead of just path, but urlPath is the recommended way as it makes the tests host-independent.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'GET'
-
-		// Specifying `url` and `urlPath` in one contract is illegal.
-		url('http://localhost:8888/users')
-	}
-
-	response {
-		//...
-	}
-}

Request may contain query parameters, which are specified in a closure nested in a call to urlPath or url.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-
-		urlPath('/users') {
-
-			// Each parameter is specified in form
-			// `'paramName' : paramValue` where parameter value
-			// may be a simple literal or one of matcher functions,
-			// all of which are used in this example.
-			queryParameters {
-
-				// If a simple literal is used as value
-				// default matcher function is used (equalTo)
-				parameter 'limit': 100
-
-				// `equalTo` function simply compares passed value
-				// using identity operator (==).
-				parameter 'filter': equalTo("email")
-
-				// `containing` function matches strings
-				// that contains passed substring.
-				parameter 'gender': value(consumer(containing("[mf]")), producer('mf'))
-
-				// `matching` function tests parameter
-				// against passed regular expression.
-				parameter 'offset': value(consumer(matching("[0-9]+")), producer(123))
-
-				// `notMatching` functions tests if parameter
-				// does not match passed regular expression.
-				parameter 'loginStartsWith': value(consumer(notMatching(".{0,2}")), producer(3))
-			}
-		}
-
-		//...
-	}
-
-	response {
-		//...
-	}
-}

It may contain additional request headers…​

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-
-		// Each header is added in form `'Header-Name' : 'Header-Value'`.
-		// there are also some helper methods
-		headers {
-			header 'key': 'value'
-			contentType(applicationJson())
-		}
-
-		//...
-	}
-
-	response {
-		//...
-	}
-}

…​and a request body.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-
-		// Currently only JSON format of request body is supported.
-		// Format will be determined from a header or body's content.
-		body '''{ "login" : "john", "name": "John The Contract" }'''
-	}
-
-	response {
-		//...
-	}
-}

Request may contain multipart elements. Just call the multipart() method.

org.springframework.cloud.contract.spec.Contract contractDsl = org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method "PUT"
-		url "/multipart"
-		headers {
-			contentType('multipart/form-data;boundary=AaB03x')
-		}
-		multipart(
-				// key (parameter name), value (parameter value) pair
-				formParameter: $(c(regex('".+"')), p('"formParameterValue"')),
-				someBooleanParameter: $(c(regex(anyBoolean())), p('true')),
-				// a named parameter (e.g. with `file` name) that represents file with
-				// `name` and `content`. You can also call `named("fileName", "fileContent")`
-				file: named(
-						// name of the file
-						name: $(c(regex(nonEmpty())), p('filename.csv')),
-						// content of the file
-						content: $(c(regex(nonEmpty())), p('file content')))
-		)
-	}
-	response {
-		status 200
-	}
-}

In this example we defined parameters either directly by using the map notation, -where the value can be a dynamic property (e.g. formParameter: $(consumer(…​), producer(…​))) - or by using the named(…​) method that allows you to set a named parameter. - A named parameter can set a name and content. You can call it either via - a method with 2 arguments: e.g. named("fileName", "fileContent") or - via a map notation named(name: "fileName", content: "fileContent").

From this contract the generated test will look more or less like this:

// given:
- MockMvcRequestSpecification request = given()
-   .header("Content-Type", "multipart/form-data;boundary=AaB03x")
-   .param("formParameter", "\"formParameterValue\"")
-   .param("someBooleanParameter", "true")
-   .multiPart("file", "filename.csv", "file content".getBytes());
-
-// when:
- ResponseOptions response = given().spec(request)
-   .put("/multipart");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);

The WireMock stub will look more or less like this:

			'''
-{
-  "request" : {
-	"url" : "/multipart",
-	"method" : "PUT",
-	"headers" : {
-	  "Content-Type" : {
-		"matches" : "multipart/form-data;boundary=AaB03x.*"
-	  }
-	},
-	"bodyPatterns" : [ {
-		"matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"formParameter\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n\\".+\\"\\r\\n--\\\\1.*"
-  		}, {
-    			"matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"someBooleanParameter\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n(true|false)\\r\\n--\\\\1.*"
-  		}, {
-	  "matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"file\\"; filename=\\".+\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n.+\\r\\n--\\\\1.*"
-	} ]
-  },
-  "response" : {
-	"status" : 200,
-	"transformers" : [ "response-template" ]
-  }
-}
-	'''

2.17.5 Response

Minimal response must contain HTTP status code.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-	}
-	response {
-		// Status code sent by the server
-		// in response to request specified above.
-		status 200
-	}
-}

Besides status response may contain headers and body, which are specified the same way as in the request (see previous paragraph).

2.17.6 Dynamic properties

The contract can contain some dynamic properties - timestamps / ids etc. You don’t want to enforce the consumers to stub their -clocks to always return the same value of time so that it gets matched by the stub. That’s why we allow you to provide the dynamic -parts in your contracts in two ways. One is to pass them directly in the -body and one to set them in a separate section called testMatchers and stubMatchers.

Dynamic properties inside the body

You can set the properties inside the body either via the value method

value(consumer(...), producer(...))
-value(c(...), p(...))
-value(stub(...), test(...))
-value(client(...), server(...))

or if you’re using the Groovy map notation for body you can use the $() method

$(consumer(...), producer(...))
-$(c(...), p(...))
-$(stub(...), test(...))
-$(client(...), server(...))

All of the aforementioned approaches are equal. That means that stub and client methods are aliases over the consumer -method. Let’s take a closer look at what we can do with those values in the subsequent sections.

Regular expressions

You can use regular expressions to write your requests in Contract DSL. It is particularly useful when you want to indicate that a given response -should be provided for requests that follow a given pattern. Also, you can use it when you need to use patterns and not exact values both -for your test and your server side tests.

Please see the example below:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method('GET')
-		url $(consumer(~/\/[0-9]{2}/), producer('/12'))
-	}
-	response {
-		status 200
-		body(
-				id: $(anyNumber()),
-				surname: $(
-						consumer('Kowalsky'),
-						producer(regex('[a-zA-Z]+'))
-				),
-				name: 'Jan',
-				created: $(consumer('2014-02-02 12:23:43'), producer(execute('currentDate(it)'))),
-				correlationId: value(consumer('5d1f9fef-e0dc-4f3d-a7e4-72d2220dd827'),
-						producer(regex('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}'))
-				)
-		)
-		headers {
-			header 'Content-Type': 'text/plain'
-		}
-	}
-}

You can also provide only one side of the communication using a regular expression. If you do that then automatically we’ll -provide the generated string that matches the provided regular expression. For example:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url value(consumer(regex('/foo/[0-9]{5}')))
-		body([
-			requestElement: $(consumer(regex('[0-9]{5}')))
-		])
-		headers {
-			header('header', $(consumer(regex('application\\/vnd\\.fraud\\.v1\\+json;.*'))))
-		}
-	}
-	response {
-		status 200
-		body([
-			responseElement: $(producer(regex('[0-9]{7}')))
-		])
-		headers {
-			contentType("application/vnd.fraud.v1+json")
-		}
-	}
-}

In this example for request and response the opposite side of the communication will have the respective data generated.

Spring Cloud Contract comes with a series of predefined regular expressions that you can use in your contracts.

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])')
-protected static final Pattern HOSTNAME_PATTERN = Pattern.compile('((http[s]?|ftp):/)/?([^:/\\s]+)(:[0-9]{1,5})?')
-protected static final Pattern EMAIL = Pattern.compile('[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}')
-protected static final Pattern URL = UrlHelper.URL
-protected static final Pattern UUID = Pattern.compile('[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}')
-protected static final Pattern ANY_DATE = Pattern.compile('(\\d\\d\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])')
-protected static final Pattern ANY_DATE_TIME = Pattern.compile('([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])')
-protected static final Pattern ANY_TIME = Pattern.compile('(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])')
-protected static final Pattern NON_EMPTY = Pattern.compile(/.+/)
-protected static final Pattern NON_BLANK = Pattern.compile(/.*(\S+|\R).*|!^\R*$/)
-protected static final Pattern ISO8601_WITH_OFFSET = Pattern.compile(/([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.\d{3})?(Z|[+-][01]\d:[0-5]\d)/)
-
-protected static Pattern anyOf(String... values){
-	return Pattern.compile(values.collect({"^$it\$"}).join("|"))
-}
-
-String onlyAlphaUnicode() {
-	return ONLY_ALPHA_UNICODE.pattern()
-}
-
-String number() {
-	return NUMBER.pattern()
-}
-
-String anyBoolean() {
-	return TRUE_OR_FALSE.pattern()
-}
-
-String ipAddress() {
-	return IP_ADDRESS.pattern()
-}
-
-String hostname() {
-	return HOSTNAME_PATTERN.pattern()
-}
-
-String email() {
-	return EMAIL.pattern()
-}
-
-String url() {
-	return URL.pattern()
-}
-
-String uuid(){
-	return UUID.pattern()
-}
-
-String isoDate() {
-	return ANY_DATE.pattern()
-}
-
-String isoDateTime() {
-	return ANY_DATE_TIME.pattern()
-}
-
-String isoTime() {
-	return ANY_TIME.pattern()
-}
-
-String iso8601WithOffset() {
-	return ISO8601_WITH_OFFSET.pattern()
-}
-
-String nonEmpty() {
-	return NON_EMPTY.pattern()
-}
-
-String nonBlank() {
-	return NON_BLANK.pattern()
-}

so in your contract you can use it like this

Contract dslWithOptionalsInString = Contract.make {
-	priority 1
-	request {
-		method POST()
-		url '/users/password'
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
-				callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
-		)
-	}
-	response {
-		status 404
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				code: value(consumer("123123"), producer(optional("123123"))),
-				message: "User not found by email = [${value(producer(regex(email())), consumer('not.existing@user.com'))}]"
-		)
-	}
-}
Passing optional parameters

It is possible to provide optional parameters in your contract. It’s only possible to have optional parameter for the:

  • STUB side of the Request
  • TEST side of the Response

Example:

org.springframework.cloud.contract.spec.Contract.make {
-	priority 1
-	request {
-		method 'POST'
-		url '/users/password'
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
-				callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
-		)
-	}
-	response {
-		status 404
-		headers {
-			header 'Content-Type': 'application/json'
-		}
-		body(
-				code: value(consumer("123123"), producer(optional("123123")))
-		)
-	}
-}

By wrapping a part of the body with the optional() method you are in fact creating a regular expression that should be present 0 or more times.

That way for the example above the following test would be generated if you pick Spock:

"""
- given:
-  def request = given()
-    .header("Content-Type", "application/json")
-    .body('''{"email":"abc@abc.com","callback_url":"http://partners.com"}''')
-
- when:
-  def response = given().spec(request)
-    .post("/users/password")
-
- then:
-  response.statusCode == 404
-  response.header('Content-Type')  == 'application/json'
- and:
-  DocumentContext parsedJson = JsonPath.parse(response.body.asString())
-  assertThatJson(parsedJson).field("['code']").matches("(123123)?")
-"""

and the following stub:

'''
-{
-  "request" : {
-    "url" : "/users/password",
-    "method" : "POST",
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.['email'] =~ /([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,6})?/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['callback_url'] =~ /((http[s]?|ftp):\\\\/)\\\\/?([^:\\\\/\\\\s]+)(:[0-9]{1,5})?/)]"
-    } ],
-    "headers" : {
-      "Content-Type" : {
-        "equalTo" : "application/json"
-      }
-    }
-  },
-  "response" : {
-    "status" : 404,
-    "body" : "{\\"code\\":\\"123123\\",\\"message\\":\\"User not found by email == [not.existing@user.com]\\"}",
-    "headers" : {
-      "Content-Type" : "application/json"
-    }
-  },
-  "priority" : 1
-}
-'''
Executing custom methods on server side

It is also possible to define a method call to be executed on the server side during the test. Such a method can be added to the class defined as "baseClassForTests" -in the configuration. Example:

Contract

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url $(consumer(regex('^/api/[0-9]{2}$')), producer('/api/12'))
-		headers {
-			header 'Content-Type': 'application/json'
-		}
-		body '''\
-				[{
-					"text": "Gonna see you at Warsaw"
-				}]
-			'''
-	}
-	response {
-		body (
-				path: $(consumer('/api/12'), producer(regex('^/api/[0-9]{2}$'))),
-				correlationId: $(consumer('1223456'), producer(execute('isProperCorrelationId($it)')))
-		)
-		status 200
-	}
-}

Base class

abstract class BaseMockMvcSpec extends Specification {
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new PairIdController())
-	}
-
-	void isProperCorrelationId(Integer correlationId) {
-		assert correlationId == 123456
-	}
-
-	void isEmpty(String value) {
-		assert value == null
-	}
-
-}
[Important]Important

You can’t use both a String and execute to perform concatenation. E.g. calling -header('Authorization', 'Bearer ' + execute('authToken()')) will lead to improper results. -To make this work just call header('Authorization', execute('authToken()')) and ensure that -the authToken() method returns everything that you need.

The type of the object read from the JSON can be one of the followings depending on the -JSON path:

  • String if you point to a String value in a JSON
  • JSONArray if you point to a List in a JSON
  • Map if you point to a Map in a JSON
  • proper Number if you point to Integer, Double etc. in a JSON
  • Boolean if you point to a Boolean in a JSON

In the request part of the contract you can specify that the body should be -taken from a method.

[Important]Important

You have to provide both the consumer and the producer side -and the execute part can be applied for the whole body. Not for parts of it!

Example:

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		url '/something'
-		body(
-				$(c("foo"), p(execute("hashCode()")))
-		)
-	}
-	response {
-		status 200
-	}
-}

This will result in calling the hashCode() method in the request body. -It would more or less like this:

// given:
- MockMvcRequestSpecification request = given()
-   .body(hashCode());
-
-// when:
- ResponseOptions response = given().spec(request)
-   .get("/something");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);

Referencing request from response

The best situation is to provide fixed values but sometimes you need to reference a request in your response. -In order to do this you can profit from the fromRequest() method that allows you to reference a bunch -of elements from the HTTP request. You can use the following options:

  • fromRequest().url() - return the request URL
  • fromRequest().query(String key) - return the first query parameter with a given name
  • fromRequest().query(String key, int index) - return the nth query parameter with a given name
  • fromRequest().header(String key) - return the first header with a given name
  • fromRequest().header(String key, int index) - return the nth header with a given name
  • fromRequest().body() - return the full request body
  • fromRequest().body(String jsonPath) - return the element from the request that matches the JSON Path

Let’s take a look at the following contract

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		url('/api/v1/xxxx') {
-			queryParameters {
-				parameter("foo", "bar")
-				parameter("foo", "bar2")
-			}
-		}
-		headers {
-			header(authorization(), "secret")
-			header(authorization(), "secret2")
-		}
-		body(foo: "bar", baz: 5)
-	}
-	response {
-		status 200
-		headers {
-			header(authorization(), "foo ${fromRequest().header(authorization())} bar")
-		}
-		body(
-				url: fromRequest().url(),
-				param: fromRequest().query("foo"),
-				paramIndex: fromRequest().query("foo", 1),
-				authorization: fromRequest().header("Authorization"),
-				authorization2: fromRequest().header("Authorization", 1),
-				fullBody: fromRequest().body(),
-				responseFoo: fromRequest().body('$.foo'),
-				responseBaz: fromRequest().body('$.baz'),
-				responseBaz2: "Bla bla ${fromRequest().body('$.foo')} bla bla"
-		)
-	}
-}

Running a JUnit test generation will lead in creation of a test looking more or less like this

// given:
- MockMvcRequestSpecification request = given()
-   .header("Authorization", "secret")
-   .header("Authorization", "secret2")
-   .body("{\"foo\":\"bar\",\"baz\":5}");
-
-// when:
- ResponseOptions response = given().spec(request)
-   .queryParam("foo","bar")
-   .queryParam("foo","bar2")
-   .get("/api/v1/xxxx");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Authorization")).isEqualTo("foo secret bar");
-// and:
- DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
- assertThatJson(parsedJson).field("url").isEqualTo("/api/v1/xxxx");
- assertThatJson(parsedJson).field("fullBody").isEqualTo("{\"foo\":\"bar\",\"baz\":5}");
- assertThatJson(parsedJson).field("paramIndex").isEqualTo("bar2");
- assertThatJson(parsedJson).field("responseFoo").isEqualTo("bar");
- assertThatJson(parsedJson).field("authorization2").isEqualTo("secret2");
- assertThatJson(parsedJson).field("responseBaz").isEqualTo(5);
- assertThatJson(parsedJson).field("responseBaz2").isEqualTo("Bla bla bar bla bla");
- assertThatJson(parsedJson).field("param").isEqualTo("bar");
- assertThatJson(parsedJson).field("authorization").isEqualTo("secret");

As you can see elements from the request have been properly referenced in the response.

The generated WireMock stub will look more or less like this:

{
-  "request" : {
-    "urlPath" : "/api/v1/xxxx",
-    "method" : "POST",
-    "headers" : {
-      "Authorization" : {
-        "equalTo" : "secret2"
-      }
-    },
-    "queryParameters" : {
-      "foo" : {
-        "equalTo" : "bar2"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.baz == 5)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.foo == 'bar')]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\"url\":\"{{{request.url}}}\",\"param\":\"{{{request.query.foo.[0]}}}\",\"paramIndex\":\"{{{request.query.foo.[1]}}}\",\"authorization\":\"{{{request.headers.Authorization.[0]}}}\",\"authorization2\":\"{{{request.headers.Authorization.[1]}}}\",\"fullBody\":\"{{{escapejsonbody}}}\",\"responseFoo\":\"{{{jsonpath this '$.foo'}}}\",\"responseBaz\":{{{jsonpath this '$.baz'}}} ,\"responseBaz2\":\"Bla bla {{{jsonpath this '$.foo'}}} bla bla\"}",
-    "headers" : {
-      "Authorization" : "{{{request.headers.Authorization.[0]}}}"
-    },
-    "transformers" : [ "response-template" ]
-  }
-}

So sending a request as the one presented in the request part of the contract will lead in sending the following -response body

{
-  "url" : "/api/v1/xxxx?foo=bar&foo=bar2",
-  "param" : "bar",
-  "paramIndex" : "bar2",
-  "authorization" : "secret",
-  "authorization2" : "secret2",
-  "fullBody" : "{\"foo\":\"bar\",\"baz\":5}",
-  "responseFoo" : "bar",
-  "responseBaz" : 5,
-  "responseBaz2" : "Bla bla bar bla bla"
-}
[Important]Important

This feature will work only with WireMock having version greater or equal to 2.5.1. We’re using WireMock’s -response-template response transformer. It’s using Handlebars to convert the Mustache {{{ }}} templates into -proper values. Additionally we’re registering 2 helper functions. escapejsonbody - that escapes the request -body in a format that can be embedded in a JSON. Another is jsonpath that for a given parameter knows how to -find an object in the request body.

Dynamic properties in matchers sections

If you’ve been working with Pact this might seem familiar. Quite a few users -are used to having a separation between the body and setting dynamic parts of your contract.

That’s why you can profit from two separate sections. One is called stubMatchers where you can -define the dynamic values that should end up in a stub. You can set it in the request or inputMessage -part of your contract. The other is called testMatchers which is present in the response or -outputMessage side of the contract.

Currently we support only JSON Path based matchers with the following matching possibilities. -For stubMatchers:

  • byEquality() - the value taken from the response via the provided JSON Path needs -to be equal to the provided value in the contract
  • byRegex(…​) - the value taken from the response via the provided JSON Path needs -to match the regex
  • byDate() - the value taken from the response via the provided JSON Path needs to -match the regex for ISO Date
  • byTimestamp() - the value taken from the response via the provided JSON Path needs -to match the regex for ISO DateTime
  • byTime() - the value taken from the response via the provided JSON Path needs to -match the regex for ISO Time

For testMatchers:

  • byEquality() - the value taken from the response via the provided JSON Path needs -to be equal to the provided value in the contract
  • byRegex(…​) - the value taken from the response via the provided JSON Path needs -to match the regex
  • byDate() - the value taken from the response via the provided JSON Path needs to -match the regex for ISO Date
  • byTimestamp() - the value taken from the response via the provided JSON Path needs -to match the regex for ISO DateTime
  • byTime() - the value taken from the response via the provided JSON Path needs to -match the regex for ISO Time
  • byType() - the value taken from the response via the provided JSON Path needs to -be of the same type as the type defined in the body of the response in the contract. -byType can take a closure where you can set minOccurrence and maxOccurrence. -That way you can assert on the size of the flattened collection. To check the size -of an unflattened collection, use a custom method via byCommand(…​) testMatcher.
  • byCommand(…​) - the value taken from the response via the provided JSON Path will be -passed as an input to the custom method that you’re providing. E.g. byCommand('foo($it)') -will result in calling a foo method to which the value matching the JSON Path will get - passed.

    • The type of the object read from the JSON can be one of the followings depending on the -JSON path:

      • String if you point to a String value in a JSON
      • JSONArray if you point to a List in a JSON
      • Map if you point to a Map in a JSON
      • proper Number if you point to Integer, Double etc. in a JSON
      • Boolean if you point to a Boolean in a JSON

Let’s take a look at the following example:

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		urlPath '/get'
-		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",
-				key: [
-						'complex.key' : 'foo'
-				]
-		])
-		stubMatchers {
-			jsonPath('$.duck', byRegex("[0-9]{3}"))
-			jsonPath('$.duck', byEquality())
-			jsonPath('$.alpha', byRegex(onlyAlphaUnicode()))
-			jsonPath('$.alpha', byEquality())
-			jsonPath('$.number', byRegex(number()))
-			jsonPath('$.aBoolean', byRegex(anyBoolean()))
-			jsonPath('$.date', byDate())
-			jsonPath('$.dateTime', byTimestamp())
-			jsonPath('$.time', byTime())
-			jsonPath("\$.['key'].['complex.key']", byEquality())
-		}
-		headers {
-			contentType(applicationJson())
-		}
-	}
-	response {
-		status 200
-		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",
-				valueWithMin: [
-					1,2,3
-				],
-				valueWithMax: [
-					1,2,3
-				],
-				valueWithMinMax: [
-					1,2,3
-				],
-				valueWithMinEmpty: [],
-				valueWithMaxEmpty: [],
-				key: [
-				        'complex.key' : 'foo'
-				]
-		])
-		testMatchers {
-			// asserts the jsonpath value against manual regex
-			jsonPath('$.duck', byRegex("[0-9]{3}"))
-			// asserts the jsonpath value against the provided value
-			jsonPath('$.duck', byEquality())
-			// asserts the jsonpath value against some default regex
-			jsonPath('$.alpha', byRegex(onlyAlphaUnicode()))
-			jsonPath('$.alpha', byEquality())
-			jsonPath('$.number', byRegex(number()))
-			jsonPath('$.aBoolean', byRegex(anyBoolean()))
-			// asserts vs inbuilt time related regex
-			jsonPath('$.date', byDate())
-			jsonPath('$.dateTime', byTimestamp())
-			jsonPath('$.time', byTime())
-			// asserts that the resulting type is the same as in response body
-			jsonPath('$.valueWithTypeMatch', byType())
-			jsonPath('$.valueWithMin', byType {
-				// results in verification of size of array (min 1)
-				minOccurrence(1)
-			})
-			jsonPath('$.valueWithMax', byType {
-				// results in verification of size of array (max 3)
-				maxOccurrence(3)
-			})
-			jsonPath('$.valueWithMinMax', byType {
-				// results in verification of size of array (min 1 & max 3)
-				minOccurrence(1)
-				maxOccurrence(3)
-			})
-			jsonPath('$.valueWithMinEmpty', byType {
-				// results in verification of size of array (min 0)
-				minOccurrence(0)
-			})
-			jsonPath('$.valueWithMaxEmpty', byType {
-				// results in verification of size of array (max 0)
-				maxOccurrence(0)
-			})
-			// will execute a method `assertThatValueIsANumber`
-			jsonPath('$.duck', byCommand('assertThatValueIsANumber($it)'))
-			jsonPath("\$.['key'].['complex.key']", byEquality())
-		}
-		headers {
-			contentType(applicationJson())
-		}
-	}
-}

In this example we’re providing the dynamic portions of the contract in the matchers sections. - For the request part you can see that for all fields but valueWithoutAMatcher we’re setting - explicitly the values of regular expressions we’d like the stub to contain. For the valueWithoutAMatcher - the verification will take place in the same way as without the usage of matchers - the test - will perform an equality check in this case.

For the response side in the testMatchers section we’re defining all the dynamic parts - in a similar manner. The only difference is that we have the byType matchers too. In that - case we’re checking 4 fields in the way that we’re verifying whether the response from the test - has a value whose JSON path matching the given field is of the same type as the one defined in the response body and:

  • for $.valueWithTypeMatch - we’re just checking the whether the type is the same
  • for $.valueWithMin - we’re checking the type and assert if the size is greater or equal to the min occurrence
  • for $.valueWithMax - we’re checking the type and assert if the size is smaller or equal to the max occurrence
  • for $.valueWithMinMax - we’re checking the type and assert if the size is between the min and max occurrence

The resulting test would look more or less like this (note that we’re separating the autogenerated -assertions and the one from matchers with an and section):

// 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\"}");
-
-// when:
- ResponseOptions response = given().spec(request)
-   .get("/get");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Content-Type")).matches("application/json.*");
-// and:
- DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
- assertThatJson(parsedJson).field("valueWithoutAMatcher").isEqualTo("foo");
-// and:
- assertThat(parsedJson.read("$.duck", String.class)).matches("[0-9]{3}");
- assertThat(parsedJson.read("$.duck", Integer.class)).isEqualTo(123);
- assertThat(parsedJson.read("$.alpha", String.class)).matches("[\\p{L}]*");
- assertThat(parsedJson.read("$.alpha", String.class)).isEqualTo("abc");
- assertThat(parsedJson.read("$.number", String.class)).matches("-?\\d*(\\.\\d+)?");
- assertThat(parsedJson.read("$.aBoolean", String.class)).matches("(true|false)");
- assertThat(parsedJson.read("$.date", String.class)).matches("(\\d\\d\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])");
- assertThat(parsedJson.read("$.dateTime", String.class)).matches("([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])");
- assertThat(parsedJson.read("$.time", String.class)).matches("(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])");
- assertThat((Object) parsedJson.read("$.valueWithTypeMatch")).isInstanceOf(java.lang.String.class);
- assertThat((Object) parsedJson.read("$.valueWithMin")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMin", java.util.Collection.class)).hasSizeGreaterThanOrEqualTo(1);
- assertThat((Object) parsedJson.read("$.valueWithMax")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMax", java.util.Collection.class)).hasSizeLessThanOrEqualTo(3);
- assertThat((Object) parsedJson.read("$.valueWithMinMax")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMinMax", java.util.Collection.class)).hasSizeBetween(1, 3);
- assertThat((Object) parsedJson.read("$.valueWithMinEmpty")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMinEmpty", java.util.Collection.class)).hasSizeGreaterThanOrEqualTo(0);
- assertThat((Object) parsedJson.read("$.valueWithMaxEmpty")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMaxEmpty", java.util.Collection.class)).hasSizeLessThanOrEqualTo(0);
- assertThatValueIsANumber(parsedJson.read("$.duck"));
[Important]Important

Notice that for the byCommand method we are calling the assertThatValueIsANumber. This method needs -to be defined in the test base class or should be statically imported to your tests. -Notice that the byCommand call was converted to assertThatValueIsANumber(parsedJson.read("$.duck"));. That means -that we took the method name and passed the proper JSON path as a parameter to it.

and the WireMock stub like this:

				'''
-{
-  "request" : {
-    "urlPath" : "/get",
-    "method" : "POST",
-    "headers" : {
-      "Content-Type" : {
-        "matches" : "application/json.*"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.['valueWithoutAMatcher'] == 'foo')]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['valueWithTypeMatch'] == 'string')]"
-    }, {
-      "matchesJsonPath" : "$.['list'].['some'].['nested'][?(@.['anothervalue'] == 4)]"
-    }, {
-      "matchesJsonPath" : "$.['list'].['someother'].['nested'][?(@.['anothervalue'] == 4)]"
-    }, {
-      "matchesJsonPath" : "$.['list'].['someother'].['nested'][?(@.['json'] == 'with value')]"
-    }, {
-      "matchesJsonPath" : "$[?(@.duck =~ /([0-9]{3})/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.duck == 123)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.alpha =~ /([\\\\p{L}]*)/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.alpha == 'abc')]"
-    }, {
-      "matchesJsonPath" : "$[?(@.number =~ /(-?\\\\d*(\\\\.\\\\d+)?)/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.aBoolean =~ /((true|false))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.date =~ /((\\\\d\\\\d\\\\d\\\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.dateTime =~ /(([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.time =~ /((2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]))/)]"
-    }, {
-      "matchesJsonPath" : "$.list.some.nested[?(@.json =~ /(.*)/)]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "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\\",\\"valueWithMin\\":[1,2,3],\\"valueWithMax\\":[1,2,3],\\"valueWithMinMax\\":[1,2,3]}",
-    "headers" : {
-      "Content-Type" : "application/json"
-    }
-  }
-}
-'''
[Important]Important

If you use a matcher then the part of the request / response that the matcher is addressing -via the JSON Path will get removed from assertion. In case of verifying a collection you have to create -matchers for all elements of the collection.

Let’s look at the following example:

Contract.make {
-    request {
-        method 'GET'
-        url("/foo")
-    }
-    response {
-        status 200
-        body(events: [[
-                                 operation          : 'EXPORT',
-                                 eventId            : '16f1ed75-0bcc-4f0d-a04d-3121798faf99',
-                                 status             : 'OK'
-                         ], [
-                                 operation          : 'INPUT_PROCESSING',
-                                 eventId            : '3bb4ac82-6652-462f-b6d1-75e424a0024a',
-                                 status             : 'OK'
-                         ]
-                ]
-        )
-        testMatchers {
-            jsonPath('$.events[0].operation', byRegex('.+'))
-            jsonPath('$.events[0].eventId', byRegex('^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})$'))
-            jsonPath('$.events[0].status', byRegex('.+'))
-        }
-    }
-}

This will lead in creating the following test (showing just the assertion section)

and:
-	DocumentContext parsedJson = JsonPath.parse(response.body.asString())
-	assertThatJson(parsedJson).array("['events']").contains("['eventId']").isEqualTo("16f1ed75-0bcc-4f0d-a04d-3121798faf99")
-	assertThatJson(parsedJson).array("['events']").contains("['operation']").isEqualTo("EXPORT")
-	assertThatJson(parsedJson).array("['events']").contains("['operation']").isEqualTo("INPUT_PROCESSING")
-	assertThatJson(parsedJson).array("['events']").contains("['eventId']").isEqualTo("3bb4ac82-6652-462f-b6d1-75e424a0024a")
-	assertThatJson(parsedJson).array("['events']").contains("['status']").isEqualTo("OK")
-and:
-	assertThat(parsedJson.read("\$.events[0].operation", String.class)).matches(".+")
-	assertThat(parsedJson.read("\$.events[0].eventId", String.class)).matches("^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})\$")
-	assertThat(parsedJson.read("\$.events[0].status", String.class)).matches(".+")

As you can see the assertion is malformed. That’s because only the first element of the array got asserted. -In order to fix this it’s best to apply the assertion to the whole $.events collection and assert it -via the byCommand(…​) method.

2.17.7 JAX-RS support

We support JAX-RS 2 Client API. Base class needs to define protected WebTarget webTarget and server initialization, right now the only option how to test JAX-RS API is to start a web server.

Request with a body needs to have a content type set otherwise application/octet-stream is going to be used.

In order to use JAX-RS mode, use the following settings:

testMode === 'JAXRSCLIENT'

Example of a test API generated:

'''
- // when:
-  Response response = webTarget
-    .path("/users")
-    .queryParam("limit", "10")
-    .queryParam("offset", "20")
-    .queryParam("filter", "email")
-    .queryParam("sort", "name")
-    .queryParam("search", "55")
-    .queryParam("age", "99")
-    .queryParam("name", "Denis.Stepanov")
-    .queryParam("email", "bob@email.com")
-    .request()
-    .method("GET");
-
-  String responseAsString = response.readEntity(String.class);
-
- // then:
-  assertThat(response.getStatus()).isEqualTo(200);
- // and:
-  DocumentContext parsedJson = JsonPath.parse(responseAsString);
-  assertThatJson(parsedJson).field("['property1']").isEqualTo("a");
-'''

2.17.8 Async support

If you’re using asynchronous communication on the server side (your controllers are returning -Callable, DeferredResult etc. then inside your contract you have to provide in the response -section a async() method. Example:

org.springframework.cloud.contract.spec.Contract.make {
-    request {
-        method GET()
-        url '/get'
-    }
-    response {
-        status 200
-        body 'Passed'
-        async()
-    }
-}

2.17.9 Working with Context Paths

Spring Cloud Contract supports context paths.

[Important]Important

The only thing that changes in order to fully support context paths is the switch -on the PRODUCER side. The autogenerated tests need to be using the EXPLICIT mode.

The consumer side remains untouched, in order for the generated test to pass you have to switch the EXPLICIT mode.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <testMode>EXPLICIT</testMode>
-    </configuration>
-</plugin>

-

Gradle.  -

contracts {
-		testMode = 'EXPLICIT'
-}

-

That way you’ll generate a test that DOES NOT use MockMvc. It means that you’re generating -real requests and you need to setup your generated test’s base class to work on a real socket.

Let’s imagine the following contract:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'GET'
-		url '/my-context-path/url'
-	}
-	response {
-		status 200
-	}
-}

Here is an example of how to set up a base class and Rest Assured for everything to work correctly.

import io.restassured.RestAssured;
-import org.junit.Before;
-import org.springframework.boot.context.embedded.LocalServerPort;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest(classes = ContextPathTestingBaseClass.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-class ContextPathTestingBaseClass {
-
-	@LocalServerPort int port;
-
-	@Before
-	public void setup() {
-		RestAssured.baseURI = "http://localhost";
-		RestAssured.port = this.port;
-	}
-}

That way all:

  • all your requests in the autogenerated tests will be sent to the real endpoint with your context path included (e.g. /my-context-path/url)
  • your contracts reflect that you have a context path, thus your generated stubs will also -have that information (e.g. in the stubs you’ll see that you have too call /my-context-path/url)

2.17.10 Messaging Top-Level Elements

The DSL for messaging looks a little bit different than the one that focuses on HTTP.

Output triggered by a method

The output message can be triggered by calling a method (e.g. a Scheduler was started and a message was sent)

def dsl = Contract.make {
-	// Human readable description
-	description 'Some description'
-	// Label by means of which the output message can be triggered
-	label 'some_label'
-	// input to the contract
-	input {
-		// the contract will be triggered by a method
-		triggeredBy('bookReturnedTriggered()')
-	}
-	// output message of the contract
-	outputMessage {
-		// destination to which the output message will be sent
-		sentTo('output')
-		// the body of the output message
-		body('''{ "bookName" : "foo" }''')
-		// the headers of the output message
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

In this case the output message will be sent to output if a method called bookReturnedTriggered will be executed. In the message publisher’s side -we will generate a test that will call that method to trigger the message. On the consumer side you can use the some_label to trigger the message.

Output triggered by a message

The output message can be triggered by receiving a message.

def dsl = Contract.make {
-	description 'Some Description'
-	label 'some_label'
-	// input is a message
-	input {
-		// the message was received from this destination
-		messageFrom('input')
-		// has the following body
-		messageBody([
-		        bookName: 'foo'
-		])
-		// and the following headers
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('output')
-		body([
-		        bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

In this case the output message will be sent to output if a proper message will be received on the input destination. In the message publisher’s side -we will generate a test that will send the input message to the defined destination. On the consumer side you can either send a message to the input -destination or use the some_label to trigger the message.

Consumer / Producer

In HTTP you have a notion of client/stub and `server/test notation. You can use them also in messaging but we’re providing also the consumer and produer methods -as presented below (note you can use either $ or value methods to provide consumer and producer parts)

Contract.make {
-	label 'some_label'
-	input {
-		messageFrom value(consumer('jms:output'), producer('jms:input'))
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo $(consumer('jms:input'), producer('jms:output'))
-		body([
-				bookName: 'foo'
-		])
-	}
-}

2.17.11 Multiple contracts in one file

It’s possible to define multiple contracts in one file. An example of such a contract can look like this

import org.springframework.cloud.contract.spec.Contract
-
-[
-        Contract.make {
-            name("should post a user")
-            request {
-                method 'POST'
-                url('/users/1')
-            }
-            response {
-                status 200
-            }
-        },
-        Contract.make {
-            request {
-                method 'POST'
-                url('/users/2')
-            }
-            response {
-                status 200
-            }
-        }
-]

In this example one contract has the name field and the other doesn’t. This will lead to generation of -two tests that will look more or less like this:

package org.springframework.cloud.contract.verifier.tests.com.hello;
-
-import com.example.TestBase;
-import com.jayway.jsonpath.DocumentContext;
-import com.jayway.jsonpath.JsonPath;
-import com.jayway.restassured.module.mockmvc.specification.MockMvcRequestSpecification;
-import com.jayway.restassured.response.ResponseOptions;
-import org.junit.Test;
-
-import static com.jayway.restassured.module.mockmvc.RestAssuredMockMvc.*;
-import static com.toomuchcoding.jsonassert.JsonAssertion.assertThatJson;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class V1Test extends TestBase {
-
-	@Test
-	public void validate_should_post_a_user() throws Exception {
-		// given:
-			MockMvcRequestSpecification request = given();
-
-		// when:
-			ResponseOptions response = given().spec(request)
-					.post("/users/1");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-	}
-
-	@Test
-	public void validate_withList_1() throws Exception {
-		// given:
-			MockMvcRequestSpecification request = given();
-
-		// when:
-			ResponseOptions response = given().spec(request)
-					.post("/users/2");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-	}
-
-}

Notice that for the contract that has the name field the generated test method is named -validate_should_post_a_user. For the one that doesn’t have the name it’s called -validate_withList_1. It corresponds to the name of the file WithList.groovy and the -index of the contract in the list.

The generated stubs will look like this

should post a user.json
-1_WithList.json

As you can see the first file got the name parameter from the contract. The second -got the name of the contract file WithList.groovy prefixed with the index (in this case -contract had index 1 in the list of contracts in the file).

[Tip]Tip

As you can see it’s much better if you name your contracts since then your tests - are far more meaningful.

2.18 Customization

2.18.1 Extending the DSL

It is possible to provide your own functions to the DSL. The key requirement for this -feature was to maintain the static compatibility. Below you will be able to see an example -of:

  • creation of a JAR with reusable classes
  • referencing of these classes in the DSLs

The full example can be found here.

Common JAR

Below you can find three classes that we will reuse in the DSLs.

PatternUtils contains functions used by both the consumer and the producer.

package com.example;
-
-import java.util.regex.Pattern;
-
-/**
- * If you want to use {@link Pattern} directly in your tests
- * then you can create a class resembling this one. It can
- * contain all the {@link Pattern} you want to use in the DSL.
- *
- * <pre>
- * {@code
- * request {
- *     body(
- *         [ age: $(c(PatternUtils.oldEnough()))]
- *     )
- * }
- * </pre>
- *
- * Notice that we're using both {@code $()} for dynamic values
- * and {@code c()} for the consumer side.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class PatternUtils {
-
-	public static String tooYoung() {
-		//remove::start[]
-		return "[0-1][0-9]";
-		//remove::end[return]
-	}
-
-	public static Pattern oldEnough() {
-		//remove::start[]
-		return Pattern.compile("[2-9][0-9]");
-		//remove::end[return]
-	}
-
-	/**
-	 * Makes little sense but it's just an example ;)
-	 */
-	public static Pattern ok() {
-		//remove::start[]
-		return Pattern.compile("OK");
-		//remove::end[return]
-	}
-}
-//end::impl[]

ConsumerUtils contains functions used by the consumer.

package com.example;
-
-import org.springframework.cloud.contract.spec.internal.ClientDslProperty;
-
-/**
- * DSL Properties passed to the DSL from the consumer's perspective.
- * That means that on the input side {@code Request} for HTTP
- * or {@code Input} for messaging you can have a regular expression.
- * On the {@code Response} for HTTP or {@code Output} for messaging
- * you have to have a concrete value.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class ConsumerUtils {
-	/**
-	 * Consumer side property. By using the {@link ClientDslProperty}
-	 * you can omit most of boilerplate code from the perspective
-	 * of dynamic values. Example
-	 *
-	 * <pre>
-	 * {@code
-	 * request {
-	 *     body(
-	 *         [ age: $(ConsumerUtils.oldEnough())]
-	 *     )
-	 * }
-	 * </pre>
-	 *
-	 * That way it's in the implementation that we decide what value we will pass to the consumer
-	 * and which one to the producer.
-	 *
-	 * @author Marcin Grzejszczak
-	 */
-	public static ClientDslProperty oldEnough() {
-		//remove::start[]
-		// this example is not the best one and
-		// theoretically you could just pass the regex instead of `ServerDslProperty` but
-		// it's just to show some new tricks :)
-		return new ClientDslProperty(PatternUtils.oldEnough(), 40);
-		//remove::end[return]
-	}
-
-}
-//end::impl[]

ProducerUtils contains functions used by the producer.

package com.example;
-
-import org.springframework.cloud.contract.spec.internal.ServerDslProperty;
-
-/**
- * DSL Properties passed to the DSL from the producer's perspective.
- * That means that on the input side {@code Request} for HTTP
- * or {@code Input} for messaging you have to have a concrete value.
- * On the {@code Response} for HTTP or {@code Output} for messaging
- * you can have a regular expression.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class ProducerUtils {
-
-	/**
-	 * Producer side property. By using the {@link ProducerUtils}
-	 * you can omit most of boilerplate code from the perspective
-	 * of dynamic values. Example
-	 *
-	 * <pre>
-	 * {@code
-	 * response {
-	 *     body(
-	 *         [ status: $(ProducerUtils.ok())]
-	 *     )
-	 * }
-	 * </pre>
-	 *
-	 * That way it's in the implementation that we decide what value we will pass to the consumer
-	 * and which one to the producer.
-	 */
-	public static ServerDslProperty ok() {
-		// this example is not the best one and
-		// theoretically you could just pass the regex instead of `ServerDslProperty` but
-		// it's just to show some new tricks :)
-		return new ServerDslProperty( PatternUtils.ok(), "OK");
-	}
-}
-//end::impl[]

Adding the dependency to project

In order for the plugins and IDE to be able to reference the common JAR classes you need -to pass the dependency to your project.

Test dependency in project’s dependencies

First add the common jar dependency as a test dependency. That way since your -contracts files are available at test resources path, automatically the -common jar classes will be visible in your Groovy files.

Maven.  -

<dependency>
-	<groupId>com.example</groupId>
-	<artifactId>beer-common</artifactId>
-	<version>${project.version}</version>
-	<scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile("com.example:beer-common:0.0.1-SNAPSHOT")

-

Test dependency in plugin’s dependencies

Now you have to add the dependency for the plugin to reuse at runtime.

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example</packageWithBaseClasses>
-		<baseClassMappings>
-			<baseClassMapping>
-				<contractPackageRegex>.*intoxication.*</contractPackageRegex>
-				<baseClassFQN>com.example.intoxication.BeerIntoxicationBase</baseClassFQN>
-			</baseClassMapping>
-		</baseClassMappings>
-	</configuration>
-	<dependencies>
-		<dependency>
-			<groupId>com.example</groupId>
-			<artifactId>beer-common</artifactId>
-			<version>${project.version}</version>
-			<scope>compile</scope>
-		</dependency>
-	</dependencies>
-</plugin>

-

Gradle.  -

classpath "com.example:beer-common:0.0.1-SNAPSHOT"

-

Referencing classes in DSLs

Now you can reference your classes in your DSL. Example:

package contracts.beer.rest
-
-import com.example.ConsumerUtils
-import com.example.ProducerUtils
-import org.springframework.cloud.contract.spec.Contract
-
-Contract.make {
-	description("""
-Represents a successful scenario of getting a beer
-
-```
-given:
-	client is old enough
-when:
-	he applies for a beer
-then:
-	we'll grant him the beer
-```
-
-""")
-	request {
-		method 'POST'
-		url '/check'
-		body(
-				age: $(ConsumerUtils.oldEnough())
-		)
-		headers {
-			contentType(applicationJson())
-		}
-	}
-	response {
-		status 200
-		body("""
-			{
-				"status": "${value(ProducerUtils.ok())}"
-			}
-			""")
-		headers {
-			contentType(applicationJson())
-		}
-	}
-}

2.19 Pluggable architecture

There are cases where you have your contracts defined in other formats -like YAML, RAML or PACT. On the other hand you’d like to profit from -the test and stubs generation. It’s really easy to add your own implementation -of either of those. Also you can customize the way tests are generated (for example you can generate -tests for other languages) and you can do the same for stubs generation (you can generate -stubs for other stub http server implementations).

2.19.1 Custom contract converter

Let’s assume that your contract is written in a YAML file like this:

request:
-  url: /foo
-  method: PUT
-  headers:
-    foo: bar
-  body:
-    foo: bar
-response:
-  status: 200
-  headers:
-    foo2: bar
-  body:
-    foo2: bar

Thanks to the interface

package org.springframework.cloud.contract.spec
-
-/**
- * Converter to be used to convert FROM {@link File} TO {@link Contract}
- * and from {@link Contract} to {@code T}
- *
- * @param <T> - type to which we want to convert the contract
- *
- * @author Marcin Grzejszczak
- * @since 1.1.0
- */
-interface ContractConverter<T> {
-
-	/**
-	 * Should this file be accepted by the converter. Can use the file extension
-	 * to check if the conversion is possible.
-	 *
-	 * @param file - file to be considered for conversion
-	 * @return - {@code true} if the given implementation can convert the file
-	 */
-	boolean isAccepted(File file)
-
-	/**
-	 * Converts the given {@link File} to its {@link Contract} representation
-	 *
-	 * @param file - file to convert
-	 * @return - {@link Contract} representation of the file
-	 */
-	Collection<Contract> convertFrom(File file)
-
-	/**
-	 * Converts the given {@link Contract} to a {@link T} representation
-	 *
-	 * @param contract - the parsed contract
-	 * @return - {@link T} the type to which we do the conversion
-	 */
-	T convertTo(Collection<Contract> contract)
-}

you can register your own implementation of a contract structure converter. -Your implementation needs to state the condition on which it should start the -conversion. Also you have to define how to perform that conversion in both ways.

[Important]Important

Once you create your implementation you have to create a /META-INF/spring.factories -file in which you provide the fully qualified name of your implementation.

Example of a spring.factories file

# Converters
-org.springframework.cloud.contract.spec.ContractConverter=\
-org.springframework.cloud.contract.verifier.converter.YamlContractConverter

and the YAML implementation

package org.springframework.cloud.contract.verifier.converter
-
-import java.nio.file.Files
-
-import groovy.transform.CompileStatic
-import org.springframework.cloud.contract.spec.Contract
-import org.springframework.cloud.contract.spec.ContractConverter
-import org.springframework.cloud.contract.spec.internal.Headers
-import org.yaml.snakeyaml.Yaml
-
-/**
- * Simple converter from and to a {@link YamlContract} to a collection of {@link Contract}
- */
-@CompileStatic
-class YamlContractConverter implements ContractConverter<List<YamlContract>> {
-
-	@Override
-	public boolean isAccepted(File file) {
-		String name = file.getName()
-		return name.endsWith(".yml") || name.endsWith(".yaml")
-	}
-
-	@Override
-	public Collection<Contract> convertFrom(File file) {
-		try {
-			YamlContract yamlContract = new Yaml().loadAs(
-					Files.newInputStream(file.toPath()), YamlContract.class)
-			return [Contract.make {
-				request {
-					method(yamlContract?.request?.method)
-					url(yamlContract?.request?.url)
-					headers {
-						yamlContract?.request?.headers?.each { String key, Object value ->
-							header(key, value)
-						}
-					}
-					body(yamlContract?.request?.body)
-				}
-				response {
-					status(yamlContract?.response?.status)
-					headers {
-						yamlContract?.response?.headers?.each { String key, Object value ->
-							header(key, value)
-						}
-					}
-					body(yamlContract?.response?.body)
-				}
-			}]
-		}
-		catch (FileNotFoundException e) {
-			throw new IllegalStateException(e)
-		}
-	}
-
-	@Override
-	public List<YamlContract> convertTo(Collection<Contract> contracts) {
-		return contracts.collect { Contract contract ->
-			YamlContract yamlContract = new YamlContract()
-			yamlContract.request.with {
-				method = contract?.request?.method?.clientValue
-				url = contract?.request?.url?.clientValue
-				headers = (contract?.request?.headers as Headers)?.asStubSideMap()
-				body = contract?.request?.body?.clientValue as Map
-			}
-			yamlContract.response.with {
-				status = contract?.response?.status?.clientValue as Integer
-				headers = (contract?.response?.headers as Headers)?.asStubSideMap()
-				body = contract?.response?.body?.clientValue as Map
-			}
-			return yamlContract
-		}
-	}
-}

Pact converter

Spring Cloud Contract comes with an out of the box support for Pact representation of contracts. -In other words instead of using the Groovy DSL you can use Pact files. In this section -we will present how to add such a support for your project.

Pact contract

We will be working on the following example of a Pact contract. We’ve placed this file under -the src/test/resources/contracts folder.

{
-  "provider": {
-    "name": "Provider"
-  },
-  "consumer": {
-    "name": "Consumer"
-  },
-  "interactions": [
-    {
-      "description": "",
-      "request": {
-        "method": "PUT",
-        "path": "/fraudcheck",
-        "headers": {
-          "Content-Type": "application/vnd.fraud.v1+json"
-        },
-        "body": {
-          "clientId": "1234567890",
-          "loanAmount": 99999
-        },
-        "matchingRules": {
-          "$.body.clientId": {
-            "match": "regex",
-            "regex": "[0-9]{10}"
-          }
-        }
-      },
-      "response": {
-        "status": 200,
-        "headers": {
-          "Content-Type": "application/vnd.fraud.v1+json;charset=UTF-8"
-        },
-        "body": {
-          "fraudCheckStatus": "FRAUD",
-          "rejectionReason": "Amount too high"
-        },
-        "matchingRules": {
-          "$.body.fraudCheckStatus": {
-            "match": "regex",
-            "regex": "FRAUD"
-          }
-        }
-      }
-    }
-  ],
-  "metadata": {
-    "pact-specification": {
-      "version": "2.0.0"
-    },
-    "pact-jvm": {
-      "version": "2.4.18"
-    }
-  }
-}
Pact for producers

On the producer side you have add to your plugin configuration two additional dependencies. -One is the Spring Cloud Contract Pact support and the other represents the current -Pact version that you’re using.

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-contract-spec-pact</artifactId>
-			<version>${spring-cloud-contract.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>au.com.dius</groupId>
-			<artifactId>pact-jvm-model</artifactId>
-			<version>2.4.18</version>
-		</dependency>
-	</dependencies>
-</plugin>

-

Gradle.  -

classpath "org.springframework.cloud:spring-cloud-contract-spec-pact:${findProperty('verifierVersion') ?: verifierVersion}"
-classpath 'au.com.dius:pact-jvm-model:2.4.18'

-

When you execute the build of your application a test, looking more or less like this, will be generated

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-	// given:
-		MockMvcRequestSpecification request = given()
-				.header("Content-Type", "application/vnd.fraud.v1+json")
-				.body("{\"clientId\":\"1234567890\",\"loanAmount\":99999}");
-
-	// when:
-		ResponseOptions response = given().spec(request)
-				.put("/fraudcheck");
-
-	// then:
-		assertThat(response.statusCode()).isEqualTo(200);
-		assertThat(response.header("Content-Type")).isEqualTo("application/vnd.fraud.v1+json;charset=UTF-8");
-	// and:
-		DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-		assertThatJson(parsedJson).field("rejectionReason").isEqualTo("Amount too high");
-	// and:
-		assertThat(parsedJson.read("$.fraudCheckStatus", String.class)).matches("FRAUD");
-}

and the stub looking like this

{
-  "uuid" : "996ae5ae-6834-4db6-8fac-358ca187ab62",
-  "request" : {
-    "url" : "/fraudcheck",
-    "method" : "PUT",
-    "headers" : {
-      "Content-Type" : {
-        "equalTo" : "application/vnd.fraud.v1+json"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.loanAmount == 99999)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.clientId =~ /([0-9]{10})/)]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\"fraudCheckStatus\":\"FRAUD\",\"rejectionReason\":\"Amount too high\"}",
-    "headers" : {
-      "Content-Type" : "application/vnd.fraud.v1+json;charset=UTF-8"
-    }
-  }
-}
Pact for consumers

On the producer side you have add to your project dependencies two additional dependencies. -One is the Spring Cloud Contract Pact support and the other represents the current -Pact version that you’re using.

Maven.  -

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-spec-pact</artifactId>
-	<scope>test</scope>
-</dependency>
-<dependency>
-	<groupId>au.com.dius</groupId>
-	<artifactId>pact-jvm-model</artifactId>
-	<version>2.4.18</version>
-	<scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-contract-spec-pact"
-testCompile 'au.com.dius:pact-jvm-model:2.4.18'

-

2.19.2 Custom test generator

If you want to generate tests for different languages than Java or you’re -not happy with the way we’re building Java tests for you then you can register -your own implementation to do that.

Thanks to the interface

package org.springframework.cloud.contract.verifier.builder
-
-import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties
-import org.springframework.cloud.contract.verifier.file.ContractMetadata
-/**
- * Builds a single test.
- *
- * @since 1.1.0
- */
-interface SingleTestGenerator {
-
-	/**
-	 * Creates contents of a single test class in which all test scenarios from
-	 * the contract metadata should be placed.
-	 *
-	 * @param properties - properties passed to the plugin
-	 * @param listOfFiles - list of parsed contracts with additional metadata
-	 * @param className - the name of the generated test class
-	 * @param classPackage - the name of the package in which the test class should be stored
-	 * @param includedDirectoryRelativePath - relative path to the included directory
-	 * @return contents of a single test class
-	 */
-	String buildClass(ContractVerifierConfigProperties properties, Collection<ContractMetadata> listOfFiles,
-					  String className, String classPackage, String includedDirectoryRelativePath)
-
-	/**
-	 * Extension that should be appended to the generated test class. E.g. {@code .java} or {@code .php}
-	 *
-	 * @param properties - properties passed to the plugin
-	 */
-	String fileExtension(ContractVerifierConfigProperties properties)
-}

you can register your own implementation that generates a test. Again, it’s enough to provide -a proper spring.factories file. Example:

org.springframework.cloud.contract.verifier.builder.SingleTestGenerator=/
-com.example.MyGenerator

2.19.3 Custom stub generator

If you want to generate stubs for other stub server than WireMock it’s enough to - plug in your own implementation of this interface:

package org.springframework.cloud.contract.verifier.converter
-
-import groovy.transform.CompileStatic
-import org.springframework.cloud.contract.spec.Contract
-import org.springframework.cloud.contract.verifier.file.ContractMetadata
-
-/**
- * Converts contracts into their stub representation.
- *
- * @since 1.1.0
- */
-@CompileStatic
-interface StubGenerator {
-
-	/**
-	 * Returns {@code true} if the converter can handle the file to convert it into a stub.
-	 */
-	boolean canHandleFileName(String fileName)
-
-	/**
-	 * Returns the collection of converted contracts into stubs. One contract can
-	 * result in multiple stubs.
-	 */
-	Map<Contract, String> convertContents(String rootName, ContractMetadata content)
-
-	/**
-	 * Returns the name of the converted stub file. If you have multiple contracts
-	 * in a single file then a prefix will be added to the generated file. If you
-	 * provide the {@link Contract#name} field then that field will override the
-	 * generated file name.
-	 *
-	 * Example: name of file with 2 contracts is {@code foo.groovy}, it will be
-	 * converted by the implementation to {@code foo.json}. The recursive file
-	 * converter will create two files {@code 0_foo.json} and {@code 1_foo.json}
-	 */
-	String generateOutputFileNameForInput(String inputFileName)
-}

you can register your own implementation that generate Stubs. Again, it’s enough to provide -a proper spring.factories file. Example:

# Stub converters
-org.springframework.cloud.contract.verifier.converter.StubGenerator=\
-org.springframework.cloud.contract.verifier.wiremock.DslToWireMockClientConverter

The default implementation is the WireMock stub generation.

[Tip]Tip

You can provide multiple stub generator implementations. That way for example from a single -DSL as input you can e.g. produce WireMock stubs and Pact files too!

2.19.4 Custom Stub Runner

If you decide to have a custom stub generation you also need a custom way of running -stubs with your different stub provider.

Let us assume that you’re using Moco to build your stubs. -You wrote a proper stub generator and your stubs got placed in a JAR file.

In order for Stub Runner to know how to run your stubs you have to define a custom - HTTP Stub server implementation. It can look like this:

package org.springframework.cloud.contract.stubrunner.provider.moco
-
-import com.github.dreamhead.moco.bootstrap.arg.HttpArgs
-import com.github.dreamhead.moco.runner.JsonRunner
-import com.github.dreamhead.moco.runner.RunnerSetting
-import groovy.util.logging.Slf4j
-import org.springframework.cloud.contract.stubrunner.HttpServerStub
-import org.springframework.util.SocketUtils
-
-@Slf4j
-class MocoHttpServerStub implements HttpServerStub {
-
-	private boolean started
-	private JsonRunner runner
-	private int port
-
-	@Override
-	int port() {
-		if (!isRunning()) {
-			return -1
-		}
-		return port
-	}
-
-	@Override
-	boolean isRunning() {
-		return started
-	}
-
-	@Override
-	HttpServerStub start() {
-		return start(SocketUtils.findAvailableTcpPort())
-	}
-
-	@Override
-	HttpServerStub start(int port) {
-		this.port = port
-		return this
-	}
-
-	@Override
-	HttpServerStub stop() {
-		if (!isRunning()) {
-			return this
-		}
-		this.runner.stop()
-		return this
-	}
-
-	@Override
-	HttpServerStub registerMappings(Collection<File> stubFiles) {
-		List<RunnerSetting> settings = stubFiles.findAll { it.name.endsWith("json") }
-				.collect {
-			log.info("Trying to parse [{}]", it.name)
-			try {
-				return RunnerSetting.aRunnerSetting().withStream(it.newInputStream()).build()
-			} catch (Exception e) {
-				log.warn("Exception occurred while trying to parse file [{}]", it.name, e)
-				return null
-			}
-		}.findAll { it }
-		this.runner = JsonRunner.newJsonRunnerWithSetting(settings,
-				HttpArgs.httpArgs().withPort(this.port).build())
-		this.runner.run()
-		this.started = true
-		return this
-	}
-
-	@Override
-	String registeredMappings() {
-		return ""
-	}
-
-	@Override
-	boolean isAccepted(File file) {
-		return file.name.endsWith(".json")
-	}
-}

and just register it in your spring.factories file

org.springframework.cloud.contract.stubrunner.HttpServerStub=\
-org.springframework.cloud.contract.stubrunner.provider.moco.MocoHttpServerStub

that way you’ll be able to run stubs using Moco.

[Important]Important

If you don’t provide any implementation then the default one - WireMock based -will be picked. If you provide more than one then the first one on the list will be picked.

2.19.5 Custom Stub Downloader

You can customize the way your stubs are downloaded. It’s enough to create an -implementation of the StubDownloaderBuilder

package com.example;
-
-class CustomStubDownloaderBuilder implements StubDownloaderBuilder {
-
-	@Override
-	public StubDownloader build(final StubRunnerOptions stubRunnerOptions) {
-		return new StubDownloader() {
-			@Override
-			public Map.Entry<StubConfiguration, File> downloadAndUnpackStubJar(
-					StubConfiguration config) {
-				File unpackedStubs = retrieveStubs();
-				return new AbstractMap.SimpleEntry<>(
-						new StubConfiguration(config.getGroupId(), config.getArtifactId(), version,
-								config.getClassifier()), unpackedStubs);
-			}
-
-			File retrieveStubs() {
-			    // here goes your custom logic to provide a folder where all the stubs reside
-			}
-}

and just register it in your spring.factories file

# Example of a custom Stub Downloader Provider
-org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder=\
-com.example.CustomStubDownloaderBuilder

that way you’ll be able to pick a folder with the source of your stubs.

[Important]Important

If you don’t provide any implementation then the default one will be picked. - If you provide repositoryRoot property or workOffline flag then Aether based - that will download stubs from a remote repo will be picked. If you don’t provide these - values then the ClasspathStubProvider will be picked that will scan the classpath. - If you provide more than one, then the first one on the list will be picked.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/_spring_cloud_contract_wiremock.html b/multi/_spring_cloud_contract_wiremock.html index 3f01538822..a5ffb82f50 100644 --- a/multi/_spring_cloud_contract_wiremock.html +++ b/multi/_spring_cloud_contract_wiremock.html @@ -1,92 +1,13 @@ - - - 3. Spring Cloud Contract WireMock

3. Spring Cloud Contract WireMock

Modules giving you the possibility to use -WireMock with different servers by using the -"ambient" server embedded in a Spring Boot application. Check out the -samples -for more details.

[Important]Important

The Spring Cloud Release Train BOM imports spring-cloud-contract-dependencies - which in turn has exclusions for the dependencies needed by WireMock. This might lead to a situation that - even if you’re not using Spring Cloud Contract then your dependencies will be influenced - anyways.

If you have a Spring Boot application that uses Tomcat as an embedded -server, for example (the default with spring-boot-starter-web), then -you can simply add spring-cloud-contract-wiremock to your classpath -and add @AutoConfigureWireMock in order to be able to use Wiremock -in your tests. Wiremock runs as a stub server and you can register -stub behaviour using a Java API or via static JSON declarations as -part of your test. Here’s a simple example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-@AutoConfigureWireMock(port = 0)
-public class WiremockForDocsTests {
-	// A service that calls out over HTTP
-	@Autowired private Service service;
+
 
-	// Using the WireMock APIs in the normal way:
-	@Test
-	public void contextLoads() throws Exception {
-		// Stubbing WireMock
-		stubFor(get(urlEqualTo("/resource"))
-				.willReturn(aResponse().withHeader("Content-Type", "text/plain").withBody("Hello World!")));
-		// We're asserting if WireMock responded properly
-		assertThat(this.service.go()).isEqualTo("Hello World!");
-	}
+
+
 
-}

To start the stub server on a different port use @AutoConfigureWireMock(port=9999) (for example), and for a random port use the value 0. The stub server port will be bindable in the test application context as "wiremock.server.port". Using @AutoConfigureWireMock adds a bean of type WiremockConfiguration to your test application context, where it will be cached in between methods and classes having the same context, just like for normal Spring integration tests.

3.1 Registering Stubs Automatically

If you use @AutoConfigureWireMock then it will register WireMock -JSON stubs from the file system or classpath, by default from -file:src/test/resources/mappings. You can customize the locations -using the stubs attribute in the annotation, which can be a resource -pattern (ant-style) or a directory, in which case */.json is -appended. Example:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureWireMock(stubs="classpath:/stubs")
-public class WiremockImportApplicationTests {
+
 
-	@Autowired
-	private Service service;
+Page Redirection
 
-	@Test
-	public void contextLoads() throws Exception {
-		assertThat(this.service.go()).isEqualTo("Hello World!");
-	}
-
-}
[Note]Note

Actually WireMock always loads mappings from -src/test/resources/mappings as well as the custom locations in the -stubs attribute. To change this behaviour you have to also specify a -files root as described next.

3.2 Using Files to Specify the Stub Bodies

WireMock can read response bodies from files on the classpath or file -system. In that case you will see in the JSON DSL that the response -has a "bodyFileName" instead of a (literal) "body". The files are -resolved relative to a root directory src/test/resources/__files by -default. To customize this location you can set the files attribute -in the @AutoConfigureWireMock annotation to the location of the -parent directory (i.e. the place __files is a -subdirectory). You can use Spring resource notation to refer to -file:…​ or classpath:…​ locations (but generic URLs are not -supported). A list of values can be given and WireMock will resolve -the first file that exists when it needs to find a response body.

[Note]Note

when you configure the files root, then it affects the -automatic loading of stubs as well (they come from the root location -in a subdirectory called "mappings"). The value of files has no -effect on the stubs loaded explicitly from the stubs attribute.

3.3 Alternative: Using JUnit Rules

For a more conventional WireMock experience, using JUnit @Rules to -start and stop the server, just use the WireMockSpring convenience -class to obtain an Options instance:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-public class WiremockForDocsClassRuleTests {
-
-	// Start WireMock on some dynamic port
-	// for some reason `dynamicPort()` is not working properly
-	@ClassRule
-	public static WireMockClassRule wiremock = new WireMockClassRule(
-			WireMockSpring.options().dynamicPort());
-	// A service that calls out over HTTP to localhost:${wiremock.port}
-	@Autowired
-	private Service service;
-
-	// Using the WireMock APIs in the normal way:
-	@Test
-	public void contextLoads() throws Exception {
-		// Stubbing WireMock
-		wiremock.stubFor(get(urlEqualTo("/resource"))
-				.willReturn(aResponse().withHeader("Content-Type", "text/plain").withBody("Hello World!")));
-		// We're asserting if WireMock responded properly
-		assertThat(this.service.go()).isEqualTo("Hello World!");
-	}
-
-}

The use @ClassRule means that the server will shut down after all the methods in this class.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/_wiremock_and_spring_mvc_mocks.html b/multi/_wiremock_and_spring_mvc_mocks.html index 2f2f06631c..a5ffb82f50 100644 --- a/multi/_wiremock_and_spring_mvc_mocks.html +++ b/multi/_wiremock_and_spring_mvc_mocks.html @@ -1,37 +1,13 @@ - - - 5. WireMock and Spring MVC Mocks

5. WireMock and Spring MVC Mocks

Spring Cloud Contract provides a convenience class that can load JSON WireMock stubs into a -Spring MockRestServiceServer. Here’s an example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.NONE)
-public class WiremockForDocsMockServerApplicationTests {
+
 
-	@Autowired
-	private RestTemplate restTemplate;
+
+
 
-	@Autowired
-	private Service service;
+
 
-	@Test
-	public void contextLoads() throws Exception {
-		// will read stubs classpath
-		MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate)
-				.baseUrl("https://example.org").stubs("classpath:/stubs/resource.json")
-				.build();
-		// We're asserting if WireMock responded properly
-		assertThat(this.service.go()).isEqualTo("Hello World");
-		server.verify();
-	}
-}

The baseUrl is prepended to all mock calls, and the stubs() -method takes a stub path resource pattern as an argument. So in this -example the stub defined at /stubs/resource.json is loaded into the -mock server, so if the RestTemplate is asked to visit -https://example.org/ it will get the responses as declared -there. More than one stub pattern can be specified, and each one can -be a directory (for a recursive list of all ".json"), or a fixed -filename (like in the example above) or an ant-style pattern. The JSON -format is the normal WireMock format which you can read about in the -WireMock website.

Currently we support Tomcat, Jetty and Undertow as Spring Boot -embedded servers, and Wiremock itself has "native" support for a -particular version of Jetty (currently 9.2). To use the native Jetty -you need to add the native wiremock dependencies and exclude the -Spring Boot container if there is one.

\ No newline at end of file +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/css/highlight.css b/multi/css/highlight.css deleted file mode 100644 index 3850f8b9e8..0000000000 --- a/multi/css/highlight.css +++ /dev/null @@ -1,35 +0,0 @@ -/* - code highlight CSS resemblign the Eclipse IDE default color schema - @author Costin Leau -*/ - -.hl-keyword { - color: #7F0055; - font-weight: bold; -} - -.hl-comment { - color: #3F5F5F; - font-style: italic; -} - -.hl-multiline-comment { - color: #3F5FBF; - font-style: italic; -} - -.hl-tag { - color: #3F7F7F; -} - -.hl-attribute { - color: #7F007F; -} - -.hl-value { - color: #2A00FF; -} - -.hl-string { - color: #2A00FF; -} \ No newline at end of file diff --git a/multi/css/manual-multipage.css b/multi/css/manual-multipage.css deleted file mode 100644 index b790654b1d..0000000000 --- a/multi/css/manual-multipage.css +++ /dev/null @@ -1,9 +0,0 @@ -@IMPORT url("manual.css"); - -body.firstpage { - background: url("../images/background.png") no-repeat center top; -} - -div.part h1 { - border-top: none; -} diff --git a/multi/css/manual-singlepage.css b/multi/css/manual-singlepage.css deleted file mode 100644 index 303192a8b1..0000000000 --- a/multi/css/manual-singlepage.css +++ /dev/null @@ -1,6 +0,0 @@ -@IMPORT url("manual.css"); - -body { - background: url("../images/background.png") no-repeat center top; -} - diff --git a/multi/css/manual.css b/multi/css/manual.css deleted file mode 100644 index 20cf07dafe..0000000000 --- a/multi/css/manual.css +++ /dev/null @@ -1,342 +0,0 @@ -@IMPORT url("highlight.css"); - -html { - padding: 0pt; - margin: 0pt; -} - -body { - color: #333333; - margin: 15px 30px; - font-family: Helvetica, Arial, Freesans, Clean, Sans-serif; - line-height: 1.6; - -webkit-font-smoothing: antialiased; -} - -code { - font-size: 16px; - font-family: Consolas, "Liberation Mono", Courier, monospace; -} - -:not(a) > code { - color: #6D180B; -} - -:not(pre) > code { - background-color: #F2F2F2; - border: 1px solid #CCCCCC; - border-radius: 4px; - padding: 1px 3px 0; - text-shadow: none; - white-space: nowrap; -} - -body > *:first-child { - margin-top: 0 !important; -} - -div { - margin: 0pt; -} - -hr { - border: 1px solid #CCCCCC; - background: #CCCCCC; -} - -h1, h2, h3, h4, h5, h6 { - color: #000000; - cursor: text; - font-weight: bold; - margin: 30px 0 10px; - padding: 0; -} - -h1, h2, h3 { - margin: 40px 0 10px; -} - -h1 { - margin: 70px 0 30px; - padding-top: 20px; -} - -div.part h1 { - border-top: 1px dotted #CCCCCC; -} - -h1, h1 code { - font-size: 32px; -} - -h2, h2 code { - font-size: 24px; -} - -h3, h3 code { - font-size: 20px; -} - -h4, h1 code, h5, h5 code, h6, h6 code { - font-size: 18px; -} - -div.book, div.chapter, div.appendix, div.part, div.preface { - min-width: 300px; - max-width: 1200px; - margin: 0 auto; -} - -p.releaseinfo { - font-weight: bold; - margin-bottom: 40px; - margin-top: 40px; -} - -div.authorgroup { - line-height: 1; -} - -p.copyright { - line-height: 1; - margin-bottom: -5px; -} - -.legalnotice p { - font-style: italic; - font-size: 14px; - line-height: 1; -} - -div.titlepage + p, div.titlepage + p { - margin-top: 0; -} - -pre { - line-height: 1.0; - color: black; -} - -a { - color: #4183C4; - text-decoration: none; -} - -p { - margin: 15px 0; - text-align: left; -} - -ul, ol { - padding-left: 30px; -} - -li p { - margin: 0; -} - -div.table { - margin: 1em; - padding: 0.5em; - text-align: center; -} - -div.table table, div.informaltable table { - display: table; - width: 100%; -} - -div.table td { - padding-left: 7px; - padding-right: 7px; -} - -.sidebar { - line-height: 1.4; - padding: 0 20px; - background-color: #F8F8F8; - border: 1px solid #CCCCCC; - border-radius: 3px 3px 3px 3px; -} - -.sidebar p.title { - color: #6D180B; -} - -pre.programlisting, pre.screen { - font-size: 15px; - padding: 6px 10px; - background-color: #F8F8F8; - border: 1px solid #CCCCCC; - border-radius: 3px 3px 3px 3px; - clear: both; - overflow: auto; - line-height: 1.4; - font-family: Consolas, "Liberation Mono", Courier, monospace; -} - -table { - border-collapse: collapse; - border-spacing: 0; - border: 1px solid #DDDDDD !important; - border-radius: 4px !important; - border-collapse: separate !important; - line-height: 1.6; -} - -table thead { - background: #F5F5F5; -} - -table tr { - border: none; - border-bottom: none; -} - -table th { - font-weight: bold; -} - -table th, table td { - border: none !important; - padding: 6px 13px; -} - -table tr:nth-child(2n) { - background-color: #F8F8F8; -} - -td p { - margin: 0 0 15px 0; -} - -div.table-contents td p { - margin: 0; -} - -div.important *, div.note *, div.tip *, div.warning *, div.navheader *, div.navfooter *, div.calloutlist * { - border: none !important; - background: none !important; - margin: 0; -} - -div.important p, div.note p, div.tip p, div.warning p { - color: #6F6F6F; - line-height: 1.6; -} - -div.important code, div.note code, div.tip code, div.warning code { - background-color: #F2F2F2 !important; - border: 1px solid #CCCCCC !important; - border-radius: 4px !important; - padding: 1px 3px 0 !important; - text-shadow: none !important; - white-space: nowrap !important; -} - -.note th, .tip th, .warning th { - display: none; -} - -.note tr:first-child td, .tip tr:first-child td, .warning tr:first-child td { - border-right: 1px solid #CCCCCC !important; - padding-top: 10px; -} - -div.calloutlist p, div.calloutlist td { - padding: 0; - margin: 0; -} - -div.calloutlist > table > tbody > tr > td:first-child { - padding-left: 10px; - width: 30px !important; -} - -div.important, div.note, div.tip, div.warning { - margin-left: 0px !important; - margin-right: 20px !important; - margin-top: 20px; - margin-bottom: 20px; - padding-top: 10px; - padding-bottom: 10px; -} - -div.toc { - line-height: 1.2; -} - -dl, dt { - margin-top: 1px; - margin-bottom: 0; -} - -div.toc > dl > dt { - font-size: 32px; - font-weight: bold; - margin: 30px 0 10px 0; - display: block; -} - -div.toc > dl > dd > dl > dt { - font-size: 24px; - font-weight: bold; - margin: 20px 0 10px 0; - display: block; -} - -div.toc > dl > dd > dl > dd > dl > dt { - font-weight: bold; - font-size: 20px; - margin: 10px 0 0 0; -} - -tbody.footnotes * { - border: none !important; -} - -div.footnote p { - margin: 0; - line-height: 1; -} - -div.footnote p sup { - margin-right: 6px; - vertical-align: middle; -} - -div.navheader { - border-bottom: 1px solid #CCCCCC; -} - -div.navfooter { - border-top: 1px solid #CCCCCC; -} - -.title { - margin-left: -1em; - padding-left: 1em; -} - -.title > a { - position: absolute; - visibility: hidden; - display: block; - font-size: 0.85em; - margin-top: 0.05em; - margin-left: -1em; - vertical-align: text-top; - color: black; -} - -.title > a:before { - content: "\00A7"; -} - -.title:hover > a, .title > a:hover, .title:hover > a:hover { - visibility: visible; -} - -.title:focus > a, .title > a:focus, .title:focus > a:focus { - outline: 0; -} diff --git a/multi/images/background.png b/multi/images/background.png deleted file mode 100644 index 15dca6fbe2669fae3609605e49c69cc414f1b6ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18255 zcmZ{Mc{tQ-|NlrKgrcaFbPBDOvWBUg7G=wtim_B8Ysgq;M%hj&Dizr#DKZMBkY&bF zQI^rsG?*CsWEtBu%$S+a=XX!f_xC*4>2RIPIp^}n{kiY^y}jPA_v?1U#_HHA$qkYS z1Y(u>@jq=52vKeDlPn+z~j!r2!xcp@J9rZ zo~ZL*W#N2~h3F^Y#kf z79Vq?HYz92POY^z60RQgu$cgc!baLFp8`pJN$ z)TpgHDYO!o(|FCbF@nU|Z4{PyQT_pWk^4ba(@3pLy~5i|7uwlU`v1B%7(o3njiTd=qKqO7b}K-at&!f*f2n8M46&RIPn?wT2jQCY?} ze6G^KcX(b!Y*uXj(zgAp+m$yS9Gsr>(+F2nC60BdVfIQ`)cSJ{^*od zepxlPa|MUm>e9Vgly6ynJN3^PvB=>&xF()rO3xDmHI z=|xsK0?M48ABv)1&|8*aUyhO2#E8jlc2-#f51xWHc^hUwi&%dc@+wWVCpXJq!}S%S zg>L#^WBV(Qw|v9bo1MW5gc=&srYW_5F+__kX%{Z>&RZmXwCdi!g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ted file mode 100644 index 7d473430b7bec514f7de12f5769fe7c5859e8c5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQC}X^4DKU-G|w_t}fLBA)Suv#nrW z!^h2QnY_`l!BOq-UXEX{m2up>JTQkX)2m zTvF+fTUlI^nXH#utd~++ke^qgmzgTe~DWM4ffP81J diff --git a/multi/images/callouts/2.png b/multi/images/callouts/2.png deleted file mode 100644 index 5d09341b2f6d2ea2d1d5dad5d980f14b4b05dfd2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQxaY7e*=hH)_rZeB4|imU1$R#1`!P>&$poQl;nzm}mD5ZFopaX|GsS%q*{P~< z;WtmO%lhToBL0i}yfkaOt?EN=nkLNGuU`ywhI5H)L`iUdT1k0gQ7VIjhO(w-Zen_> zZ(@38a<+nro{^q~f~BRtfrY+-p+a&|W^qZSLvCepNoKNMYO!8QX+eHoiC%Jk?!;Y+ zJAlS%fsM;d&r2*R1)67JkeZlkYGj#gX_9E3W@4U_nw*@Ln38B@k(iuhnUeN2eF0kK0(Y1u|9Rc(19XFPiEBhjaDG}zd16s2gM)^$re|(qda7?? zdS-IAf{C7yo`r&?rM`iMzJZ}aa#3b+Nu@(>WpPPnvR-PjUP@^}eqM=Qa(?c_U5Yz^ z#%Y0#%S_KpEGY$=XJL?(l#*ybuErX#^g`ttQfwnX4x42*}TIo_3IbsoNRf>aVMfsJ4-Q{^hZZrE#!3~DHIyIo;*1&0#S#R8GXWt43k48;BRp7)N)S|- z1>C&kGA0Xf^G^6@Z7$n zMFutQvv~;*MUZYF%!pN!TPX!dM|v*>m&a&)K+gzU_K;pxx#tfwf0eF z{6Aql)Y@kWdT@am_mNw@Hu^kjk`}>q?S9@-*pQ9}E$|ZbpD$ zJ7Gs5k(91tmKe$sLWmTGr7Bn~6>1?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$9i&DZ~hSKGgD<3Nr~x0crR x@l@~8v%fudb7|Fs)}6WGzYSl#_Wjpr@eu7sVJhKCFm=a%+M#HR diff --git a/multi/images/logo.png b/multi/images/logo.png deleted file mode 100644 index ade2ce6ed9d9e9f2f4d9c5729a252ee618a0a5a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4387 zcmV+;5!~*HP){P%3MJaDx_;_%u2|NZg!>}aqze!Nxc^y8Ao zaMb9>c)3l4zg^w!(u~7spv{7=)Rn#5sM+hyw%MSF!DHa>*1_JcqtAwz$$7Kao2k-{ z$Ktlp=fbSilJ55Bz}~Eo#%^5i?uh^Z5MW6}K~#90-Cc>2qDT-G%qj|s`%n~65K#I5 zADlwl_5$Q6z@8Veu^l@*Ej;tC%&f&?en^rmW8G4Bfs-$nj#hCGIahUzrMVw+I%xQ$E)R)G83X}t`1ui)Ke0b?i}V~=x;*#OP5^AJ z_OVA5<-$S(*dHs3nS@MY=6>c;q3@Q*^@Wc{Iv$8o7%%=lu>Mmu!n-W>7#}U^c;JPI zcIceuet!P2`VsO2g}6x=;JIIdC*&i)%=!Asvn$`C@XK&1|;bH5D_ z=zH7c!N>)KddJ;g59siDEplU|gd&)!`j@>B<Ren; zZ&4m;WDi^gpt1Gv2zv@ph@g01qCEH@j_rY~NI}KjsHjX%MJEA4+|NkF9jCN)QIRhc zFaLQ2c|!z};lxO_~%A+Qex!?*?#BCYPpKKPI zY^8;41BlDH8Ck6C87V0(Eh9w^6@ery;@8d~7@N5%3D&bI&W)5%c0@q##k7>lV_Tmd zdSptXnJFnrN!I{yxMakbDUX|fdg@WJnp;XPU|!EiuDPM4^)e9poGEjf}cm) zQ6T<|r>a)+C6s`;zm+8Q0)h9IA5I2+zPRKWK##xWH90f{l+8s6PUi_;-+}yxY%qW_ zpq+;jDIBj9-3_RCtVLQ8Qlfc6S#9Zl2_?oe1NdkN)R~2omG>pa#E4!j>XLcm?Homv z)0|1pBko@KhMk9$WCm|6Z@xrINc5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hoxwB1(AEW4FUD!|NXj~KfSs|_Fs$T!y-36evJ^Z?6}3=Q?-U<6r^xvteF z9r!imY+~MwU-%rjeD#Bk@DU*X&T~;_% zenSheBq=Iz?4{Z#4cNNjar1}zz0jUsoPci0!no+g@^+yo%5ah9{j;mzFd1rL!Y&8l zTcPoDx0T`Z2sq=}{oZK(3GcIQY0PHx{;A1jk*Ze*>yYhwtCJ#z51zrUV6=9neF>Tj za3FoTO{AkOuKerT6)(lGo3$TPQ}!;Q?aWssvEM=(Pa-<`znbSTZXGnvGr$2;U9?y` zsu`2*)*nCq-&6EN@cZ_3HSfn5Ay0f*WpOcVpb%;i>MGA5N_GZ{HMwY%a!Ob|hWgjf z$pY70(mcj`EiQ$kDi*Jib@TVnAG`ByK@A8~+|`>5k6kmDkThu-Q-}us@~e<9VUgdf zy}!V=eJ=&K3?NWcW&sON5mk_^=T?`zS(ebGpq;qag@s-x+&uf%a1#3;$S%b17byOd znx@Jylv+n^O+Jo1yPq)lIa-4`Rf0#8ZCx%@b<7qE_Jk9hL^ zZec%GvSPdTi#9C}$+(T>r7O+b{L5Bhh7ie1{JE_X>|?8u2rYg{r-!I|P#sH6N;Hv0 z?sC66W%n)`B>OyOyB%>YeAaZzZ9KO4_hljXs|53h zPjJg5k`dmfiKH8a5BVJe9K8$ka%g Gh5jGOsoGNj diff --git a/multi/images/tip.png b/multi/images/tip.png deleted file mode 100644 index 6530abb4b5a5d68e3b1c98de512d264c1f8ba883..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 931 zcmV;U16=%xP)bSEogsT%F|x0xuT7xdRv7>Rev?4wv{qrDN}+xS$8V5!!ga&#Y1*BgqL?&c}jPc zG_JlfMSD5I%DQQcHXTbGWQtKpeL6yAB|UI5CQ=~#`}=c}Um;E%R)9u^qI0>&GHQ-g zOm;DCkym+{WF$}@UWrV1mtnTPtu!WtY$r7BOpo|N_#mqWGhK#KR0MD7eW*yPaY&xBTRfcG-E5p&`2dq z875XFdy+3GStd(wD_Mg`dys8Xd_houJju_&*4)mZt2Tk1H)DTRJY^_lf>>*ZU2Th5 zWQ3Ly{;kf91GM2s4Vfv8a-fcsXpb+4t> zmM%11X*>M&PQZNVdARf4d*2x!aq1>jOzQ?>>R)(Ok;sOJ)7jfk$Fdif23? z-}3V78&9qod*O;uGk%fEW^;|k`Lo>bOq2iF72o-IGb2gTw+4B~#iYz(oL}sS7|$R2 zDGfrR{|@~AQJ&v(#4u|ZtJP}t520N48P!$8U;|Vfuq=8>E$w`o2Jf`%eqhqbr%IH1zV?O3uDWqKZId-wMQ*MFefpD5X*w@ zok{kNA?%%$F{M!OUcE^^x{~(wkHK|_*9Yg`KNS88FaVH_sda1Xfs6nE002ovPDHLk FV1jwin)(0$ diff --git a/multi/images/warning.png b/multi/images/warning.png deleted file mode 100644 index 0d5b5244605adbb7ab05a1549746a9c35490f95b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2130 zcmbVNYg7|w8V(4q($)50y>JmGlLW#g$xLn}Vd2Si)}#|ptPAQp3Bp-3!-lL0;i^LY?;i#f0m5s49g z3h?3rDQg~EDPlm?FKkgKIcWEK-3X6YU0uzs7H|nq84s39r2!5;pF?SI$QqXy^Ko1x zV~zpENvp@<_Bsd`5MabC#3rvCq&$5dg43yGR zAdy0-rWjC#a1N_+kzUMY#pmogD7!DP(9dEKr3c5ngvUq_6>}Y+w-a81v=eSXnIi_+ zI?U>D1q2C!0zHox#XXKH+@|&rPT*OF5yvY$5J|)WwLqnU)c-5;=UChSlQkaY3@^|g z|J5#YBB}=i+n3Ex9bS$P?xJSKLk)-HHII@;3qG#TG^!+aj>0QkO~7kB0+|yM;YrGB zF>Ge@isQ#73%Tp#k_(tInh3U$uJWY-+DND*o}L-CB5g@#9YWWw~pxZ!Obm>yN#ZHFvL0zA3vNCTJ=t?)~`2O1M{L6un=ml<2x zQEYfifmA?Pz0tqRs^2Utt1pU0BQB1eIY0U_I}c1Y#PP7Ci5s7#IJn}xK{G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5ffb82f50 100644 --- a/multi/multi__contract_dsl.html +++ b/multi/multi__contract_dsl.html @@ -1,1949 +1,13 @@ - - - 8. Contract DSL

8. Contract DSL

Spring Cloud Contract supports out of the box 2 types of DSL. One written in -Groovy and one written in YAML.

If you decide to write the contract in Groovy, do not be alarmed if you have not used Groovy -before. Knowledge of the language is not really needed, as the Contract DSL uses only a -tiny subset of it (only literals, method calls and closures). Also, the DSL is statically -typed, to make it programmer-readable without any knowledge of the DSL itself.

[Important]Important

Remember that, inside the Groovy contract file, you have to provide the fully -qualified name to the Contract class and make static imports, such as -org.springframework.cloud.spec.Contract.make { …​ }. You can also provide an import to -the Contract class: import org.springframework.cloud.spec.Contract and then call -Contract.make { …​ }.

[Tip]Tip

Spring Cloud Contract supports defining multiple contracts in a single file.

The following is a complete example of a Groovy contract definition:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url '/api/12'
-		headers {
-			header 'Content-Type': 'application/vnd.org.springframework.cloud.contract.verifier.twitter-places-analyzer.v1+json'
-		}
-		body '''\
-		[{
-			"created_at": "Sat Jul 26 09:38:57 +0000 2014",
-			"id": 492967299297845248,
-			"id_str": "492967299297845248",
-			"text": "Gonna see you at Warsaw",
-			"place":
-			{
-				"attributes":{},
-				"bounding_box":
-				{
-					"coordinates":
-						[[
-							[-77.119759,38.791645],
-							[-76.909393,38.791645],
-							[-76.909393,38.995548],
-							[-77.119759,38.995548]
-						]],
-					"type":"Polygon"
-				},
-				"country":"United States",
-				"country_code":"US",
-				"full_name":"Washington, DC",
-				"id":"01fbe706f872cb32",
-				"name":"Washington",
-				"place_type":"city",
-				"url": "https://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
-			}
-		}]
-	'''
-	}
-	response {
-		status OK()
-	}
-}

The following is a complete example of a YAML contract definition:

description: Some description
-name: some name
-priority: 8
-ignored: true
-request:
-  url: /foo
-  queryParameters:
-    a: b
-    b: c
-  method: PUT
-  headers:
-    foo: bar
-    fooReq: baz
-  body:
-    foo: bar
-  matchers:
-    body:
-      - path: $.foo
-        type: by_regex
-        value: bar
-    headers:
-      - key: foo
-        regex: bar
-response:
-  status: 200
-  headers:
-    foo2: bar
-    foo3: foo33
-    fooRes: baz
-  body:
-    foo2: bar
-    foo3: baz
-    nullValue: null
-  matchers:
-    body:
-      - path: $.foo2
-        type: by_regex
-        value: bar
-      - path: $.foo3
-        type: by_command
-        value: executeMe($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-    headers:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        command: andMeToo($it)
[Tip]Tip

You can compile contracts to stubs mapping using standalone maven command: -mvn org.springframework.cloud:spring-cloud-contract-maven-plugin:convert

8.1 Limitations

[Warning]Warning

Spring Cloud Contract Verifier does not properly support XML. Please use JSON or -help us implement this feature.

[Warning]Warning

The support for verifying the size of JSON arrays is experimental. If you want -to turn it on, please set the value of the following system property to true: -spring.cloud.contract.verifier.assert.size. By default, this feature is set to false. -You can also provide the assertJsonSize property in the plugin configuration.

[Warning]Warning

Because JSON structure can have any form, it can be impossible to parse it -properly when using the Groovy DSL and the value(consumer(…​), producer(…​)) notation in GString. That -is why you should use the Groovy Map notation.

8.2 Common Top-Level elements

The following sections describe the most common top-level elements:

8.2.1 Description

You can add a description to your contract. The description is arbitrary text. The -following code shows an example:

Groovy DSL.  -

		org.springframework.cloud.contract.spec.Contract.make {
-			description('''
-given:
-	An input
-when:
-	Sth happens
-then:
-	Output
-''')
-		}

-

YAML.  -

description: Some description
-name: some name
-priority: 8
-ignored: true
-request:
-  url: /foo
-  queryParameters:
-    a: b
-    b: c
-  method: PUT
-  headers:
-    foo: bar
-    fooReq: baz
-  body:
-    foo: bar
-  matchers:
-    body:
-      - path: $.foo
-        type: by_regex
-        value: bar
-    headers:
-      - key: foo
-        regex: bar
-response:
-  status: 200
-  headers:
-    foo2: bar
-    foo3: foo33
-    fooRes: baz
-  body:
-    foo2: bar
-    foo3: baz
-    nullValue: null
-  matchers:
-    body:
-      - path: $.foo2
-        type: by_regex
-        value: bar
-      - path: $.foo3
-        type: by_command
-        value: executeMe($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-    headers:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        command: andMeToo($it)

-

8.2.2 Name

You can provide a name for your contract. Assume that you provided the following name: -should register a user. If you do so, the name of the autogenerated test is -validate_should_register_a_user. Also, the name of the stub in a WireMock stub is -should_register_a_user.json.

[Important]Important

You must ensure that the name does not contain any characters that make the -generated test not compile. Also, remember that, if you provide the same name for -multiple contracts, your autogenerated tests fail to compile and your generated stubs -override each other.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	name("some_special_name")
-}

-

YAML.  -

name: some name

-

8.2.3 Ignoring Contracts

If you want to ignore a contract, you can either set a value of ignored contracts in the -plugin configuration or set the ignored property on the contract itself:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	ignored()
-}

-

YAML.  -

ignored: true

-

8.2.4 Passing Values from Files

Starting with version 1.2.0, you can pass values from files. Assume that you have the -following resources in our project.

└── src
-    └── test
-        └── resources
-            └── contracts
-                ├── readFromFile.groovy
-                ├── request.json
-                └── response.json

Further assume that your contract is as follows:

Groovy DSL.  -

import org.springframework.cloud.contract.spec.Contract
+
 
-Contract.make {
-	request {
-		method('PUT')
-		headers {
-			contentType(applicationJson())
-		}
-		body(file("request.json"))
-		url("/1")
-	}
-	response {
-		status OK()
-		body(file("response.json"))
-		headers {
-			contentType(textPlain())
-		}
-	}
-}

-

YAML.  -

request:
-  method: GET
-  url: /foo
-  bodyFromFile: request.json
-response:
-  status: 200
-  bodyFromFile: response.json

-

Further assume that the JSON files is as follows:

request.json

{ "status" : "REQUEST" }

response.json

{ "status" : "RESPONSE" }

When test or stub generation takes place, the contents of the file is passed to the body -of a request or a response. The name of the file needs to be a file with location -relative to the folder in which the contract lays.

8.2.5 HTTP Top-Level Elements

The following methods can be called in the top-level closure of a contract definition. -request and response are mandatory. priority is optional.

Groovy DSL.  -

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).
-	request {
-		//...
-	}
+
+
 
-	// Definition of HTTP response part of the contract
-	// (a service implementing this contract should respond
-	// with following response after receiving request
-	// specified in "request" part above).
-	response {
-		//...
-	}
+
 
-	// Contract priority, which can be used for overriding
-	// contracts (1 is highest). Priority is optional.
-	priority 1
-}

-

YAML.  -

priority: 8
-request:
-...
-response:
-...

-

[Important]Important

If you want to make your contract have a higher value of priority -you need to pass a lower number to the priority tag / method. E.g. priority with -value 5 has higher priority than priority with value 10.

8.3 Request

The HTTP protocol requires only method and url to be specified in a request. The -same information is mandatory in request definition of the Contract.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		// HTTP request method (GET/POST/PUT/DELETE).
-		method 'GET'
+Page Redirection
 
-		// Path component of request URL is specified as follows.
-		urlPath('/users')
-	}
-
-	response {
-		//...
-	}
-}

-

YAML.  -

method: PUT
-url: /foo

-

It is possible to specify an absolute rather than relative url, but using urlPath is -the recommended way, as doing so makes the tests host-independent.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'GET'
-
-		// Specifying `url` and `urlPath` in one contract is illegal.
-		url('http://localhost:8888/users')
-	}
-
-	response {
-		//...
-	}
-}

-

YAML.  -

request:
-  method: PUT
-  urlPath: /foo

-

request may contain query parameters.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-
-		urlPath('/users') {
-
-			// Each parameter is specified in form
-			// `'paramName' : paramValue` where parameter value
-			// may be a simple literal or one of matcher functions,
-			// all of which are used in this example.
-			queryParameters {
-
-				// If a simple literal is used as value
-				// default matcher function is used (equalTo)
-				parameter 'limit': 100
-
-				// `equalTo` function simply compares passed value
-				// using identity operator (==).
-				parameter 'filter': equalTo("email")
-
-				// `containing` function matches strings
-				// that contains passed substring.
-				parameter 'gender': value(consumer(containing("[mf]")), producer('mf'))
-
-				// `matching` function tests parameter
-				// against passed regular expression.
-				parameter 'offset': value(consumer(matching("[0-9]+")), producer(123))
-
-				// `notMatching` functions tests if parameter
-				// does not match passed regular expression.
-				parameter 'loginStartsWith': value(consumer(notMatching(".{0,2}")), producer(3))
-			}
-		}
-
-		//...
-	}
-
-	response {
-		//...
-	}
-}

-

YAML.  -

request:
-...
-  queryParameters:
-    a: b
-    b: c
-  headers:
-    foo: bar
-    fooReq: baz
-  cookies:
-    foo: bar
-    fooReq: baz
-  body:
-    foo: bar
-  matchers:
-    body:
-      - path: $.foo
-        type: by_regex
-        value: bar
-    headers:
-      - key: foo
-        regex: bar
-response:
-  status: 200
-  headers:
-    foo2: bar
-    foo3: foo33
-    fooRes: baz
-  body:
-    foo2: bar
-    foo3: baz
-    nullValue: null
-  matchers:
-    body:
-      - path: $.foo2
-        type: by_regex
-        value: bar
-      - path: $.foo3
-        type: by_command
-        value: executeMe($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-    headers:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        command: andMeToo($it)
-    cookies:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        predefined:

-

request may contain additional request headers, as shown in the following example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-
-		// Each header is added in form `'Header-Name' : 'Header-Value'`.
-		// there are also some helper methods
-		headers {
-			header 'key': 'value'
-			contentType(applicationJson())
-		}
-
-		//...
-	}
-
-	response {
-		//...
-	}
-}

-

YAML.  -

request:
-...
-headers:
-  foo: bar
-  fooReq: baz

-

request may contain additional request cookies, as shown in the following example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-
-		// Each Cookies is added in form `'Cookie-Key' : 'Cookie-Value'`.
-		// there are also some helper methods
-		cookies {
-			cookie 'key': 'value'
-			cookie('another_key', 'another_value')
-		}
-
-		//...
-	}
-
-	response {
-		//...
-	}
-}

-

YAML.  -

request:
-...
-cookies:
-  foo: bar
-  fooReq: baz

-

request may contain a request body:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-
-		// Currently only JSON format of request body is supported.
-		// Format will be determined from a header or body's content.
-		body '''{ "login" : "john", "name": "John The Contract" }'''
-	}
-
-	response {
-		//...
-	}
-}

-

YAML.  -

request:
-...
-body:
-  foo: bar

-

request may contain multipart elements. To include multipart elements, use the -multipart method/section, as shown in the following examples

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract contractDsl = org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method "PUT"
-		url "/multipart"
-		headers {
-			contentType('multipart/form-data;boundary=AaB03x')
-		}
-		multipart(
-				// key (parameter name), value (parameter value) pair
-				formParameter: $(c(regex('".+"')), p('"formParameterValue"')),
-				someBooleanParameter: $(c(regex(anyBoolean())), p('true')),
-				// a named parameter (e.g. with `file` name) that represents file with
-				// `name` and `content`. You can also call `named("fileName", "fileContent")`
-				file: named(
-						// name of the file
-						name: $(c(regex(nonEmpty())), p('filename.csv')),
-						// content of the file
-						content: $(c(regex(nonEmpty())), p('file content')),
-						// content type for the part
-						contentType: $(c(regex(nonEmpty())), p('application/json')))
-		)
-	}
-	response {
-		status OK()
-	}
-}
-org.springframework.cloud.contract.spec.Contract contractDsl = org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method "PUT"
-		url "/multipart"
-		headers {
-			contentType('multipart/form-data;boundary=AaB03x')
-		}
-		multipart(
-				file: named(
-						name: value(stub(regex('.+')), test('file')),
-						content: value(stub(regex('.+')), test([100, 117, 100, 97] as byte[]))
-				)
-		)
-	}
-	response {
-		status 200
-	}
-}

-

YAML.  -

request:
-  method: PUT
-  url: /multipart
-  headers:
-    Content-Type: multipart/form-data;boundary=AaB03x
-  multipart:
-    params:
-    # key (parameter name), value (parameter value) pair
-      formParameter: '"formParameterValue"'
-      someBooleanParameter: true
-    named:
-      - paramName: file
-        fileName: filename.csv
-        fileContent: file content
-  matchers:
-    multipart:
-      params:
-        - key: formParameter
-          regex: ".+"
-        - key: someBooleanParameter
-          predefined: any_boolean
-      named:
-        - paramName: file
-          fileName:
-            predefined: non_empty
-          fileContent:
-            predefined: non_empty
-response:
-  status: 200

-

In the preceding example, we define parameters in either of two ways:

Groovy DSL

  • Directly, by using the map notation, where the value can be a dynamic property (such as -formParameter: $(consumer(…​), producer(…​))).
  • By using the named(…​) method that lets you set a named parameter. A named parameter -can set a name and content. You can call it either via a method with two arguments, -such as named("fileName", "fileContent"), or via a map notation, such as -named(name: "fileName", content: "fileContent").

YAML

  • The multipart parameters are set via multipart.params section
  • The named parameters (the fileName and fileContent for a given parameter name) -can be set via the multipart.named section. That section contains -the paramName (name of the parameter), fileName (name of the file), -fileContent (content of the file) fields
  • The dynamic bits can be set via the matchers.multipart section

    • for parameters use the params section that can accept -regex or a predefined regular expression
    • for named params use the named section where first you -define the parameter name via paramName and then you can pass the -parametrization of either fileName or fileContent via -regex or a predefined regular expression

From this contract, the generated test is as follows:

// given:
- MockMvcRequestSpecification request = given()
-   .header("Content-Type", "multipart/form-data;boundary=AaB03x")
-   .param("formParameter", "\"formParameterValue\"")
-   .param("someBooleanParameter", "true")
-   .multiPart("file", "filename.csv", "file content".getBytes());
-
-// when:
- ResponseOptions response = given().spec(request)
-   .put("/multipart");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);

The WireMock stub is as follows:

			'''
-{
-  "request" : {
-	"url" : "/multipart",
-	"method" : "PUT",
-	"headers" : {
-	  "Content-Type" : {
-		"matches" : "multipart/form-data;boundary=AaB03x.*"
-	  }
-	},
-	"bodyPatterns" : [ {
-		"matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"formParameter\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Transfer-Encoding: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n\\".+\\"\\r\\n--\\\\1.*"
-  		}, {
-    			"matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"someBooleanParameter\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Transfer-Encoding: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n(true|false)\\r\\n--\\\\1.*"
-  		}, {
-	  "matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"file\\"; filename=\\"[\\\\S\\\\s]+\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Transfer-Encoding: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n[\\\\S\\\\s]+\\r\\n--\\\\1.*"
-	} ]
-  },
-  "response" : {
-	"status" : 200,
-	"transformers" : [ "response-template", "foo-transformer" ]
-  }
-}
-	'''

8.4 Response

The response must contain an HTTP status code and may contain other information. The -following code shows an example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-	}
-	response {
-		// Status code sent by the server
-		// in response to request specified above.
-		status OK()
-	}
-}

-

YAML.  -

response:
-...
-status: 200

-

Besides status, the response may contain headers, cookies and a body, both of which are -specified the same way as in the request (see the previous paragraph).

[Tip]Tip

Via the Groovy DSL you can reference the org.springframework.cloud.contract.spec.internal.HttpStatus -methods to provide a meaningful status instead of a digit. E.g. you can call -OK() for a status 200 or BAD_REQUEST() for 400.

8.5 Dynamic properties

The contract can contain some dynamic properties: timestamps, IDs, and so on. You do not -want to force the consumers to stub their clocks to always return the same value of time -so that it gets matched by the stub.

For Groovy DSL you can provide the dynamic parts in your contracts -in two ways: pass them directly in the body or set them in a separate section called -bodyMatchers.

[Note]Note

Before 2.0.0 these were set using testMatchers and stubMatchers, -check out the migration guide for more information.

For YAML you can only use the matchers section.

8.5.1 Dynamic properties inside the body

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

You can set the properties inside the body either with the value method or, if you use -the Groovy map notation, with $(). The following example shows how to set dynamic -properties with the value method:

value(consumer(...), producer(...))
-value(c(...), p(...))
-value(stub(...), test(...))
-value(client(...), server(...))

The following example shows how to set dynamic properties with $():

$(consumer(...), producer(...))
-$(c(...), p(...))
-$(stub(...), test(...))
-$(client(...), server(...))

Both approaches work equally well. stub and client methods are aliases over the consumer -method. Subsequent sections take a closer look at what you can do with those values.

8.5.2 Regular expressions

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

You can use regular expressions to write your requests in Contract DSL. Doing so is -particularly useful when you want to indicate that a given response should be provided -for requests that follow a given pattern. Also, you can use regular expressions when you -need to use patterns and not exact values both for your test and your server side tests.

The following example shows how to use regular expressions to write a request:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method('GET')
-		url $(consumer(~/\/[0-9]{2}/), producer('/12'))
-	}
-	response {
-		status OK()
-		body(
-				id: $(anyNumber()),
-				surname: $(
-						consumer('Kowalsky'),
-						producer(regex('[a-zA-Z]+'))
-				),
-				name: 'Jan',
-				created: $(consumer('2014-02-02 12:23:43'), producer(execute('currentDate(it)'))),
-				correlationId: value(consumer('5d1f9fef-e0dc-4f3d-a7e4-72d2220dd827'),
-						producer(regex('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}'))
-				)
-		)
-		headers {
-			header 'Content-Type': 'text/plain'
-		}
-	}
-}

You can also provide only one side of the communication with a regular expression. If you -do so, then the contract engine automatically provides the generated string that matches -the provided regular expression. The following code shows an example:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url value(consumer(regex('/foo/[0-9]{5}')))
-		body([
-			requestElement: $(consumer(regex('[0-9]{5}')))
-		])
-		headers {
-			header('header', $(consumer(regex('application\\/vnd\\.fraud\\.v1\\+json;.*'))))
-		}
-	}
-	response {
-		status OK()
-		body([
-			responseElement: $(producer(regex('[0-9]{7}')))
-		])
-		headers {
-			contentType("application/vnd.fraud.v1+json")
-		}
-	}
-}

In the preceding example, the opposite side of the communication has the respective data -generated for request and response.

Spring Cloud Contract comes with a series of predefined regular expressions that you can -use in your contracts, as shown in the following example:

protected static final Pattern TRUE_OR_FALSE = Pattern.compile(/(true|false)/)
-protected static final Pattern ALPHA_NUMERIC = Pattern.compile('[a-zA-Z0-9]+')
-protected static final Pattern ONLY_ALPHA_UNICODE = Pattern.compile(/[\p{L}]*/)
-protected static final Pattern NUMBER = Pattern.compile('-?(\\d*\\.\\d+|\\d+)')
-protected static final Pattern INTEGER = Pattern.compile('-?(\\d+)')
-protected static final Pattern POSITIVE_INT = Pattern.compile('([1-9]\\d*)')
-protected static final Pattern DOUBLE = Pattern.compile('-?(\\d*\\.\\d+)')
-protected static final Pattern HEX = Pattern.compile('[a-fA-F0-9]+')
-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])')
-protected static final Pattern HOSTNAME_PATTERN = Pattern.compile('((http[s]?|ftp):/)/?([^:/\\s]+)(:[0-9]{1,5})?')
-protected static final Pattern EMAIL = Pattern.compile('[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}')
-protected static final Pattern URL = UrlHelper.URL
-protected static final Pattern HTTPS_URL = UrlHelper.HTTPS_URL
-protected static final Pattern UUID = Pattern.compile('[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}')
-protected static final Pattern ANY_DATE = Pattern.compile('(\\d\\d\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])')
-protected static final Pattern ANY_DATE_TIME = Pattern.compile('([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])')
-protected static final Pattern ANY_TIME = Pattern.compile('(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])')
-protected static final Pattern NON_EMPTY = Pattern.compile(/[\S\s]+/)
-protected static final Pattern NON_BLANK = Pattern.compile(/^\s*\S[\S\s]*/)
-protected static final Pattern ISO8601_WITH_OFFSET = Pattern.compile(/([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.\d{3})?(Z|[+-][01]\d:[0-5]\d)/)
-
-protected static Pattern anyOf(String... values){
-	return Pattern.compile(values.collect({"^$it\$"}).join("|"))
-}
-
-Pattern onlyAlphaUnicode() {
-	return ONLY_ALPHA_UNICODE
-}
-
-Pattern alphaNumeric() {
-	return ALPHA_NUMERIC
-}
-
-Pattern number() {
-	return NUMBER
-}
-
-Pattern positiveInt() {
-	return POSITIVE_INT
-}
-
-Pattern anyBoolean() {
-	return TRUE_OR_FALSE
-}
-
-Pattern anInteger() {
-	return INTEGER
-}
-
-Pattern aDouble() {
-	return DOUBLE
-}
-
-Pattern ipAddress() {
-	return IP_ADDRESS
-}
-
-Pattern hostname() {
-	return HOSTNAME_PATTERN
-}
-
-Pattern email() {
-	return EMAIL
-}
-
-Pattern url() {
-	return URL
-}
-
-Pattern httpsUrl() {
-	return HTTPS_URL
-}
-
-Pattern uuid(){
-	return UUID
-}
-
-Pattern isoDate() {
-	return ANY_DATE
-}
-
-Pattern isoDateTime() {
-	return ANY_DATE_TIME
-}
-
-Pattern isoTime() {
-	return ANY_TIME
-}
-
-Pattern iso8601WithOffset() {
-	return ISO8601_WITH_OFFSET
-}
-
-Pattern nonEmpty() {
-	return NON_EMPTY
-}
-
-Pattern nonBlank() {
-	return NON_BLANK
-}

In your contract, you can use it as shown in the following example:

Contract dslWithOptionalsInString = Contract.make {
-	priority 1
-	request {
-		method POST()
-		url '/users/password'
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
-				callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
-		)
-	}
-	response {
-		status 404
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				code: value(consumer("123123"), producer(optional("123123"))),
-				message: "User not found by email = [${value(producer(regex(email())), consumer('not.existing@user.com'))}]"
-		)
-	}
-}

8.5.3 Passing Optional Parameters

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

It is possible to provide optional parameters in your contract. However, you can provide -optional parameters only for the following:

  • STUB side of the Request
  • TEST side of the Response

The following example shows how to provide optional parameters:

org.springframework.cloud.contract.spec.Contract.make {
-	priority 1
-	request {
-		method 'POST'
-		url '/users/password'
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
-				callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
-		)
-	}
-	response {
-		status 404
-		headers {
-			header 'Content-Type': 'application/json'
-		}
-		body(
-				code: value(consumer("123123"), producer(optional("123123")))
-		)
-	}
-}

By wrapping a part of the body with the optional() method, you create a regular -expression that must be present 0 or more times.

If you use Spock for, the following test would be generated from the previous example:

"""
- given:
-  def request = given()
-    .header("Content-Type", "application/json")
-    .body('''{"email":"abc@abc.com","callback_url":"http://partners.com"}''')
-
- when:
-  def response = given().spec(request)
-    .post("/users/password")
-
- then:
-  response.statusCode == 404
-  response.header('Content-Type')  == 'application/json'
- and:
-  DocumentContext parsedJson = JsonPath.parse(response.body.asString())
-  assertThatJson(parsedJson).field("['code']").matches("(123123)?")
-"""

The following stub would also be generated:

'''
-{
-  "request" : {
-	"url" : "/users/password",
-	"method" : "POST",
-	"bodyPatterns" : [ {
-	  "matchesJsonPath" : "$[?(@.['email'] =~ /([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,6})?/)]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.['callback_url'] =~ /((http[s]?|ftp):\\\\/)\\\\/?([^:\\\\/\\\\s]+)(:[0-9]{1,5})?/)]"
-	} ],
-	"headers" : {
-	  "Content-Type" : {
-		"equalTo" : "application/json"
-	  }
-	}
-  },
-  "response" : {
-	"status" : 404,
-	"body" : "{\\"code\\":\\"123123\\",\\"message\\":\\"User not found by email == [not.existing@user.com]\\"}",
-	"headers" : {
-	  "Content-Type" : "application/json"
-	}
-  },
-  "priority" : 1
-}
-'''

8.5.4 Executing Custom Methods on the Server Side

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

You can define a method call that executes on the server side during the test. Such a -method can be added to the class defined as "baseClassForTests" in the configuration. The -following code shows an example of the contract portion of the test case:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url $(consumer(regex('^/api/[0-9]{2}$')), producer('/api/12'))
-		headers {
-			header 'Content-Type': 'application/json'
-		}
-		body '''\
-				[{
-					"text": "Gonna see you at Warsaw"
-				}]
-			'''
-	}
-	response {
-		body (
-				path: $(consumer('/api/12'), producer(regex('^/api/[0-9]{2}$'))),
-				correlationId: $(consumer('1223456'), producer(execute('isProperCorrelationId($it)')))
-		)
-		status OK()
-	}
-}

The following code shows the base class portion of the test case:

abstract class BaseMockMvcSpec extends Specification {
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new PairIdController())
-	}
-
-	void isProperCorrelationId(Integer correlationId) {
-		assert correlationId == 123456
-	}
-
-	void isEmpty(String value) {
-		assert value == null
-	}
-
-}
[Important]Important

You cannot use both a String and execute to perform concatenation. For -example, calling header('Authorization', 'Bearer ' + execute('authToken()')) leads to -improper results. Instead, call header('Authorization', execute('authToken()')) and -ensure that the authToken() method returns everything you need.

The type of the object read from the JSON can be one of the following, depending on the -JSON path:

  • String: If you point to a String value in the JSON.
  • JSONArray: If you point to a List in the JSON.
  • Map: If you point to a Map in the JSON.
  • Number: If you point to Integer, Double etc. in the JSON.
  • Boolean: If you point to a Boolean in the JSON.

In the request part of the contract, you can specify that the body should be taken from -a method.

[Important]Important

You must provide both the consumer and the producer side. The execute part -is applied for the whole body - not for parts of it.

The following example shows how to read an object from JSON:

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		url '/something'
-		body(
-				$(c("foo"), p(execute("hashCode()")))
-		)
-	}
-	response {
-		status OK()
-	}
-}

The preceding example results in calling the hashCode() method in the request body. -It should resemble the following code:

// given:
- MockMvcRequestSpecification request = given()
-   .body(hashCode());
-
-// when:
- ResponseOptions response = given().spec(request)
-   .get("/something");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);

8.5.5 Referencing the Request from the Response

The best situation is to provide fixed values, but sometimes you need to reference a -request in your response.

If you’re writing contracts using Groovy DSL, you can use the fromRequest() method, which lets -you reference a bunch of elements from the HTTP request. You can use the following -options:

  • fromRequest().url(): Returns the request URL and query parameters.
  • fromRequest().query(String key): Returns the first query parameter with a given name.
  • fromRequest().query(String key, int index): Returns the nth query parameter with a -given name.
  • fromRequest().path(): Returns the full path.
  • fromRequest().path(int index): Returns the nth path element.
  • fromRequest().header(String key): Returns the first header with a given name.
  • fromRequest().header(String key, int index): Returns the nth header with a given name.
  • fromRequest().body(): Returns the full request body.
  • fromRequest().body(String jsonPath): Returns the element from the request that -matches the JSON Path.

If you’re using the YAML contract definition you have to use the -Handlebars {{{ }}} notation with custom, Spring Cloud Contract - functions to achieve this.

  • {{{ request.url }}}: Returns the request URL and query parameters.
  • {{{ request.query.key.[index] }}}: Returns the nth query parameter with a given name. -E.g. for key foo, first entry {{{ request.query.foo.[0] }}}
  • {{{ request.path }}}: Returns the full path.
  • {{{ request.path.[index] }}}: Returns the nth path element. E.g. -for first entry `{{{ request.path.[0] }}}
  • {{{ request.headers.key }}}: Returns the first header with a given name.
  • {{{ request.headers.key.[index] }}}: Returns the nth header with a given name.
  • {{{ request.body }}}: Returns the full request body.
  • {{{ jsonpath this 'your.json.path' }}}: Returns the element from the request that -matches the JSON Path. E.g. for json path $.foo - {{{ jsonpath this '$.foo' }}}

Consider the following contract:

Groovy DSL.  -

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		url('/api/v1/xxxx') {
-			queryParameters {
-				parameter("foo", "bar")
-				parameter("foo", "bar2")
-			}
-		}
-		headers {
-			header(authorization(), "secret")
-			header(authorization(), "secret2")
-		}
-		body(foo: "bar", baz: 5)
-	}
-	response {
-		status OK()
-		headers {
-			header(authorization(), "foo ${fromRequest().header(authorization())} bar")
-		}
-		body(
-				url: fromRequest().url(),
-				path: fromRequest().path(),
-				pathIndex: fromRequest().path(1),
-				param: fromRequest().query("foo"),
-				paramIndex: fromRequest().query("foo", 1),
-				authorization: fromRequest().header("Authorization"),
-				authorization2: fromRequest().header("Authorization", 1),
-				fullBody: fromRequest().body(),
-				responseFoo: fromRequest().body('$.foo'),
-				responseBaz: fromRequest().body('$.baz'),
-				responseBaz2: "Bla bla ${fromRequest().body('$.foo')} bla bla"
-		)
-	}
-}

-

YAML.  -

request:
-  method: GET
-  url: /api/v1/xxxx
-  queryParameters:
-    foo:
-      - bar
-      - bar2
-  headers:
-    Authorization:
-      - secret
-      - secret2
-  body:
-    foo: bar
-    baz: 5
-response:
-  status: 200
-  headers:
-    Authorization: "foo {{{ request.headers.Authorization.0 }}} bar"
-  body:
-    url: "{{{ request.url }}}"
-    path: "{{{ request.path }}}"
-    pathIndex: "{{{ request.path.1 }}}"
-    param: "{{{ request.query.foo }}}"
-    paramIndex: "{{{ request.query.foo.1 }}}"
-    authorization: "{{{ request.headers.Authorization.0 }}}"
-    authorization2: "{{{ request.headers.Authorization.1 }}"
-    fullBody: "{{{ request.body }}}"
-    responseFoo: "{{{ jsonpath this '$.foo' }}}"
-    responseBaz: "{{{ jsonpath this '$.baz' }}}"
-    responseBaz2: "Bla bla {{{ jsonpath this '$.foo' }}} bla bla"

-

Running a JUnit test generation leads to a test that resembles the following example:

// given:
- MockMvcRequestSpecification request = given()
-   .header("Authorization", "secret")
-   .header("Authorization", "secret2")
-   .body("{\"foo\":\"bar\",\"baz\":5}");
-
-// when:
- ResponseOptions response = given().spec(request)
-   .queryParam("foo","bar")
-   .queryParam("foo","bar2")
-   .get("/api/v1/xxxx");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Authorization")).isEqualTo("foo secret bar");
-// and:
- DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
- assertThatJson(parsedJson).field("['fullBody']").isEqualTo("{\"foo\":\"bar\",\"baz\":5}");
- assertThatJson(parsedJson).field("['authorization']").isEqualTo("secret");
- assertThatJson(parsedJson).field("['authorization2']").isEqualTo("secret2");
- assertThatJson(parsedJson).field("['path']").isEqualTo("/api/v1/xxxx");
- assertThatJson(parsedJson).field("['param']").isEqualTo("bar");
- assertThatJson(parsedJson).field("['paramIndex']").isEqualTo("bar2");
- assertThatJson(parsedJson).field("['pathIndex']").isEqualTo("v1");
- assertThatJson(parsedJson).field("['responseBaz']").isEqualTo(5);
- assertThatJson(parsedJson).field("['responseFoo']").isEqualTo("bar");
- assertThatJson(parsedJson).field("['url']").isEqualTo("/api/v1/xxxx?foo=bar&foo=bar2");
- assertThatJson(parsedJson).field("['responseBaz2']").isEqualTo("Bla bla bar bla bla");

As you can see, elements from the request have been properly referenced in the response.

The generated WireMock stub should resemble the following example:

{
-  "request" : {
-    "urlPath" : "/api/v1/xxxx",
-    "method" : "POST",
-    "headers" : {
-      "Authorization" : {
-        "equalTo" : "secret2"
-      }
-    },
-    "queryParameters" : {
-      "foo" : {
-        "equalTo" : "bar2"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.['baz'] == 5)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['foo'] == 'bar')]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\"authorization\":\"{{{request.headers.Authorization.[0]}}}\",\"path\":\"{{{request.path}}}\",\"responseBaz\":{{{jsonpath this '$.baz'}}} ,\"param\":\"{{{request.query.foo.[0]}}}\",\"pathIndex\":\"{{{request.path.[1]}}}\",\"responseBaz2\":\"Bla bla {{{jsonpath this '$.foo'}}} bla bla\",\"responseFoo\":\"{{{jsonpath this '$.foo'}}}\",\"authorization2\":\"{{{request.headers.Authorization.[1]}}}\",\"fullBody\":\"{{{escapejsonbody}}}\",\"url\":\"{{{request.url}}}\",\"paramIndex\":\"{{{request.query.foo.[1]}}}\"}",
-    "headers" : {
-      "Authorization" : "{{{request.headers.Authorization.[0]}}};foo"
-    },
-    "transformers" : [ "response-template" ]
-  }
-}

Sending a request such as the one presented in the request part of the contract results -in sending the following response body:

{
-  "url" : "/api/v1/xxxx?foo=bar&foo=bar2",
-  "path" : "/api/v1/xxxx",
-  "pathIndex" : "v1",
-  "param" : "bar",
-  "paramIndex" : "bar2",
-  "authorization" : "secret",
-  "authorization2" : "secret2",
-  "fullBody" : "{\"foo\":\"bar\",\"baz\":5}",
-  "responseFoo" : "bar",
-  "responseBaz" : 5,
-  "responseBaz2" : "Bla bla bar bla bla"
-}
[Important]Important

This feature works only with WireMock having a version greater than or equal -to 2.5.1. The Spring Cloud Contract Verifier uses WireMock’s -response-template response transformer. It uses Handlebars to convert the Mustache {{{ }}} templates into -proper values. Additionally, it registers two helper functions:

  • escapejsonbody: Escapes the request body in a format that can be embedded in a JSON.
  • jsonpath: For a given parameter, find an object in the request body.

8.5.6 Registering Your Own WireMock Extension

WireMock lets you register custom extensions. By default, Spring Cloud Contract registers -the transformer, which lets you reference a request from a response. If you want to -provide your own extensions, you can register an implementation of the -org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockExtensions interface. -Since we use the spring.factories extension approach, you can create an entry in -META-INF/spring.factories file similar to the following:

org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockExtensions=\
-org.springframework.cloud.contract.stubrunner.provider.wiremock.TestWireMockExtensions
-org.springframework.cloud.contract.spec.ContractConverter=\
-org.springframework.cloud.contract.stubrunner.TestCustomYamlContractConverter

The following is an example of a custom extension:

TestWireMockExtensions.groovy.  -

package org.springframework.cloud.contract.verifier.dsl.wiremock
-
-import com.github.tomakehurst.wiremock.extension.Extension
-
-/**
- * Extension that registers the default transformer and the custom one
- */
-class TestWireMockExtensions implements WireMockExtensions {
-	@Override
-	List<Extension> extensions() {
-		return [
-				new DefaultResponseTransformer(),
-				new CustomExtension()
-		]
-	}
-}
-
-class CustomExtension implements Extension {
-
-	@Override
-	String getName() {
-		return "foo-transformer"
-	}
-}

-

[Important]Important

Remember to override the applyGlobally() method and set it to false if you -want the transformation to be applied only for a mapping that explicitly requires it.

8.5.7 Dynamic Properties in the Matchers Sections

If you work with Pact, the following discussion may seem familiar. -Quite a few users are used to having a separation between the body and setting the -dynamic parts of a contract.

You can use the bodyMatchers section for two reasons:

  • Define the dynamic values that should end up in a stub. -You can set it in the request or inputMessage part of your contract.
  • Verify the result of your test. -This section is present in the response or outputMessage side of the -contract.

Currently, Spring Cloud Contract Verifier supports only JSON Path-based matchers with the -following matching possibilities:

Groovy DSL

  • For the stubs(in tests on the Consumer’s side):

    • byEquality(): The value taken from the consumer’s request via the provided JSON Path must be -equal to the value provided in the contract.
    • byRegex(…​): The value taken from the consumer’s request via the provided JSON Path must -match the regex.
    • byDate(): The value taken from the consumer’s request via the provided JSON Path must -match the regex for an ISO Date value.
    • byTimestamp(): The value taken from the consumer’s request via the provided JSON Path must -match the regex for an ISO DateTime value.
    • byTime(): The value taken from the consumer’s request via the provided JSON Path must -match the regex for an ISO Time value.
  • For the verification(in generated tests on the Producer’s side):

    • byEquality(): The value taken from the producer’s response via the provided JSON Path must be -equal to the provided value in the contract.
    • byRegex(…​): The value taken from the producer’s response via the provided JSON Path must -match the regex.
    • byDate(): The value taken from the producer’s response via the provided JSON Path must match -the regex for an ISO Date value.
    • byTimestamp(): The value taken from the producer’s response via the provided JSON Path must -match the regex for an ISO DateTime value.
    • byTime(): The value taken from the producer’s response via the provided JSON Path must match -the regex for an ISO Time value.
    • byType(): The value taken from the producer’s response via the provided JSON Path needs to be -of the same type as the type defined in the body of the response in the contract. -byType can take a closure, in which you can set minOccurrence and maxOccurrence. -That way, you can assert the size of the flattened collection. To check the size of an -unflattened collection, use a custom method with the byCommand(…​) testMatcher.
    • byCommand(…​): The value taken from the producer’s response via the provided JSON Path is -passed as an input to the custom method that you provide. For example, -byCommand('foo($it)') results in calling a foo method to which the value matching the -JSON Path gets passed. The type of the object read from the JSON can be one of the -following, depending on the JSON path:

      • String: If you point to a String value.
      • JSONArray: If you point to a List.
      • Map: If you point to a Map.
      • Number: If you point to Integer, Double, or other kind of number.
      • Boolean: If you point to a Boolean.
    • byNull(): The value taken from the response via the provided JSON Path must be null

YAML. Please read the Groovy section for detailed explanation of -what the types mean

For YAML the structure of a matcher looks like this

- path: $.foo
-  type: by_regex
-  value: bar

Or if you want to use one of the predefined regular expressions -[only_alpha_unicode, number, any_boolean, ip_address, hostname, -email, url, uuid, iso_date, iso_date_time, iso_time, iso_8601_with_offset, non_empty, non_blank]:

- path: $.foo
-  type: by_regex
-  predefined: only_alpha_unicode

Below you can find the allowed list of `type`s.

  • For stubMatchers:

    • by_equality
    • by_regex
    • by_date
    • by_timestamp
    • by_time
  • For testMatchers:

    • by_equality
    • by_regex
    • by_date
    • by_timestamp
    • by_time
    • by_type

      • there are 2 additional fields accepted: minOccurrence and maxOccurrence.
    • by_command
    • by_null

Consider the following example:

Groovy DSL.  -

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		urlPath '/get'
-		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",
-				key: [
-						'complex.key' : 'foo'
-				]
-		])
-		bodyMatchers {
-			jsonPath('$.duck', byRegex("[0-9]{3}"))
-			jsonPath('$.duck', byEquality())
-			jsonPath('$.alpha', byRegex(onlyAlphaUnicode()))
-			jsonPath('$.alpha', byEquality())
-			jsonPath('$.number', byRegex(number()))
-			jsonPath('$.aBoolean', byRegex(anyBoolean()))
-			jsonPath('$.date', byDate())
-			jsonPath('$.dateTime', byTimestamp())
-			jsonPath('$.time', byTime())
-			jsonPath("\$.['key'].['complex.key']", byEquality())
-		}
-		headers {
-			contentType(applicationJson())
-		}
-	}
-	response {
-		status OK()
-		body([
-				duck: 123,
-				alpha: "abc",
-				number: 123,
-				positiveInteger: 1234567890,
-				negativeInteger: -1234567890,
-				positiveDecimalNumber: 123.4567890,
-				negativeDecimalNumber: -123.4567890,
-				aBoolean: true,
-				date: "2017-01-01",
-				dateTime: "2017-01-01T01:23:45",
-				time: "01:02:34",
-				valueWithoutAMatcher: "foo",
-				valueWithTypeMatch: "string",
-				valueWithMin: [
-					1,2,3
-				],
-				valueWithMax: [
-					1,2,3
-				],
-				valueWithMinMax: [
-					1,2,3
-				],
-				valueWithMinEmpty: [],
-				valueWithMaxEmpty: [],
-				key: [
-				        'complex.key' : 'foo'
-				],
-				nullValue: null
-		])
-		bodyMatchers {
-			// asserts the jsonpath value against manual regex
-			jsonPath('$.duck', byRegex("[0-9]{3}"))
-			// asserts the jsonpath value against the provided value
-			jsonPath('$.duck', byEquality())
-			// asserts the jsonpath value against some default regex
-			jsonPath('$.alpha', byRegex(onlyAlphaUnicode()))
-			jsonPath('$.alpha', byEquality())
-			jsonPath('$.number', byRegex(number()))
-			jsonPath('$.positiveInteger', byRegex(anInteger()))
-			jsonPath('$.negativeInteger', byRegex(anInteger()))
-			jsonPath('$.positiveDecimalNumber', byRegex(aDouble()))
-			jsonPath('$.negativeDecimalNumber', byRegex(aDouble()))
-			jsonPath('$.aBoolean', byRegex(anyBoolean()))
-			// asserts vs inbuilt time related regex
-			jsonPath('$.date', byDate())
-			jsonPath('$.dateTime', byTimestamp())
-			jsonPath('$.time', byTime())
-			// asserts that the resulting type is the same as in response body
-			jsonPath('$.valueWithTypeMatch', byType())
-			jsonPath('$.valueWithMin', byType {
-				// results in verification of size of array (min 1)
-				minOccurrence(1)
-			})
-			jsonPath('$.valueWithMax', byType {
-				// results in verification of size of array (max 3)
-				maxOccurrence(3)
-			})
-			jsonPath('$.valueWithMinMax', byType {
-				// results in verification of size of array (min 1 & max 3)
-				minOccurrence(1)
-				maxOccurrence(3)
-			})
-			jsonPath('$.valueWithMinEmpty', byType {
-				// results in verification of size of array (min 0)
-				minOccurrence(0)
-			})
-			jsonPath('$.valueWithMaxEmpty', byType {
-				// results in verification of size of array (max 0)
-				maxOccurrence(0)
-			})
-			// will execute a method `assertThatValueIsANumber`
-			jsonPath('$.duck', byCommand('assertThatValueIsANumber($it)'))
-			jsonPath("\$.['key'].['complex.key']", byEquality())
-			jsonPath('$.nullValue', byNull())
-		}
-		headers {
-			contentType(applicationJson())
-			header('Some-Header', $(c('someValue'), p(regex('[a-zA-Z]{9}'))))
-		}
-	}
-}

-

YAML.  -

request:
-  method: GET
-  urlPath: /get
-  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"
-    key:
-      "complex.key": 'foo'
-    nullValue: null
-  matchers:
-    headers:
-      - key: Content-Type
-        regex: "application/json.*"
-    body:
-      - path: $.duck
-        type: by_regex
-        value: "[0-9]{3}"
-      - path: $.duck
-        type: by_equality
-      - path: $.alpha
-        type: by_regex
-        predefined: only_alpha_unicode
-      - path: $.alpha
-        type: by_equality
-      - path: $.number
-        type: by_regex
-        predefined: number
-      - path: $.aBoolean
-        type: by_regex
-        predefined: any_boolean
-      - path: $.date
-        type: by_date
-      - path: $.dateTime
-        type: by_timestamp
-      - path: $.time
-        type: by_time
-      - path: "$.['key'].['complex.key']"
-        type: by_equality
-      - path: $.nullvalue
-        type: by_null
-  headers:
-    Content-Type: application/json
-response:
-  status: 200
-  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"
-    valueWithMin:
-      - 1
-      - 2
-      - 3
-    valueWithMax:
-      - 1
-      - 2
-      - 3
-    valueWithMinMax:
-      - 1
-      - 2
-      - 3
-    valueWithMinEmpty: []
-    valueWithMaxEmpty: []
-    key:
-      'complex.key' : 'foo'
-    nulValue: null
-  matchers:
-    headers:
-      - key: Content-Type
-        regex: "application/json.*"
-    body:
-      - path: $.duck
-        type: by_regex
-        value: "[0-9]{3}"
-      - path: $.duck
-        type: by_equality
-      - path: $.alpha
-        type: by_regex
-        predefined: only_alpha_unicode
-      - path: $.alpha
-        type: by_equality
-      - path: $.number
-        type: by_regex
-        predefined: number
-      - path: $.aBoolean
-        type: by_regex
-        predefined: any_boolean
-      - path: $.date
-        type: by_date
-      - path: $.dateTime
-        type: by_timestamp
-      - path: $.time
-        type: by_time
-      - path: $.valueWithTypeMatch
-        type: by_type
-      - path: $.valueWithMin
-        type: by_type
-        minOccurrence: 1
-      - path: $.valueWithMax
-        type: by_type
-        maxOccurrence: 3
-      - path: $.valueWithMinMax
-        type: by_type
-        minOccurrence: 1
-        maxOccurrence: 3
-      - path: $.valueWithMinEmpty
-        type: by_type
-        minOccurrence: 0
-      - path: $.valueWithMaxEmpty
-        type: by_type
-        maxOccurrence: 0
-      - path: $.duck
-        type: by_command
-        value: assertThatValueIsANumber($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-  headers:
-    Content-Type: application/json

-

In the preceding example, you can see the dynamic portions of the contract in the -matchers sections. For the request part, you can see that, for all fields but -valueWithoutAMatcher, the values of the regular expressions that the stub should -contain are explicitly set. For the valueWithoutAMatcher, the verification takes place -in the same way as without the use of matchers. In that case, the test performs an -equality check.

For the response side in the bodyMatchers section, we define the dynamic parts in a -similar manner. The only difference is that the byType matchers are also present. The -verifier engine checks four fields to verify whether the response from the test -has a value for which the JSON path matches the given field, is of the same type as the one -defined in the response body, and passes the following check (based on the method being called):

  • For $.valueWithTypeMatch, the engine checks whether the type is the same.
  • For $.valueWithMin, the engine check the type and asserts whether the size is greater -than or equal to the minimum occurrence.
  • For $.valueWithMax, the engine checks the type and asserts whether the size is -smaller than or equal to the maximum occurrence.
  • For $.valueWithMinMax, the engine checks the type and asserts whether the size is -between the min and maximum occurrence.

The resulting test would resemble the following example (note that an and section -separates the autogenerated assertions and the assertion from matchers):

// 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\",\"key\":{\"complex.key\":\"foo\"}}");
-
-// when:
- ResponseOptions response = given().spec(request)
-   .get("/get");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Content-Type")).matches("application/json.*");
-// and:
- DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
- assertThatJson(parsedJson).field("['valueWithoutAMatcher']").isEqualTo("foo");
-// and:
- assertThat(parsedJson.read("$.duck", String.class)).matches("[0-9]{3}");
- assertThat(parsedJson.read("$.duck", Integer.class)).isEqualTo(123);
- assertThat(parsedJson.read("$.alpha", String.class)).matches("[\\p{L}]*");
- assertThat(parsedJson.read("$.alpha", String.class)).isEqualTo("abc");
- assertThat(parsedJson.read("$.number", String.class)).matches("-?(\\d*\\.\\d+|\\d+)");
- assertThat(parsedJson.read("$.aBoolean", String.class)).matches("(true|false)");
- assertThat(parsedJson.read("$.date", String.class)).matches("(\\d\\d\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])");
- assertThat(parsedJson.read("$.dateTime", String.class)).matches("([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])");
- assertThat(parsedJson.read("$.time", String.class)).matches("(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])");
- assertThat((Object) parsedJson.read("$.valueWithTypeMatch")).isInstanceOf(java.lang.String.class);
- assertThat((Object) parsedJson.read("$.valueWithMin")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMin", java.util.Collection.class)).as("$.valueWithMin").hasSizeGreaterThanOrEqualTo(1);
- assertThat((Object) parsedJson.read("$.valueWithMax")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMax", java.util.Collection.class)).as("$.valueWithMax").hasSizeLessThanOrEqualTo(3);
- assertThat((Object) parsedJson.read("$.valueWithMinMax")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMinMax", java.util.Collection.class)).as("$.valueWithMinMax").hasSizeBetween(1, 3);
- assertThat((Object) parsedJson.read("$.valueWithMinEmpty")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMinEmpty", java.util.Collection.class)).as("$.valueWithMinEmpty").hasSizeGreaterThanOrEqualTo(0);
- assertThat((Object) parsedJson.read("$.valueWithMaxEmpty")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMaxEmpty", java.util.Collection.class)).as("$.valueWithMaxEmpty").hasSizeLessThanOrEqualTo(0);
- assertThatValueIsANumber(parsedJson.read("$.duck"));
- assertThat(parsedJson.read("$.['key'].['complex.key']", String.class)).isEqualTo("foo");
[Important]Important

Notice that, for the byCommand method, the example calls the -assertThatValueIsANumber. This method must be defined in the test base class or be -statically imported to your tests. Notice that the byCommand call was converted to -assertThatValueIsANumber(parsedJson.read("$.duck"));. That means that the engine took -the method name and passed the proper JSON path as a parameter to it.

The resulting WireMock stub is in the following example:

				'''
-{
-  "request" : {
-	"urlPath" : "/get",
-	"method" : "POST",
-	"headers" : {
-	  "Content-Type" : {
-		"matches" : "application/json.*"
-	  }
-	},
-	"bodyPatterns" : [ {
-	  "matchesJsonPath" : "$[?(@.['valueWithoutAMatcher'] == 'foo')]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.['valueWithTypeMatch'] == 'string')]"
-	}, {
-	  "matchesJsonPath" : "$.['list'].['some'].['nested'][?(@.['anothervalue'] == 4)]"
-	}, {
-	  "matchesJsonPath" : "$.['list'].['someother'].['nested'][?(@.['anothervalue'] == 4)]"
-	}, {
-	  "matchesJsonPath" : "$.['list'].['someother'].['nested'][?(@.['json'] == 'with value')]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.duck =~ /([0-9]{3})/)]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.duck == 123)]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.alpha =~ /([\\\\p{L}]*)/)]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.alpha == 'abc')]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.number =~ /(-?(\\\\d*\\\\.\\\\d+|\\\\d+))/)]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.aBoolean =~ /((true|false))/)]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.date =~ /((\\\\d\\\\d\\\\d\\\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))/)]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.dateTime =~ /(([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]))/)]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.time =~ /((2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]))/)]"
-	}, {
-	  "matchesJsonPath" : "$.list.some.nested[?(@.json =~ /(.*)/)]"
-	} ]
-  },
-  "response" : {
-	"status" : 200,
-	"body" : "{\\"date\\":\\"2017-01-01\\",\\"dateTime\\":\\"2017-01-01T01:23:45\\",\\"number\\":123,\\"aBoolean\\":true,\\"duck\\":123,\\"alpha\\":\\"abc\\",\\"valueWithMin\\":[1,2,3],\\"time\\":\\"01:02:34\\",\\"valueWithTypeMatch\\":\\"string\\",\\"valueWithMax\\":[1,2,3],\\"valueWithMinMax\\":[1,2,3],\\"valueWithoutAMatcher\\":\\"foo\\"}",
-	"headers" : {
-	  "Content-Type" : "application/json"
-	}
-  }
-}
-'''
[Important]Important

If you use a matcher, then the part of the request and response that the -matcher addresses with the JSON Path gets removed from the assertion. In the case of -verifying a collection, you must create matchers for all the elements of the -collection.

Consider the following example:

Contract.make {
-    request {
-        method 'GET'
-        url("/foo")
-    }
-    response {
-        status OK()
-        body(events: [[
-                                 operation          : 'EXPORT',
-                                 eventId            : '16f1ed75-0bcc-4f0d-a04d-3121798faf99',
-                                 status             : 'OK'
-                         ], [
-                                 operation          : 'INPUT_PROCESSING',
-                                 eventId            : '3bb4ac82-6652-462f-b6d1-75e424a0024a',
-                                 status             : 'OK'
-                         ]
-                ]
-        )
-        bodyMatchers {
-            jsonPath('$.events[0].operation', byRegex('.+'))
-            jsonPath('$.events[0].eventId', byRegex('^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})$'))
-            jsonPath('$.events[0].status', byRegex('.+'))
-        }
-    }
-}

The preceding code leads to creating the following test (the code block shows only the assertion section):

and:
-	DocumentContext parsedJson = JsonPath.parse(response.body.asString())
-	assertThatJson(parsedJson).array("['events']").contains("['eventId']").isEqualTo("16f1ed75-0bcc-4f0d-a04d-3121798faf99")
-	assertThatJson(parsedJson).array("['events']").contains("['operation']").isEqualTo("EXPORT")
-	assertThatJson(parsedJson).array("['events']").contains("['operation']").isEqualTo("INPUT_PROCESSING")
-	assertThatJson(parsedJson).array("['events']").contains("['eventId']").isEqualTo("3bb4ac82-6652-462f-b6d1-75e424a0024a")
-	assertThatJson(parsedJson).array("['events']").contains("['status']").isEqualTo("OK")
-and:
-	assertThat(parsedJson.read("\$.events[0].operation", String.class)).matches(".+")
-	assertThat(parsedJson.read("\$.events[0].eventId", String.class)).matches("^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})\$")
-	assertThat(parsedJson.read("\$.events[0].status", String.class)).matches(".+")

As you can see, the assertion is malformed. Only the first element of the array got -asserted. In order to fix this, you should apply the assertion to the whole $.events -collection and assert it with the byCommand(…​) method.

8.6 JAX-RS Support

The Spring Cloud Contract Verifier supports the JAX-RS 2 Client API. The base class needs -to define protected WebTarget webTarget and server initialization. The only option for -testing JAX-RS API is to start a web server. Also, a request with a body needs to have a -content type set. Otherwise, the default of application/octet-stream gets used.

In order to use JAX-RS mode, use the following settings:

testMode == 'JAXRSCLIENT'

The following example shows a generated test API:

'''
- // when:
-  Response response = webTarget
-    .path("/users")
-    .queryParam("limit", "10")
-    .queryParam("offset", "20")
-    .queryParam("filter", "email")
-    .queryParam("sort", "name")
-    .queryParam("search", "55")
-    .queryParam("age", "99")
-    .queryParam("name", "Denis.Stepanov")
-    .queryParam("email", "bob@email.com")
-    .request()
-    .method("GET");
-
-  String responseAsString = response.readEntity(String.class);
-
- // then:
-  assertThat(response.getStatus()).isEqualTo(200);
- // and:
-  DocumentContext parsedJson = JsonPath.parse(responseAsString);
-  assertThatJson(parsedJson).field("['property1']").isEqualTo("a");
-'''

8.7 Async Support

If you’re using asynchronous communication on the server side (your controllers are -returning Callable, DeferredResult, and so on), then, inside your contract, you must -provide an async() method in the response section. The following code shows an example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-    request {
-        method GET()
-        url '/get'
-    }
-    response {
-        status OK()
-        body 'Passed'
-        async()
-    }
-}

-

YAML.  -

response:
-    async: true

-

8.8 Working with Context Paths

Spring Cloud Contract supports context paths.

[Important]Important

The only change needed to fully support context paths is the switch on the -PRODUCER side. Also, the autogenerated tests must use EXPLICIT mode. The consumer -side remains untouched. In order for the generated test to pass, you must use EXPLICIT -mode.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <testMode>EXPLICIT</testMode>
-    </configuration>
-</plugin>

-

Gradle.  -

contracts {
-		testMode = 'EXPLICIT'
-}

-

That way, you generate a test that DOES NOT use MockMvc. It means that you generate -real requests and you need to setup your generated test’s base class to work on a real -socket.

Consider the following contract:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'GET'
-		url '/my-context-path/url'
-	}
-	response {
-		status OK()
-	}
-}

The following example shows how to set up a base class and Rest Assured:

import io.restassured.RestAssured;
-import org.junit.Before;
-import org.springframework.boot.web.server.LocalServerPort;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest(classes = ContextPathTestingBaseClass.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-class ContextPathTestingBaseClass {
-
-	@LocalServerPort int port;
-
-	@Before
-	public void setup() {
-		RestAssured.baseURI = "http://localhost";
-		RestAssured.port = this.port;
-	}
-}

If you do it this way:

  • All of your requests in the autogenerated tests are sent to the real endpoint with your -context path included (for example, /my-context-path/url).
  • Your contracts reflect that you have a context path. Your generated stubs also have -that information (for example, in the stubs, you have to call /my-context-path/url).

8.9 Working with Web Flux

Spring Cloud Contract requires the usage of EXPLICIT mode in your generated tests -to work with Web Flux.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <testMode>EXPLICIT</testMode>
-    </configuration>
-</plugin>

-

Gradle.  -

contracts {
-		testMode = 'EXPLICIT'
-}

-

The following example shows how to set up a base class and Rest Assured for Web Flux:

@RunWith(SpringRunner.class)
-@SpringBootTest(classes = BeerRestBase.Config.class,
-		webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
-		properties = "server.port=0")
-public abstract class BeerRestBase {
-
-    // your tests go here
-
-    // in this config class you define all controllers and mocked services
-@Configuration
-@EnableAutoConfiguration
-static class Config {
-
-	@Bean
-	PersonCheckingService personCheckingService()  {
-		return personToCheck -> personToCheck.age >= 20;
-	}
-
-	@Bean
-	ProducerController producerController() {
-		return new ProducerController(personCheckingService());
-	}
-}
-
-}

8.10 Messaging Top-Level Elements

The DSL for messaging looks a little bit different than the one that focuses on HTTP. The -following sections explain the differences:

8.10.1 Output Triggered by a Method

The output message can be triggered by calling a method (such as a Scheduler when a was -started and a message was sent), as shown in the following example:

Groovy DSL.  -

def dsl = Contract.make {
-	// Human readable description
-	description 'Some description'
-	// Label by means of which the output message can be triggered
-	label 'some_label'
-	// input to the contract
-	input {
-		// the contract will be triggered by a method
-		triggeredBy('bookReturnedTriggered()')
-	}
-	// output message of the contract
-	outputMessage {
-		// destination to which the output message will be sent
-		sentTo('output')
-		// the body of the output message
-		body('''{ "bookName" : "foo" }''')
-		// the headers of the output message
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

-

YAML.  -

# Human readable description
-description: Some description
-# Label by means of which the output message can be triggered
-label: some_label
-input:
-  # the contract will be triggered by a method
-  triggeredBy: bookReturnedTriggered()
-# output message of the contract
-outputMessage:
-  # destination to which the output message will be sent
-  sentTo: output
-  # the body of the output message
-  body:
-    bookName: foo
-  # the headers of the output message
-  headers:
-    BOOK-NAME: foo

-

In the previous example case, the output message is sent to output if a method called -bookReturnedTriggered is executed. On the message publisher’s side, we generate a -test that calls that method to trigger the message. On the consumer side, you can use -the some_label to trigger the message.

8.10.2 Output Triggered by a Message

The output message can be triggered by receiving a message, as shown in the following -example:

Groovy DSL.  -

def dsl = Contract.make {
-	description 'Some Description'
-	label 'some_label'
-	// input is a message
-	input {
-		// the message was received from this destination
-		messageFrom('input')
-		// has the following body
-		messageBody([
-		        bookName: 'foo'
-		])
-		// and the following headers
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('output')
-		body([
-		        bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

-

YAML.  -

# Human readable description
-description: Some description
-# Label by means of which the output message can be triggered
-label: some_label
-# input is a message
-input:
-  messageFrom: input
-  # has the following body
-  messageBody:
-    bookName: 'foo'
-  # and the following headers
-  messageHeaders:
-    sample: 'header'
-# output message of the contract
-outputMessage:
-  # destination to which the output message will be sent
-  sentTo: output
-  # the body of the output message
-  body:
-    bookName: foo
-  # the headers of the output message
-  headers:
-    BOOK-NAME: foo

-

In the preceding example, the output message is sent to output if a proper message is -received on the input destination. On the message publisher’s side, the engine -generates a test that sends the input message to the defined destination. On the -consumer side, you can either send a message to the input destination or use a label -(some_label in the example) to trigger the message.

8.10.3 Consumer/Producer

[Important]Important

This section is valid only for Groovy DSL.

In HTTP, you have a notion of client/stub and `server/test notation. You can also -use those paradigms in messaging. In addition, Spring Cloud Contract Verifier also -provides the consumer and producer methods, as presented in the following example -(note that you can use either $ or value methods to provide consumer and producer -parts):

Contract.make {
-	label 'some_label'
-	input {
-		messageFrom value(consumer('jms:output'), producer('jms:input'))
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo $(consumer('jms:input'), producer('jms:output'))
-		body([
-				bookName: 'foo'
-		])
-	}
-}

8.10.4 Common

In the input or outputMessage section you can call assertThat with the name -of a method (e.g. assertThatMessageIsOnTheQueue()) that you have defined in the -base class or in a static import. Spring Cloud Contract will execute that method -in the generated test.

8.11 Multiple Contracts in One File

You can define multiple contracts in one file. Such a contract might resemble the -following example:

Groovy DSL.  -

import org.springframework.cloud.contract.spec.Contract
-
-[
-        Contract.make {
-            name("should post a user")
-            request {
-                method 'POST'
-                url('/users/1')
-            }
-            response {
-                status OK()
-            }
-        },
-        Contract.make {
-            request {
-                method 'POST'
-                url('/users/2')
-            }
-            response {
-                status OK()
-            }
-        }
-]

-

YAML.  -

---
-name: should post a user
-request:
-  method: POST
-  url: /users/1
-response:
-  status: 200
-
----
-request:
-  method: POST
-  url: /users/2
-response:
-  status: 200

-

In the preceding example, one contract has the name field and the other does not. This -leads to generation of two tests that look more or less like this:

package org.springframework.cloud.contract.verifier.tests.com.hello;
-
-import com.example.TestBase;
-import com.jayway.jsonpath.DocumentContext;
-import com.jayway.jsonpath.JsonPath;
-import com.jayway.restassured.module.mockmvc.specification.MockMvcRequestSpecification;
-import com.jayway.restassured.response.ResponseOptions;
-import org.junit.Test;
-
-import static com.jayway.restassured.module.mockmvc.RestAssuredMockMvc.*;
-import static com.toomuchcoding.jsonassert.JsonAssertion.assertThatJson;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class V1Test extends TestBase {
-
-	@Test
-	public void validate_should_post_a_user() throws Exception {
-		// given:
-			MockMvcRequestSpecification request = given();
-
-		// when:
-			ResponseOptions response = given().spec(request)
-					.post("/users/1");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-	}
-
-	@Test
-	public void validate_withList_1() throws Exception {
-		// given:
-			MockMvcRequestSpecification request = given();
-
-		// when:
-			ResponseOptions response = given().spec(request)
-					.post("/users/2");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-	}
-
-}

Notice that, for the contract that has the name field, the generated test method is named -validate_should_post_a_user. For the one that does not have the name, it is called -validate_withList_1. It corresponds to the name of the file WithList.groovy and the -index of the contract in the list.

The generated stubs is shown in the following example:

should post a user.json
-1_WithList.json

As you can see, the first file got the name parameter from the contract. The second -got the name of the contract file (WithList.groovy) prefixed with the index (in this -case, the contract had an index of 1 in the list of contracts in the file).

[Tip]Tip

As you can see, it is much better if you name your contracts because doing so makes -your tests far more meaningful.

8.12 Generating Spring REST Docs snippets from the contracts

When you want to include the requests and responses of your API using Spring REST Docs, -you only need to make some minor changes to your setup if you are using MockMvc and RestAssuredMockMvc. -Simply include the following dependencies if you haven’t already.

Maven.  -

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>
-<dependency>
-	<groupId>org.springframework.restdocs</groupId>
-	<artifactId>spring-restdocs-mockmvc</artifactId>
-	<optional>true</optional>
-</dependency>

-

Gradle.  -

testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
-testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc'

-

Next you need to make some changes to your base class like the following example.

package com.example.fraud;
-
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.junit.runner.RunWith;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.restdocs.JUnitRestDocumentation;
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = Application.class)
-public abstract class FraudBaseWithWebAppSetup {
-
-	private static final String OUTPUT = "target/generated-snippets";
-
-	@Rule
-	public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(OUTPUT);
-
-	@Rule public TestName testName = new TestName();
-
-	@Autowired
-	private WebApplicationContext context;
-
-	@Before
-	public void setup() {
-	RestAssuredMockMvc.mockMvc(MockMvcBuilders.webAppContextSetup(this.context)
-			.apply(documentationConfiguration(this.restDocumentation))
-			.alwaysDo(document(getClass().getSimpleName() + "_" + testName.getMethodName()))
-			.build());
-	}
-
-	protected void assertThatRejectionReasonIsNull(Object rejectionReason) {
-		assert rejectionReason == null;
-	}
-}

In case you are using the standalone setup, you can set up RestAssuredMockMvc like this:

package com.example.fraud;
-
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.springframework.restdocs.JUnitRestDocumentation;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
-
-public abstract class FraudBaseWithStandaloneSetup {
-
-	private static final String OUTPUT = "target/generated-snippets";
-
-	@Rule
-	public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(OUTPUT);
-
-	@Rule public TestName testName = new TestName();
-
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.standaloneSetup(MockMvcBuilders.standaloneSetup(new FraudDetectionController())
-				.apply(documentationConfiguration(this.restDocumentation))
-				.alwaysDo(document(getClass().getSimpleName() + "_" + testName.getMethodName())));
-	}
-
-}
[Tip]Tip

You don’t need to specify the output directory for the generated snippets since version 1.2.0.RELEASE of Spring REST Docs.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__customization.html b/multi/multi__customization.html index 885bc14127..a5ffb82f50 100644 --- a/multi/multi__customization.html +++ b/multi/multi__customization.html @@ -1,217 +1,13 @@ - - - 9. Customization

9. Customization

[Important]Important

This section is valid only for Groovy DSL

You can customize the Spring Cloud Contract Verifier by extending the DSL, as shown in -the remainder of this section.

9.1 Extending the DSL

You can provide your own functions to the DSL. The key requirement for this feature is to -maintain the static compatibility. Later in this document, you can see examples of:

  • Creating a JAR with reusable classes.
  • Referencing of these classes in the DSLs.

You can find the full example -here.

9.1.1 Common JAR

The following examples show three classes that can be reused in the DSLs.

PatternUtils contains functions used by both the consumer and the producer.

package com.example;
+
 
-import java.util.regex.Pattern;
+
+
 
-/**
- * If you want to use {@link Pattern} directly in your tests
- * then you can create a class resembling this one. It can
- * contain all the {@link Pattern} you want to use in the DSL.
- *
- * <pre>
- * {@code
- * request {
- *     body(
- *         [ age: $(c(PatternUtils.oldEnough()))]
- *     )
- * }
- * </pre>
- *
- * Notice that we're using both {@code $()} for dynamic values
- * and {@code c()} for the consumer side.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class PatternUtils {
+
 
-	public static String tooYoung() {
-		//remove::start[]
-		return "[0-1][0-9]";
-		//remove::end[return]
-	}
+Page Redirection
 
-	public static Pattern oldEnough() {
-		//remove::start[]
-		return Pattern.compile("[2-9][0-9]");
-		//remove::end[return]
-	}
-
-	/**
-	 * Makes little sense but it's just an example ;)
-	 */
-	public static Pattern ok() {
-		//remove::start[]
-		return Pattern.compile("OK");
-		//remove::end[return]
-	}
-}
-//end::impl[]

ConsumerUtils contains functions used by the consumer.

package com.example;
-
-import org.springframework.cloud.contract.spec.internal.ClientDslProperty;
-
-/**
- * DSL Properties passed to the DSL from the consumer's perspective.
- * That means that on the input side {@code Request} for HTTP
- * or {@code Input} for messaging you can have a regular expression.
- * On the {@code Response} for HTTP or {@code Output} for messaging
- * you have to have a concrete value.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class ConsumerUtils {
-	/**
-	 * Consumer side property. By using the {@link ClientDslProperty}
-	 * you can omit most of boilerplate code from the perspective
-	 * of dynamic values. Example
-	 *
-	 * <pre>
-	 * {@code
-	 * request {
-	 *     body(
-	 *         [ age: $(ConsumerUtils.oldEnough())]
-	 *     )
-	 * }
-	 * </pre>
-	 *
-	 * That way it's in the implementation that we decide what value we will pass to the consumer
-	 * and which one to the producer.
-	 *
-	 * @author Marcin Grzejszczak
-	 */
-	public static ClientDslProperty oldEnough() {
-		//remove::start[]
-		// this example is not the best one and
-		// theoretically you could just pass the regex instead of `ServerDslProperty` but
-		// it's just to show some new tricks :)
-		return new ClientDslProperty(PatternUtils.oldEnough(), 40);
-		//remove::end[return]
-	}
-
-}
-//end::impl[]

ProducerUtils contains functions used by the producer.

package com.example;
-
-import org.springframework.cloud.contract.spec.internal.ServerDslProperty;
-
-/**
- * DSL Properties passed to the DSL from the producer's perspective.
- * That means that on the input side {@code Request} for HTTP
- * or {@code Input} for messaging you have to have a concrete value.
- * On the {@code Response} for HTTP or {@code Output} for messaging
- * you can have a regular expression.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class ProducerUtils {
-
-	/**
-	 * Producer side property. By using the {@link ProducerUtils}
-	 * you can omit most of boilerplate code from the perspective
-	 * of dynamic values. Example
-	 *
-	 * <pre>
-	 * {@code
-	 * response {
-	 *     body(
-	 *         [ status: $(ProducerUtils.ok())]
-	 *     )
-	 * }
-	 * </pre>
-	 *
-	 * That way it's in the implementation that we decide what value we will pass to the consumer
-	 * and which one to the producer.
-	 */
-	public static ServerDslProperty ok() {
-		// this example is not the best one and
-		// theoretically you could just pass the regex instead of `ServerDslProperty` but
-		// it's just to show some new tricks :)
-		return new ServerDslProperty( PatternUtils.ok(), "OK");
-	}
-}
-//end::impl[]

9.1.2 Adding the Dependency to the Project

In order for the plugins and IDE to be able to reference the common JAR classes, you need -to pass the dependency to your project.

9.1.3 Test the Dependency in the Project’s Dependencies

First, add the common jar dependency as a test dependency. Because your contracts files -are available on the test resources path, the common jar classes automatically become -visible in your Groovy files. The following examples show how to test the dependency:

Maven.  -

<dependency>
-	<groupId>com.example</groupId>
-	<artifactId>beer-common</artifactId>
-	<version>${project.version}</version>
-	<scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile("com.example:beer-common:0.0.1.BUILD-SNAPSHOT")

-

9.1.4 Test a Dependency in the Plugin’s Dependencies

Now, you must add the dependency for the plugin to reuse at runtime, as shown in the -following example:

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example</packageWithBaseClasses>
-		<baseClassMappings>
-			<baseClassMapping>
-				<contractPackageRegex>.*intoxication.*</contractPackageRegex>
-				<baseClassFQN>com.example.intoxication.BeerIntoxicationBase</baseClassFQN>
-			</baseClassMapping>
-		</baseClassMappings>
-	</configuration>
-	<dependencies>
-		<dependency>
-			<groupId>com.example</groupId>
-			<artifactId>beer-common</artifactId>
-			<version>${project.version}</version>
-			<scope>compile</scope>
-		</dependency>
-	</dependencies>
-</plugin>

-

Gradle.  -

classpath "com.example:beer-common:0.0.1.BUILD-SNAPSHOT"

-

9.1.5 Referencing classes in DSLs

You can now reference your classes in your DSL, as shown in the following example:

package contracts.beer.rest
-
-import com.example.ConsumerUtils
-import com.example.ProducerUtils
-import org.springframework.cloud.contract.spec.Contract
-
-Contract.make {
-	description("""
-Represents a successful scenario of getting a beer
-
-```
-given:
-	client is old enough
-when:
-	he applies for a beer
-then:
-	we'll grant him the beer
-```
-
-""")
-	request {
-		method 'POST'
-		url '/check'
-		body(
-				age: $(ConsumerUtils.oldEnough())
-		)
-		headers {
-			contentType(applicationJson())
-		}
-	}
-	response {
-		status 200
-		body("""
-			{
-				"status": "${value(ProducerUtils.ok())}"
-			}
-			""")
-		headers {
-			contentType(applicationJson())
-		}
-	}
-}
[Important]Important

You can set the Spring Cloud Contract plugin up by setting convertToYaml to true. That way you will NOT have to add the dependency with the extended functionality to the consumer side, since the consumer side will be using YAML contracts instead of Groovy ones.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__generating_contracts_using_restdocs.html b/multi/multi__generating_contracts_using_restdocs.html index b4db5350eb..a5ffb82f50 100644 --- a/multi/multi__generating_contracts_using_restdocs.html +++ b/multi/multi__generating_contracts_using_restdocs.html @@ -1,53 +1,13 @@ - - - 7. Generating Contracts using RestDocs

7. Generating Contracts using RestDocs

Another thing that can be generated with Spring RestDocs is the Spring Cloud -Contract DSL file and documentation. If you combine that with Spring Cloud -WireMock then you’re getting both the contracts and stubs.

Why would you want to use this feature? Some people in the community asked questions -about situation in which they would like to move to DSL based contract definition -but they already have a lot of Spring MVC tests. Using this feature allows you to generate -the contract files that you can later modify and move to proper folders so that the -plugin picks them up.

[Tip]Tip

You might wonder why this functionality is in the WireMock module. -Come to think of it, it does make sense since it makes little sense to generate -only contracts and not generate the stubs. That’s why we suggest to do both.

Let’s imagine the following test:

		this.mockMvc.perform(post("/foo")
-					.accept(MediaType.APPLICATION_PDF)
-					.accept(MediaType.APPLICATION_JSON)
-					.contentType(MediaType.APPLICATION_JSON)
-					.content("{\"foo\": 23 }"))
-				.andExpect(status().isOk())
-				.andExpect(content().string("bar"))
-				// first WireMock
-				.andDo(WireMockRestDocs.verify()
-						.jsonPath("$[?(@.foo >= 20)]")
-						.contentType(MediaType.valueOf("application/json"))
-						.stub("shouldGrantABeerIfOldEnough"))
-				// then Contract DSL documentation
-				.andDo(document("index", SpringCloudContractRestDocs.dslContract()));

This will lead in the creation of the stub as presented in the previous -section, contract will get generated and a documentation file too.

The contract will be called index.groovy and look more like this.

import org.springframework.cloud.contract.spec.Contract
+
 
-Contract.make {
-    request {
-        method 'POST'
-        url '/foo'
-        body('''
-            {"foo": 23 }
-        ''')
-        headers {
-            header('''Accept''', '''application/json''')
-            header('''Content-Type''', '''application/json''')
-        }
-    }
-    response {
-        status 200
-        body('''
-        bar
-        ''')
-        headers {
-            header('''Content-Type''', '''application/json;charset=UTF-8''')
-            header('''Content-Length''', '''3''')
-        }
-        testMatchers {
-            jsonPath('$[?(@.foo >= 20)]', byType())
-        }
-    }
-}

the generated document (example for Asciidoc) will contain a formatted contract -(the location of this file would be index/dsl-contract.adoc).

\ No newline at end of file + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__generating_stubs_using_restdocs.html b/multi/multi__generating_stubs_using_restdocs.html index 8228253fb3..a5ffb82f50 100644 --- a/multi/multi__generating_stubs_using_restdocs.html +++ b/multi/multi__generating_stubs_using_restdocs.html @@ -1,93 +1,13 @@ - - - 6. Generating Stubs using RestDocs

6. Generating Stubs using RestDocs

Spring RestDocs can be -used to generate documentation (e.g. in asciidoctor format) for an -HTTP API with Spring MockMvc or Rest Assured. At the same time as you -generate documentation for your API, you can also generate WireMock -stubs, by using Spring Cloud Contract WireMock. Just write your normal -RestDocs test cases and use @AutoConfigureRestDocs to have stubs -automatically in the restdocs output directory. For example:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureRestDocs(outputDir = "target/snippets")
-@AutoConfigureMockMvc
-public class ApplicationTests {
+
 
-	@Autowired
-	private MockMvc mockMvc;
+
+
 
-	@Test
-	public void contextLoads() throws Exception {
-		mockMvc.perform(get("/resource"))
-				.andExpect(content().string("Hello World"))
-				.andDo(document("resource"));
-	}
-}

From this test will be generated a WireMock stub at -"target/snippets/stubs/resource.json". It matches all GET requests to -the "/resource" path.

Without any additional configuration this will create a stub with a -request matcher for the HTTP method and all headers except "host" and -"content-length". To match the request more precisely, for example to -match the body of a POST or PUT, we need to explicitly create a -request matcher. This will do two things: 1) create a stub that only -matches the way you specify, 2) assert that the request in the test -case also matches the same conditions.

The main entry point for this is WireMockRestDocs.verify() which can -be used as a substitute for the document() convenience method. For -example:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureRestDocs(outputDir = "target/snippets")
-@AutoConfigureMockMvc
-public class ApplicationTests {
+
 
-	@Autowired
-	private MockMvc mockMvc;
+Page Redirection
 
-	@Test
-	public void contextLoads() throws Exception {
-		mockMvc.perform(post("/resource")
-                .content("{\"id\":\"123456\",\"message\":\"Hello World\"}"))
-				.andExpect(status().isOk())
-				.andDo(verify().jsonPath("$.id")
-                        .stub("resource"));
-	}
-}

So this contract is saying: any valid POST with an "id" field will get -back an the same response as in this test. You can chain together -calls to .jsonPath() to add additional matchers. The -JayWay documentation can help you -to get up to speed with JSON Path if it is unfamiliar to you.

Instead of the jsonPath and contentType convenience methods, you -can also use the WireMock APIs to verify the request matches the -created stub. Example:

@Test
-public void contextLoads() throws Exception {
-	mockMvc.perform(post("/resource")
-               .content("{\"id\":\"123456\",\"message\":\"Hello World\"}"))
-			.andExpect(status().isOk())
-			.andDo(verify()
-					.wiremock(WireMock.post(
-						urlPathEquals("/resource"))
-						.withRequestBody(matchingJsonPath("$.id"))
-                       .stub("post-resource"));
-}

The WireMock API is rich - you can match headers, query parameters, -and request body by regex as well as by json path - so this can useful -to create stubs with a wider range of parameters. The above example -will generate a stub something like this:

post-resource.json.  -

{
-  "request" : {
-    "url" : "/resource",
-    "method" : "POST",
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$.id"
-    }]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "Hello World",
-    "headers" : {
-      "X-Application-Context" : "application:-1",
-      "Content-Type" : "text/plain"
-    }
-  }
-}

-

[Note]Note

You can use either the wiremock() method or the jsonPath() -and contentType() methods to create request matchers, but not both.

On the consumer side, you can make the resource.json generated above -available on the classpath (by publishing stubs as JARs for example). -After that, you can create a stub using WireMock in a -number of different ways, including as described above using -@AutoConfigureWireMock(stubs="classpath:resource.json").

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__links.html b/multi/multi__links.html index fb9dc1b235..a5ffb82f50 100644 --- a/multi/multi__links.html +++ b/multi/multi__links.html @@ -1,6 +1,13 @@ - - - 13. Links \ No newline at end of file + + + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__migrations.html b/multi/multi__migrations.html index 2f6342b768..a5ffb82f50 100644 --- a/multi/multi__migrations.html +++ b/multi/multi__migrations.html @@ -1,96 +1,13 @@ - - - 12. Migrations

12. Migrations

[Tip]Tip

For up to date migration guides please visit -the project’s wiki page.

This section covers migrating from one version of Spring Cloud Contract Verifier to the -next version. It covers the following versions upgrade paths:

12.1 1.0.x → 1.1.x

This section covers upgrading from version 1.0 to version 1.1.

12.1.1 New structure of generated stubs

In 1.1.x we have introduced a change to the structure of generated stubs. If you have -been using the @AutoConfigureWireMock notation to use the stubs from the classpath, -it no longer works. The following example shows how the @AutoConfigureWireMock notation -used to work:

@AutoConfigureWireMock(stubs = "classpath:/customer-stubs/mappings", port = 8084)

You must either change the location of the stubs to: -classpath:…​/META-INF/groupId/artifactId/version/mappings or use the new -classpath-based @AutoConfigureStubRunner, as shown in the following example:

@AutoConfigureWireMock(stubs = "classpath:customer-stubs/META-INF/travel.components/customer-contract/1.0.2-SNAPSHOT/mappings/", port = 8084)

If you do not want to use @AutoConfigureStubRunner and you want to remain with the old -structure, set your plugin tasks accordingly. The following example would work for the -structure presented in the previous snippet.

Maven.  -

<!-- start of pom.xml -->
+
 
-<properties>
-    <!-- we don't want the verifier to do a jar for us -->
-    <spring.cloud.contract.verifier.skip>true</spring.cloud.contract.verifier.skip>
-</properties>
+
+
 
-<!-- ... -->
+
 
-<!-- You need to set up the assembly plugin -->
-<build>
-    <plugins>
-        <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-assembly-plugin</artifactId>
-            <executions>
-                <execution>
-                    <id>stub</id>
-                    <phase>prepare-package</phase>
-                    <goals>
-                        <goal>single</goal>
-                    </goals>
-                    <inherited>false</inherited>
-                    <configuration>
-                        <attach>true</attach>
-                        <descriptor>${basedir}/src/assembly/stub.xml</descriptor>
-                    </configuration>
-                </execution>
-            </executions>
-        </plugin>
-    </plugins>
-</build>
-<!-- end of pom.xml -->
+Page Redirection
 
-<!-- start of stub.xml-->
-
-<assembly
-	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>stubs</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>${project.build.directory}/snippets/stubs</directory>
-			<outputDirectory>customer-stubs/mappings</outputDirectory>
-			<includes>
-				<include>**/*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${basedir}/src/test/resources/contracts</directory>
-			<outputDirectory>customer-stubs/contracts</outputDirectory>
-			<includes>
-				<include>**/*.groovy</include>
-			</includes>
-		</fileSet>
-	</fileSets>
-</assembly>
-
-<!-- end of stub.xml-->

-

Gradle.  -

task copyStubs(type: Copy, dependsOn: 'generateWireMockClientStubs') {
-//    Preserve directory structure from 1.0.X of spring-cloud-contract
-    from "${project.buildDir}/resources/main/customer-stubs/META-INF/${project.group}/${project.name}/${project.version}"
-    into "${project.buildDir}/resources/main/customer-stubs"
-}

-

12.2 1.1.x → 1.2.x

This section covers upgrading from version 1.1 to version 1.2.

12.2.1 Custom HttpServerStub

HttpServerStub includes a method that was not in version 1.1. The method is -String registeredMappings() If you have classes that implement HttpServerStub, you -now have to implement the registeredMappings() method. It should return a String -representing all mappings available in a single HttpServerStub.

See issue 355 for more -detail.

12.2.2 New packages for generated tests

The flow for setting the generated tests package name will look like this:

  • Set basePackageForTests
  • If basePackageForTests was not set, pick the package from baseClassForTests
  • If baseClassForTests was not set, pick packageWithBaseClasses
  • If nothing got set, pick the default value: -org.springframework.cloud.contract.verifier.tests

See issue 260 for more -detail.

12.2.3 New Methods in TemplateProcessor

In order to add support for fromRequest.path, the following methods had to be added to the -TemplateProcessor interface:

  • path()
  • path(int index)

See issue 388 for more -detail.

12.2.4 RestAssured 3.0

Rest Assured, used in the generated test classes, got bumped to 3.0. If -you manually set versions of Spring Cloud Contract and the release train -you might see the following exception:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project some-project: Compilation failure: Compilation failure:
-[ERROR] /some/path/SomeClass.java:[4,39] package com.jayway.restassured.response does not exist

This exception will occur due to the fact that the tests got generated with -an old version of plugin and at test execution time you have an incompatible -version of the release train (and vice versa).

Done via issue 267

12.3 1.2.x → 2.0.x

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__pluggable_architecture.html b/multi/multi__pluggable_architecture.html index 47aa0c30ed..a5ffb82f50 100644 --- a/multi/multi__pluggable_architecture.html +++ b/multi/multi__pluggable_architecture.html @@ -1,460 +1,13 @@ - - - 9. Pluggable architecture

9. Pluggable architecture

There are cases where you have your contracts defined in other formats -like YAML, RAML or PACT. On the other hand you’d like to profit from -the test and stubs generation. It’s really easy to add your own implementation -of either of those. Also you can customize the way tests are generated (for example you can generate -tests for other languages) and you can do the same for stubs generation (you can generate -stubs for other stub http server implementations).

9.1 Custom contract converter

Let’s assume that your contract is written in a YAML file like this:

request:
-  url: /foo
-  method: PUT
-  headers:
-    foo: bar
-  body:
-    foo: bar
-response:
-  status: 200
-  headers:
-    foo2: bar
-  body:
-    foo2: bar

Thanks to the interface

package org.springframework.cloud.contract.spec
+
 
-/**
- * Converter to be used to convert FROM {@link File} TO {@link Contract}
- * and from {@link Contract} to {@code T}
- *
- * @param <T> - type to which we want to convert the contract
- *
- * @author Marcin Grzejszczak
- * @since 1.1.0
- */
-interface ContractConverter<T> {
+
+
 
-	/**
-	 * Should this file be accepted by the converter. Can use the file extension
-	 * to check if the conversion is possible.
-	 *
-	 * @param file - file to be considered for conversion
-	 * @return - {@code true} if the given implementation can convert the file
-	 */
-	boolean isAccepted(File file)
+
 
-	/**
-	 * Converts the given {@link File} to its {@link Contract} representation
-	 *
-	 * @param file - file to convert
-	 * @return - {@link Contract} representation of the file
-	 */
-	Collection<Contract> convertFrom(File file)
+Page Redirection
 
-	/**
-	 * Converts the given {@link Contract} to a {@link T} representation
-	 *
-	 * @param contract - the parsed contract
-	 * @return - {@link T} the type to which we do the conversion
-	 */
-	T convertTo(Collection<Contract> contract)
-}

you can register your own implementation of a contract structure converter. -Your implementation needs to state the condition on which it should start the -conversion. Also you have to define how to perform that conversion in both ways.

[Important]Important

Once you create your implementation you have to create a /META-INF/spring.factories -file in which you provide the fully qualified name of your implementation.

Example of a spring.factories file

# Converters
-org.springframework.cloud.contract.spec.ContractConverter=\
-org.springframework.cloud.contract.verifier.converter.YamlContractConverter

and the YAML implementation

package org.springframework.cloud.contract.verifier.converter
-
-import java.nio.file.Files
-
-import groovy.transform.CompileStatic
-import org.springframework.cloud.contract.spec.Contract
-import org.springframework.cloud.contract.spec.ContractConverter
-import org.springframework.cloud.contract.spec.internal.Headers
-import org.yaml.snakeyaml.Yaml
-
-/**
- * Simple converter from and to a {@link YamlContract} to a collection of {@link Contract}
- */
-@CompileStatic
-class YamlContractConverter implements ContractConverter<List<YamlContract>> {
-
-	@Override
-	public boolean isAccepted(File file) {
-		String name = file.getName()
-		return name.endsWith(".yml") || name.endsWith(".yaml")
-	}
-
-	@Override
-	public Collection<Contract> convertFrom(File file) {
-		try {
-			YamlContract yamlContract = new Yaml().loadAs(
-					Files.newInputStream(file.toPath()), YamlContract.class)
-			return [Contract.make {
-				request {
-					method(yamlContract?.request?.method)
-					url(yamlContract?.request?.url)
-					headers {
-						yamlContract?.request?.headers?.each { String key, Object value ->
-							header(key, value)
-						}
-					}
-					body(yamlContract?.request?.body)
-				}
-				response {
-					status(yamlContract?.response?.status)
-					headers {
-						yamlContract?.response?.headers?.each { String key, Object value ->
-							header(key, value)
-						}
-					}
-					body(yamlContract?.response?.body)
-				}
-			}]
-		}
-		catch (FileNotFoundException e) {
-			throw new IllegalStateException(e)
-		}
-	}
-
-	@Override
-	public List<YamlContract> convertTo(Collection<Contract> contracts) {
-		return contracts.collect { Contract contract ->
-			YamlContract yamlContract = new YamlContract()
-			yamlContract.request.with {
-				method = contract?.request?.method?.clientValue
-				url = contract?.request?.url?.clientValue
-				headers = (contract?.request?.headers as Headers)?.asStubSideMap()
-				body = contract?.request?.body?.clientValue as Map
-			}
-			yamlContract.response.with {
-				status = contract?.response?.status?.clientValue as Integer
-				headers = (contract?.response?.headers as Headers)?.asStubSideMap()
-				body = contract?.response?.body?.clientValue as Map
-			}
-			return yamlContract
-		}
-	}
-}

9.1.1 Pact converter

Spring Cloud Contract comes with an out of the box support for Pact representation of contracts. -In other words instead of using the Groovy DSL you can use Pact files. In this section -we will present how to add such a support for your project.

9.1.2 Pact contract

We will be working on the following example of a Pact contract. We’ve placed this file under -the src/test/resources/contracts folder.

{
-  "provider": {
-    "name": "Provider"
-  },
-  "consumer": {
-    "name": "Consumer"
-  },
-  "interactions": [
-    {
-      "description": "",
-      "request": {
-        "method": "PUT",
-        "path": "/fraudcheck",
-        "headers": {
-          "Content-Type": "application/vnd.fraud.v1+json"
-        },
-        "body": {
-          "clientId": "1234567890",
-          "loanAmount": 99999
-        },
-        "matchingRules": {
-          "$.body.clientId": {
-            "match": "regex",
-            "regex": "[0-9]{10}"
-          }
-        }
-      },
-      "response": {
-        "status": 200,
-        "headers": {
-          "Content-Type": "application/vnd.fraud.v1+json;charset=UTF-8"
-        },
-        "body": {
-          "fraudCheckStatus": "FRAUD",
-          "rejectionReason": "Amount too high"
-        },
-        "matchingRules": {
-          "$.body.fraudCheckStatus": {
-            "match": "regex",
-            "regex": "FRAUD"
-          }
-        }
-      }
-    }
-  ],
-  "metadata": {
-    "pact-specification": {
-      "version": "2.0.0"
-    },
-    "pact-jvm": {
-      "version": "2.4.18"
-    }
-  }
-}

9.1.3 Pact for producers

On the producer side you have add to your plugin configuration two additional dependencies. -One is the Spring Cloud Contract Pact support and the other represents the current -Pact version that you’re using.

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-contract-spec-pact</artifactId>
-			<version>${spring-cloud-contract.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>au.com.dius</groupId>
-			<artifactId>pact-jvm-model</artifactId>
-			<version>2.4.18</version>
-		</dependency>
-	</dependencies>
-</plugin>

-

Gradle.  -

classpath "org.springframework.cloud:spring-cloud-contract-spec-pact:${findProperty('verifierVersion') ?: verifierVersion}"
-classpath 'au.com.dius:pact-jvm-model:2.4.18'

-

When you execute the build of your application a test, looking more or less like this, will be generated

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-	// given:
-		MockMvcRequestSpecification request = given()
-				.header("Content-Type", "application/vnd.fraud.v1+json")
-				.body("{\"clientId\":\"1234567890\",\"loanAmount\":99999}");
-
-	// when:
-		ResponseOptions response = given().spec(request)
-				.put("/fraudcheck");
-
-	// then:
-		assertThat(response.statusCode()).isEqualTo(200);
-		assertThat(response.header("Content-Type")).isEqualTo("application/vnd.fraud.v1+json;charset=UTF-8");
-	// and:
-		DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-		assertThatJson(parsedJson).field("rejectionReason").isEqualTo("Amount too high");
-	// and:
-		assertThat(parsedJson.read("$.fraudCheckStatus", String.class)).matches("FRAUD");
-}

and the stub looking like this

{
-  "uuid" : "996ae5ae-6834-4db6-8fac-358ca187ab62",
-  "request" : {
-    "url" : "/fraudcheck",
-    "method" : "PUT",
-    "headers" : {
-      "Content-Type" : {
-        "equalTo" : "application/vnd.fraud.v1+json"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.loanAmount == 99999)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.clientId =~ /([0-9]{10})/)]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\"fraudCheckStatus\":\"FRAUD\",\"rejectionReason\":\"Amount too high\"}",
-    "headers" : {
-      "Content-Type" : "application/vnd.fraud.v1+json;charset=UTF-8"
-    }
-  }
-}

9.1.4 Pact for consumers

On the producer side you have add to your project dependencies two additional dependencies. -One is the Spring Cloud Contract Pact support and the other represents the current -Pact version that you’re using.

Maven.  -

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-spec-pact</artifactId>
-	<scope>test</scope>
-</dependency>
-<dependency>
-	<groupId>au.com.dius</groupId>
-	<artifactId>pact-jvm-model</artifactId>
-	<version>2.4.18</version>
-	<scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-contract-spec-pact"
-testCompile 'au.com.dius:pact-jvm-model:2.4.18'

-

9.2 Custom test generator

If you want to generate tests for different languages than Java or you’re -not happy with the way we’re building Java tests for you then you can register -your own implementation to do that.

Thanks to the interface

package org.springframework.cloud.contract.verifier.builder
-
-import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties
-import org.springframework.cloud.contract.verifier.file.ContractMetadata
-/**
- * Builds a single test.
- *
- * @since 1.1.0
- */
-interface SingleTestGenerator {
-
-	/**
-	 * Creates contents of a single test class in which all test scenarios from
-	 * the contract metadata should be placed.
-	 *
-	 * @param properties - properties passed to the plugin
-	 * @param listOfFiles - list of parsed contracts with additional metadata
-	 * @param className - the name of the generated test class
-	 * @param classPackage - the name of the package in which the test class should be stored
-	 * @param includedDirectoryRelativePath - relative path to the included directory
-	 * @return contents of a single test class
-	 */
-	String buildClass(ContractVerifierConfigProperties properties, Collection<ContractMetadata> listOfFiles,
-					  String className, String classPackage, String includedDirectoryRelativePath)
-
-	/**
-	 * Extension that should be appended to the generated test class. E.g. {@code .java} or {@code .php}
-	 *
-	 * @param properties - properties passed to the plugin
-	 */
-	String fileExtension(ContractVerifierConfigProperties properties)
-}

you can register your own implementation that generates a test. Again, it’s enough to provide -a proper spring.factories file. Example:

org.springframework.cloud.contract.verifier.builder.SingleTestGenerator=/
-com.example.MyGenerator

9.3 Custom stub generator

If you want to generate stubs for other stub server than WireMock it’s enough to - plug in your own implementation of this interface:

package org.springframework.cloud.contract.verifier.converter
-
-import groovy.transform.CompileStatic
-import org.springframework.cloud.contract.spec.Contract
-import org.springframework.cloud.contract.verifier.file.ContractMetadata
-
-/**
- * Converts contracts into their stub representation.
- *
- * @since 1.1.0
- */
-@CompileStatic
-interface StubGenerator {
-
-	/**
-	 * Returns {@code true} if the converter can handle the file to convert it into a stub.
-	 */
-	boolean canHandleFileName(String fileName)
-
-	/**
-	 * Returns the collection of converted contracts into stubs. One contract can
-	 * result in multiple stubs.
-	 */
-	Map<Contract, String> convertContents(String rootName, ContractMetadata content)
-
-	/**
-	 * Returns the name of the converted stub file. If you have multiple contracts
-	 * in a single file then a prefix will be added to the generated file. If you
-	 * provide the {@link Contract#name} field then that field will override the
-	 * generated file name.
-	 *
-	 * Example: name of file with 2 contracts is {@code foo.groovy}, it will be
-	 * converted by the implementation to {@code foo.json}. The recursive file
-	 * converter will create two files {@code 0_foo.json} and {@code 1_foo.json}
-	 */
-	String generateOutputFileNameForInput(String inputFileName)
-}

you can register your own implementation that generate Stubs. Again, it’s enough to provide -a proper spring.factories file. Example:

# Stub converters
-org.springframework.cloud.contract.verifier.converter.StubGenerator=\
-org.springframework.cloud.contract.verifier.wiremock.DslToWireMockClientConverter

The default implementation is the WireMock stub generation.

[Tip]Tip

You can provide multiple stub generator implementations. That way for example from a single -DSL as input you can e.g. produce WireMock stubs and Pact files too!

9.4 Custom Stub Runner

If you decide to have a custom stub generation you also need a custom way of running -stubs with your different stub provider.

Let us assume that you’re using Moco to build your stubs. -You wrote a proper stub generator and your stubs got placed in a JAR file.

In order for Stub Runner to know how to run your stubs you have to define a custom - HTTP Stub server implementation. It can look like this:

package org.springframework.cloud.contract.stubrunner.provider.moco
-
-import com.github.dreamhead.moco.bootstrap.arg.HttpArgs
-import com.github.dreamhead.moco.runner.JsonRunner
-import com.github.dreamhead.moco.runner.RunnerSetting
-import groovy.util.logging.Slf4j
-import org.springframework.cloud.contract.stubrunner.HttpServerStub
-import org.springframework.util.SocketUtils
-
-@Slf4j
-class MocoHttpServerStub implements HttpServerStub {
-
-	private boolean started
-	private JsonRunner runner
-	private int port
-
-	@Override
-	int port() {
-		if (!isRunning()) {
-			return -1
-		}
-		return port
-	}
-
-	@Override
-	boolean isRunning() {
-		return started
-	}
-
-	@Override
-	HttpServerStub start() {
-		return start(SocketUtils.findAvailableTcpPort())
-	}
-
-	@Override
-	HttpServerStub start(int port) {
-		this.port = port
-		return this
-	}
-
-	@Override
-	HttpServerStub stop() {
-		if (!isRunning()) {
-			return this
-		}
-		this.runner.stop()
-		return this
-	}
-
-	@Override
-	HttpServerStub registerMappings(Collection<File> stubFiles) {
-		List<RunnerSetting> settings = stubFiles.findAll { it.name.endsWith("json") }
-				.collect {
-			log.info("Trying to parse [{}]", it.name)
-			try {
-				return RunnerSetting.aRunnerSetting().withStream(it.newInputStream()).build()
-			} catch (Exception e) {
-				log.warn("Exception occurred while trying to parse file [{}]", it.name, e)
-				return null
-			}
-		}.findAll { it }
-		this.runner = JsonRunner.newJsonRunnerWithSetting(settings,
-				HttpArgs.httpArgs().withPort(this.port).build())
-		this.runner.run()
-		this.started = true
-		return this
-	}
-
-	@Override
-	String registeredMappings() {
-		return ""
-	}
-
-	@Override
-	boolean isAccepted(File file) {
-		return file.name.endsWith(".json")
-	}
-}

and just register it in your spring.factories file

org.springframework.cloud.contract.stubrunner.HttpServerStub=\
-org.springframework.cloud.contract.stubrunner.provider.moco.MocoHttpServerStub

that way you’ll be able to run stubs using Moco.

[Important]Important

If you don’t provide any implementation then the default one - WireMock based -will be picked. If you provide more than one then the first one on the list will be picked.

9.5 Custom Stub Downloader

You can customize the way your stubs are downloaded. It’s enough to create an -implementation of the StubDownloaderBuilder

package com.example;
-
-class CustomStubDownloaderBuilder implements StubDownloaderBuilder {
-
-	@Override
-	public StubDownloader build(final StubRunnerOptions stubRunnerOptions) {
-		return new StubDownloader() {
-			@Override
-			public Map.Entry<StubConfiguration, File> downloadAndUnpackStubJar(
-					StubConfiguration config) {
-				File unpackedStubs = retrieveStubs();
-				return new AbstractMap.SimpleEntry<>(
-						new StubConfiguration(config.getGroupId(), config.getArtifactId(), version,
-								config.getClassifier()), unpackedStubs);
-			}
-
-			File retrieveStubs() {
-			    // here goes your custom logic to provide a folder where all the stubs reside
-			}
-}

and just register it in your spring.factories file

# Example of a custom Stub Downloader Provider
-org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder=\
-com.example.CustomStubDownloaderBuilder

that way you’ll be able to pick a folder with the source of your stubs.

[Important]Important

If you don’t provide any implementation then the default one will be picked. - If you provide repositoryRoot property or workOffline flag then Aether based - that will download stubs from a remote repo will be picked. If you don’t provide these - values then the ClasspathStubProvider will be picked that will scan the classpath. - If you provide more than one, then the first one on the list will be picked.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__relaxed_ssl_validation_for_rest_template.html b/multi/multi__relaxed_ssl_validation_for_rest_template.html index 72ef4b94ff..a5ffb82f50 100644 --- a/multi/multi__relaxed_ssl_validation_for_rest_template.html +++ b/multi/multi__relaxed_ssl_validation_for_rest_template.html @@ -1,26 +1,13 @@ - - - 4. Relaxed SSL Validation for Rest Template

4. Relaxed SSL Validation for Rest Template

WireMock allows you to stub a "secure" server with an "https" URL protocol. If your application wants to -contact that stub server in an integration test, then it will find that the SSL certificates are not -valid (it’s the usual problem with self-installed certificates). The best option is often to just -re-configure the client to use "http", but if that’s not open to you then you can ask Spring to configure -an HTTP client that ignores SSL validation errors (just for tests).

To make this work with minimum fuss you need to be using the Spring Boot RestTemplateBuilder in your app, -e.g.

@Bean
-public RestTemplate restTemplate(RestTemplateBuilder builder) {
-	return builder.build();
-}

This is because the builder is passed through callbacks to initalize it, so the SSL validation can be set up -in the client at that point. This will happen automatically in your test if you are using the -@AutoConfigureWireMock annotation (or the stub runner). If you are using the JUnit @Rule approach you need -to add the @AutoConfigureHttpClient annotation as well:

@RunWith(SpringRunner.class)
-@SpringBootTest("app.baseUrl=https://localhost:6443")
-@AutoConfigureHttpClient
-public class WiremockHttpsServerApplicationTests {
+
 
-	@ClassRule
-	public static WireMockClassRule wiremock = new WireMockClassRule(
-			WireMockSpring.options().httpsPort(6443));
-...
-}

If you are using spring-boot-starter-test then you will have the Apache HTTP client on the classpath and it will -be selected by the RestTemplateBuilder and configured to ignore SSL errors. If you are using the default java.net -client you don’t need the annotation (but it won’t do any harm). There is no support currently for other clients, but -it may be added in future releases.

\ No newline at end of file + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__spring_cloud_contract.html b/multi/multi__spring_cloud_contract.html index 548bc7417a..a5ffb82f50 100644 --- a/multi/multi__spring_cloud_contract.html +++ b/multi/multi__spring_cloud_contract.html @@ -1,7 +1,13 @@ - - - 1. Spring Cloud Contract

1. Spring Cloud Contract

You need confidence when pushing new features to a new application or service in a -distributed system. This project provides support for Consumer Driven Contracts and -service schemas in Spring applications (for both HTTP and message-based interactions), -covering a range of options for writing tests, publishing them as assets, and asserting -that a contract is kept by producers and consumers.

\ No newline at end of file + + + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__spring_cloud_contract_faq.html b/multi/multi__spring_cloud_contract_faq.html index 3535e5008a..a5ffb82f50 100644 --- a/multi/multi__spring_cloud_contract_faq.html +++ b/multi/multi__spring_cloud_contract_faq.html @@ -1,702 +1,13 @@ - - - 3. Spring Cloud Contract FAQ

3. Spring Cloud Contract FAQ

3.1 Why use Spring Cloud Contract Verifier and not X ?

For the time being Spring Cloud Contract is a JVM based tool. So it could be your first pick when you’re already creating -software for the JVM. This project has a lot of really interesting features but especially quite a few of them definitely make -Spring Cloud Contract Verifier stand out on the "market" of Consumer Driven Contract (CDC) tooling. Out of many the most interesting are:

  • Possibility to do CDC with messaging
  • Clear and easy to use, statically typed DSL
  • Possibility to copy paste your current JSON file to the contract and only edit its elements
  • Automatic generation of tests from the defined Contract
  • Stub Runner functionality - the stubs are automatically downloaded at runtime from Nexus / Artifactory
  • Spring Cloud integration - no discovery service is needed for integration tests
  • Spring Cloud Contract integrates with Pact out of the box and provides easy hooks to extend its functionality
  • Via Docker adds support for any language & framework used

3.2 I don’t want to write a contract in Groovy!

No problem. You can write a contract in YAML!

3.3 What is this value(consumer(), producer()) ?

One of the biggest challenges related to stubs is their reusability. Only if they can be vastly used, will they serve their purpose. -What typically makes that difficult are the hard-coded values of request / response elements. For example dates or ids. -Imagine the following JSON request

{
-    "time" : "2016-10-10 20:10:15",
-    "id" : "9febab1c-6f36-4a0b-88d6-3b6a6d81cd4a",
-    "body" : "foo"
-}

and JSON response

{
-    "time" : "2016-10-10 21:10:15",
-    "id" : "c4231e1f-3ca9-48d3-b7e7-567d55f0d051",
-    "body" : "bar"
-}

Imagine the pain required to set proper value of the time field (let’s assume that this content is generated by the -database) by changing the clock in the system or providing stub implementations of data providers. The same is related -to the field called id. Will you create a stubbed implementation of UUID generator? Makes little sense…​

So as a consumer you would like to send a request that matches any form of a time or any UUID. That way your system -will work as usual - will generate data and you won’t have to stub anything out. Let’s assume that in case of the aforementioned -JSON the most important part is the body field. You can focus on that and provide matching for other fields. In other words -you would like the stub to work like this:

{
-    "time" : "SOMETHING THAT MATCHES TIME",
-    "id" : "SOMETHING THAT MATCHES UUID",
-    "body" : "foo"
-}

As far as the response goes as a consumer you need a concrete value that you can operate on. So such a JSON is valid

{
-    "time" : "2016-10-10 21:10:15",
-    "id" : "c4231e1f-3ca9-48d3-b7e7-567d55f0d051",
-    "body" : "bar"
-}

As you could see in the previous sections we generate tests from contracts. So from the producer’s side the situation looks -much different. We’re parsing the provided contract and in the test we want to send a real request to your endpoints. -So for the case of a producer for the request we can’t have any sort of matching. We need concrete values that the -producer’s backend can work on. Such a JSON would be a valid one:

{
-    "time" : "2016-10-10 20:10:15",
-    "id" : "9febab1c-6f36-4a0b-88d6-3b6a6d81cd4a",
-    "body" : "foo"
-}

On the other hand from the point of view of the validity of the contract the response doesn’t necessarily have to -contain concrete values of time or id. Let’s say that you generate those on the producer side - again, you’d -have to do a lot of stubbing to ensure that you always return the same values. That’s why from the producer’s side -what you might want is the following response:

{
-    "time" : "SOMETHING THAT MATCHES TIME",
-    "id" : "SOMETHING THAT MATCHES UUID",
-    "body" : "bar"
-}

How can you then provide one time a matcher for the consumer and a concrete value for the producer and vice versa? -In Spring Cloud Contract we’re allowing you to provide a dynamic value. That means that it can differ for both -sides of the communication. You can pass the values:

Either via the value method

value(consumer(...), producer(...))
-value(stub(...), test(...))
-value(client(...), server(...))

or using the $() method

$(consumer(...), producer(...))
-$(stub(...), test(...))
-$(client(...), server(...))

You can read more about this in the Chapter 8, Contract DSL section.

Calling value() or $() tells Spring Cloud Contract that you will be passing a dynamic value. -Inside the consumer() method you pass the value that should be used on the consumer side (in the generated stub). -Inside the producer() method you pass the value that should be used on the producer side (in the generated test).

[Tip]Tip

If on one side you have passed the regular expression and you haven’t passed the other, then the -other side will get auto-generated.

Most often you will use that method together with the regex helper method. E.g. consumer(regex('[0-9]{10}')).

To sum it up the contract for the aforementioned scenario would look more or less like this (the regular expression -for time and UUID are simplified and most likely invalid but we want to keep things very simple in this example):

org.springframework.cloud.contract.spec.Contract.make {
-				request {
-					method 'GET'
-					url '/someUrl'
-					body([
-					    time : value(consumer(regex('[0-9]{4}-[0-9]{2}-[0-9]{2} [0-2][0-9]-[0-5][0-9]-[0-5][0-9]')),
-					    id: value(consumer(regex('[0-9a-zA-z]{8}-[0-9a-zA-z]{4}-[0-9a-zA-z]{4}-[0-9a-zA-z]{12}'))
-					    body: "foo"
-					])
-				}
-			response {
-				status OK()
-				body([
-					    time : value(producer(regex('[0-9]{4}-[0-9]{2}-[0-9]{2} [0-2][0-9]-[0-5][0-9]-[0-5][0-9]')),
-					    id: value([producer(regex('[0-9a-zA-z]{8}-[0-9a-zA-z]{4}-[0-9a-zA-z]{4}-[0-9a-zA-z]{12}'))
-					    body: "bar"
-					])
-			}
-}
[Important]Important

Please read the Groovy docs related to JSON to understand how to -properly structure the request / response bodies.

3.4 How to do Stubs versioning?

3.4.1 API Versioning

Let’s try to answer a question what versioning really means. If you’re referring to the API version then there are -different approaches.

  • use Hypermedia, links and do not version your API by any means
  • pass versions through headers / urls

I will not try to answer a question which approach is better. Whatever suits your needs and allows you to generate -business value should be picked.

Let’s assume that you do version your API. In that case you should provide as many contracts as many versions you support. -You can create a subfolder for every version or append it to the contract name - whatever suits you more.

3.4.2 JAR versioning

If by versioning you mean the version of the JAR that contains the stubs then there are essentially two main approaches.

Let’s assume that you’re doing Continuous Delivery / Deployment which means that you’re generating a new version of -the jar each time you go through the pipeline and that jar can go to production at any time. For example your jar version -looks like this (it got built on the 20.10.2016 at 20:15:21) :

1.0.0.20161020-201521-RELEASE

In that case your generated stub jar will look like this.

1.0.0.20161020-201521-RELEASE-stubs.jar

In this case you should inside your application.yml or @AutoConfigureStubRunner when referencing stubs provide the - latest version of the stubs. You can do that by passing the + sign. Example

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:8080"})

If the versioning however is fixed (e.g. 1.0.4.RELEASE or 2.1.1) then you have to set the concrete value of the jar -version. Example for 2.1.1.

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:2.1.1:stubs:8080"})

3.4.3 Dev or prod stubs

You can manipulate the classifier to run the tests against current development version of the stubs of other services - or the ones that were deployed to production. If you alter your build to deploy the stubs with the prod-stubs classifier - once you reach production deployment then you can run tests in one case with dev stubs and one with prod stubs.

Example of tests using development version of stubs

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:8080"})

Example of tests using production version of stubs

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:prod-stubs:8080"})

You can pass those values also via properties from your deployment pipeline.

3.5 Common repo with contracts

Another way of storing contracts other than having them with the producer is keeping them in a common place. -It can be related to security issues where the consumers can’t clone the producer’s code. Also if you keep -contracts in a single place then you, as a producer, will know how many consumers you have and which -consumer you will break with your local changes.

3.5.1 Repo structure

Let’s assume that we have a producer with coordinates com.example:server and 3 consumers: client1, -client2, client3. Then in the repository with common contracts you would have the following setup -(which you can checkout here):

├── com
-│   └── example
-│       └── server
-│           ├── client1
-│           │   └── expectation.groovy
-│           ├── client2
-│           │   └── expectation.groovy
-│           ├── client3
-│           │   └── expectation.groovy
-│           └── pom.xml
-├── mvnw
-├── mvnw.cmd
-├── pom.xml
-└── src
-    └── assembly
-        └── contracts.xml

As you can see under the slash-delimited groupid / artifact id folder (com/example/server) you have -expectations of the 3 consumers (client1, client2 and client3). Expectations are the standard Groovy DSL -contract files as described throughout this documentation. This repository has to produce a JAR file that maps -one to one to the contents of the repo.

Example of a pom.xml inside the server folder.

<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xmlns="http://maven.apache.org/POM/4.0.0"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
+
 
-	<groupId>com.example</groupId>
-	<artifactId>server</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
+
+
 
-	<name>Server Stubs</name>
-	<description>POM used to install locally stubs for consumer side</description>
+
 
-	<parent>
-		<groupId>org.springframework.boot</groupId>
-		<artifactId>spring-boot-starter-parent</artifactId>
-		<version>2.1.3.RELEASE</version>
-		<relativePath/>
-	</parent>
+Page Redirection
 
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<java.version>1.8</java.version>
-		<spring-cloud-contract.version>2.1.2.BUILD-SNAPSHOT</spring-cloud-contract.version>
-		<spring-cloud-release.version>Greenwich.BUILD-SNAPSHOT
-		</spring-cloud-release.version>
-		<excludeBuildFolders>true</excludeBuildFolders>
-	</properties>
-
-	<dependencyManagement>
-		<dependencies>
-			<dependency>
-				<groupId>org.springframework.cloud</groupId>
-				<artifactId>spring-cloud-dependencies</artifactId>
-				<version>${spring-cloud-release.version}</version>
-				<type>pom</type>
-				<scope>import</scope>
-			</dependency>
-		</dependencies>
-	</dependencyManagement>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.springframework.cloud</groupId>
-				<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-				<version>${spring-cloud-contract.version}</version>
-				<extensions>true</extensions>
-				<configuration>
-					<!-- By default it would search under src/test/resources/ -->
-					<contractsDirectory>${project.basedir}</contractsDirectory>
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
-
-	<repositories>
-		<repository>
-			<id>spring-snapshots</id>
-			<name>Spring Snapshots</name>
-			<url>https://repo.spring.io/snapshot</url>
-			<snapshots>
-				<enabled>true</enabled>
-			</snapshots>
-		</repository>
-		<repository>
-			<id>spring-milestones</id>
-			<name>Spring Milestones</name>
-			<url>https://repo.spring.io/milestone</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</repository>
-		<repository>
-			<id>spring-releases</id>
-			<name>Spring Releases</name>
-			<url>https://repo.spring.io/release</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</repository>
-	</repositories>
-	<pluginRepositories>
-		<pluginRepository>
-			<id>spring-snapshots</id>
-			<name>Spring Snapshots</name>
-			<url>https://repo.spring.io/snapshot</url>
-			<snapshots>
-				<enabled>true</enabled>
-			</snapshots>
-		</pluginRepository>
-		<pluginRepository>
-			<id>spring-milestones</id>
-			<name>Spring Milestones</name>
-			<url>https://repo.spring.io/milestone</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</pluginRepository>
-		<pluginRepository>
-			<id>spring-releases</id>
-			<name>Spring Releases</name>
-			<url>https://repo.spring.io/release</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</pluginRepository>
-	</pluginRepositories>
-
-</project>

As you can see there are no dependencies other than the Spring Cloud Contract Maven Plugin. -Those poms are necessary for the consumer side to run mvn clean install -DskipTests to locally install - stubs of the producer project.

The pom.xml in the root folder can look like this:

<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xmlns="http://maven.apache.org/POM/4.0.0"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<groupId>com.example.standalone</groupId>
-	<artifactId>contracts</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
-
-	<name>Contracts</name>
-	<description>Contains all the Spring Cloud Contracts, well, contracts. JAR used by the
-		producers to generate tests and stubs
-	</description>
-
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-	</properties>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-assembly-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>contracts</id>
-						<phase>prepare-package</phase>
-						<goals>
-							<goal>single</goal>
-						</goals>
-						<configuration>
-							<attach>true</attach>
-							<descriptor>${basedir}/src/assembly/contracts.xml</descriptor>
-							<!-- If you want an explicit classifier remove the following line -->
-							<appendAssemblyId>false</appendAssemblyId>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-
-</project>

It’s using the assembly plugin in order to build the JAR with all the contracts. Example of such setup is here:

<assembly xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		  xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-		  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>project</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>${project.basedir}</directory>
-			<outputDirectory>/</outputDirectory>
-			<useDefaultExcludes>true</useDefaultExcludes>
-			<excludes>
-				<exclude>**/${project.build.directory}/**</exclude>
-				<exclude>mvnw</exclude>
-				<exclude>mvnw.cmd</exclude>
-				<exclude>.mvn/**</exclude>
-				<exclude>src/**</exclude>
-			</excludes>
-		</fileSet>
-	</fileSets>
-</assembly>

3.5.2 Workflow

The workflow would look similar to the one presented in the Step by step guide to CDC. The only difference - is that the producer doesn’t own the contracts anymore. So the consumer and the producer have to work on - common contracts in a common repository.

3.5.3 Consumer

When the consumer wants to work on the contracts offline, instead of cloning the producer code, the -consumer team clones the common repository, goes to the required producer’s folder (e.g. com/example/server) -and runs mvn clean install -DskipTests to install locally the stubs converted from the contracts.

[Tip]Tip

You need to have Maven installed locally

3.5.4 Producer

As a producer it’s enough to alter the Spring Cloud Contract Verifier to provide the URL and the dependency -of the JAR containing the contracts:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<contractsMode>REMOTE</contractsMode>
-		<contractsRepositoryUrl>
-			http://link/to/your/nexus/or/artifactory/or/sth
-		</contractsRepositoryUrl>
-		<contractDependency>
-			<groupId>com.example.standalone</groupId>
-			<artifactId>contracts</artifactId>
-		</contractDependency>
-	</configuration>
-</plugin>

With this setup the JAR with groupid com.example.standalone and artifactid contracts will be downloaded -from http://link/to/your/nexus/or/artifactory/or/sth. It will be then unpacked in a local temporary folder -and contracts present under the com/example/server will be picked as the ones used to generate the -tests and the stubs. Due to this convention the producer team will know which consumer teams will be broken -when some incompatible changes are done.

The rest of the flow looks the same.

3.5.5 How can I define messaging contracts per topic not per producer?

To avoid messaging contracts duplication in the common repo, when few producers writing messages to one topic, -we could create the structure when the rest contracts would be placed in a folder per producer and messaging -contracts in the folder per topic.

For Maven Project

To make it possible to work on the producer side we should specify an inclusion pattern for -filtering common repository jar by messaging topics we are interested in. includedFiles property of Maven Spring Cloud Contract plugin -allows us to do that. Also contractsPath need to be specified since the default path would be the common repository groupid/artifactid.

<plugin>
-   <groupId>org.springframework.cloud</groupId>
-   <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-   <version>${spring-cloud-contract.version}</version>
-   <configuration>
-      <contractsMode>REMOTE</contractsMode>
-      <contractsRepositoryUrl>http://link/to/your/nexus/or/artifactory/or/sth</contractsRepositoryUrl>
-      <contractDependency>
-         <groupId>com.example</groupId>
-         <artifactId>common-repo-with-contracts</artifactId>
-         <version>+</version>
-      </contractDependency>
-      <contractsPath>/</contractsPath>
-      <baseClassMappings>
-         <baseClassMapping>
-            <contractPackageRegex>.*messaging.*</contractPackageRegex>
-            <baseClassFQN>com.example.services.MessagingBase</baseClassFQN>
-         </baseClassMapping>
-         <baseClassMapping>
-            <contractPackageRegex>.*rest.*</contractPackageRegex>
-            <baseClassFQN>com.example.services.TestBase</baseClassFQN>
-         </baseClassMapping>
-      </baseClassMappings>
-      <includedFiles>
-         <includedFile>**/${project.artifactId}/**</includedFile>
-         <includedFile>**/${first-topic}/**</includedFile>
-         <includedFile>**/${second-topic}/**</includedFile>
-      </includedFiles>
-   </configuration>
-</plugin>

For Gradle Project

  • Add a custom configuration for the common-repo dependency:
ext {
-    conractsGroupId = "com.example"
-    contractsArtifactId = "common-repo"
-    contractsVersion = "1.2.3"
-}
-
-configurations {
-    contracts {
-        transitive = false
-    }
-}
  • Add the common-repo dependency to your classpath:
dependencies {
-    contracts "${conractsGroupId}:${contractsArtifactId}:${contractsVersion}"
-    testCompile "${conractsGroupId}:${contractsArtifactId}:${contractsVersion}"
-}
  • Download the dependency to an appropriate folder:
task getContracts(type: Copy) {
-    from configurations.contracts
-    into new File(project.buildDir, "downloadedContracts")
-}
  • Unzip JAR:
task unzipContracts(type: Copy) {
-    def zipFile = new File(project.buildDir, "downloadedContracts/${contractsArtifactId}-${contractsVersion}.jar")
-    def outputDir = file("${buildDir}/unpackedContracts")
-
-    from zipTree(zipFile)
-    into outputDir
-}
  • Cleanup unused contracts:
task deleteUnwantedContracts(type: Delete) {
-    delete fileTree(dir: "${buildDir}/unpackedContracts",
-        include: "**/*",
-        excludes: [
-            "**/${project.name}/**"",
-            "**/${first-topic}/**",
-            "**/${second-topic}/**"])
-}
  • Create task dependencies:
unzipContracts.dependsOn("getContracts")
-deleteUnwantedContracts.dependsOn("unzipContracts")
-build.dependsOn("deleteUnwantedContracts")
  • Configure plugin by specifying the directory containing contracts using contractsDslDir property
contracts {
-    contractsDslDir = new File("${buildDir}/unpackedContracts")
-}

3.6 Do I need a Binary Storage? Can’t I use Git?

In the polyglot world, there are languages that don’t use binary storages like -Artifactory or Nexus. Starting from Spring Cloud Contract version 2.0.0 we provide -mechanisms to store contracts and stubs in a SCM repository. Currently the -only supported SCM is Git.

The repository would have to the following setup -(which you can checkout here):

.
-└── META-INF
-    └── com.example
-        └── beer-api-producer-git
-            └── 0.0.1-SNAPSHOT
-                ├── contracts
-                │   └── beer-api-consumer
-                │       ├── messaging
-                │       │   ├── shouldSendAcceptedVerification.groovy
-                │       │   └── shouldSendRejectedVerification.groovy
-                │       └── rest
-                │           ├── shouldGrantABeerIfOldEnough.groovy
-                │           └── shouldRejectABeerIfTooYoung.groovy
-                └── mappings
-                    └── beer-api-consumer
-                        └── rest
-                            ├── shouldGrantABeerIfOldEnough.json
-                            └── shouldRejectABeerIfTooYoung.json

Under META-INF folder:

  • we group applications via groupId (e.g. com.example)
  • then each application is represented via the artifactId (e.g. beer-api-producer-git)
  • next, the version of the application (e.g. 0.0.1-SNAPSHOT). Starting from Spring Cloud Contract version 2.1.0, you can specify the versions as follows (assuming that your versions follow the semantic versioning)

    • + or latest - to find the latest version of your stubs (assuming that the snapshots are always the latest artifact for a given revision number). That means:

      • if you have a version 1.0.0.RELEASE, 2.0.0.BUILD-SNAPSHOT and 2.0.0.RELEASE we will assume that the latest is 2.0.0.BUILD-SNAPSHOT
      • if you have a version 1.0.0.RELEASE and 2.0.0.RELEASE we will assume that the latest is 2.0.0.RELEASE
      • if you have a version called latest or + we will pick that folder
    • release - to find the latest release version of your stubs. That means:

      • if you have a version 1.0.0.RELEASE, 2.0.0.BUILD-SNAPSHOT and 2.0.0.RELEASE we will assume that the latest is 2.0.0.RELEASE
      • if you have a version called release we will pick that folder
  • finally, there are two folders:

    • contracts - the good practice is to store the contracts required by each -consumer in the folder with the consumer name (e.g. beer-api-consumer). That way you -can use the stubs-per-consumer feature. Further directory structure is arbitrary.
    • mappings - in this folder the Maven / Gradle Spring Cloud Contract plugins will push -the stub server mappings. On the consumer side, Stub Runner will scan this folder -to start stub servers with stub definitions. The folder structure will be a copy -of the one created in the contracts subfolder.

3.6.1 Protocol convention

In order to control the type and location of the source of contracts (whether it’s -a binary storage or an SCM repository), you can use the protocol in the URL of -the repository. Spring Cloud Contract iterates over registered protocol resolvers -and tries to fetch the contracts (via a plugin) or stubs (via Stub Runner).

For the SCM functionality, currently, we support the Git repository. To use it, -in the property, where the repository URL needs to be placed you just have to prefix -the connection URL with git://. Here you can find a couple of examples:

git://file:///foo/bar
-git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git
-git://git@github.com:spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git

3.6.2 Producer

For the producer, to use the SCM approach, we can reuse the -same mechanism we use for external contracts. We route Spring Cloud Contract -to use the SCM implementation via the URL that contains -the git:// protocol.

[Important]Important

You have to manually add the pushStubsToScm -goal in Maven or execute (bind) the pushStubsToScm task in -Gradle. We don’t push stubs to origin of your git -repository out of the box.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <!-- Base class mappings etc. -->
-
-        <!-- We want to pick contracts from a Git repository -->
-        <contractsRepositoryUrl>git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git</contractsRepositoryUrl>
-
-        <!-- We reuse the contract dependency section to set up the path
-        to the folder that contains the contract definitions. In our case the
-        path will be /groupId/artifactId/version/contracts -->
-        <contractDependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>${project.artifactId}</artifactId>
-            <version>${project.version}</version>
-        </contractDependency>
-
-        <!-- The contracts mode can't be classpath -->
-        <contractsMode>REMOTE</contractsMode>
-    </configuration>
-    <executions>
-        <execution>
-            <phase>package</phase>
-            <goals>
-                <!-- By default we will not push the stubs back to SCM,
-                you have to explicitly add it as a goal -->
-                <goal>pushStubsToScm</goal>
-            </goals>
-        </execution>
-    </executions>
-</plugin>

-

Gradle.  -

contracts {
-	// We want to pick contracts from a Git repository
-	contractDependency {
-		stringNotation = "${project.group}:${project.name}:${project.version}"
-	}
-	/*
-	We reuse the contract dependency section to set up the path
-	to the folder that contains the contract definitions. In our case the
-	path will be /groupId/artifactId/version/contracts
-	 */
-	contractRepository {
-		repositoryUrl = "git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git"
-	}
-	// The mode can't be classpath
-	contractsMode = "REMOTE"
-	// Base class mappings etc.
-}
-
-/*
-In this scenario we want to publish stubs to SCM whenever
-the `publish` task is executed
-*/
-publish.dependsOn("publishStubsToScm")

-

With such a setup:

  • Git project will be cloned to a temporary directory
  • The SCM stub downloader will go to META-INF/groupId/artifactId/version/contracts folder -to find contracts. E.g. for com.example:foo:1.0.0 the path would be -META-INF/com.example/foo/1.0.0/contracts
  • Tests will be generated from the contracts
  • Stubs will be created from the contracts
  • Once the tests pass, the stubs will be committed in the cloned repository
  • Finally, a push will be done to that repo’s origin

3.6.3 Producer with contracts stored locally

Another option to use the SCM as the destination for stubs and contracts is to store the contracts locally, with the producer, and only push the contracts and the stubs to SCM. Below, you can find the setup required to achieve this using Maven and Gradle.

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<!-- In the default configuration, we want to use the contracts stored locally -->
-	<configuration>
-		<baseClassMappings>
-			<baseClassMapping>
-				<contractPackageRegex>.*messaging.*</contractPackageRegex>
-				<baseClassFQN>com.example.BeerMessagingBase</baseClassFQN>
-			</baseClassMapping>
-			<baseClassMapping>
-				<contractPackageRegex>.*rest.*</contractPackageRegex>
-				<baseClassFQN>com.example.BeerRestBase</baseClassFQN>
-			</baseClassMapping>
-		</baseClassMappings>
-		<basePackageForTests>com.example</basePackageForTests>
-	</configuration>
-	<executions>
-		<execution>
-			<phase>package</phase>
-			<goals>
-				<!-- By default we will not push the stubs back to SCM,
-				you have to explicitly add it as a goal -->
-				<goal>pushStubsToScm</goal>
-			</goals>
-			<configuration>
-				<!-- We want to pick contracts from a Git repository -->
-				<contractsRepositoryUrl>git://file://${env.ROOT}/target/contract_empty_git/
-				</contractsRepositoryUrl>
-				<!-- Example of URL via git protocol -->
-				<!--<contractsRepositoryUrl>git://git@github.com:spring-cloud-samples/spring-cloud-contract-samples.git</contractsRepositoryUrl>-->
-				<!-- Example of URL via http protocol -->
-				<!--<contractsRepositoryUrl>git://https://github.com/spring-cloud-samples/spring-cloud-contract-samples.git</contractsRepositoryUrl>-->
-				<!-- We reuse the contract dependency section to set up the path
-				to the folder that contains the contract definitions. In our case the
-				path will be /groupId/artifactId/version/contracts -->
-				<contractDependency>
-					<groupId>${project.groupId}</groupId>
-					<artifactId>${project.artifactId}</artifactId>
-					<version>${project.version}</version>
-				</contractDependency>
-				<!-- The mode can't be classpath -->
-				<contractsMode>LOCAL</contractsMode>
-			</configuration>
-		</execution>
-	</executions>
-</plugin>

-

Gradle.  -

contracts {
-		// Base package for generated tests
-	basePackageForTests = "com.example"
-	baseClassMappings {
-		baseClassMapping(".*messaging.*", "com.example.BeerMessagingBase")
-		baseClassMapping(".*rest.*", "com.example.BeerRestBase")
-	}
-}
-
-/*
-In this scenario we want to publish stubs to SCM whenever
-the `publish` task is executed
-*/
-publishStubsToScm {
-	// We want to modify the default set up of the plugin when publish stubs to scm is called
-	customize {
-		// We want to pick contracts from a Git repository
-		contractDependency {
-			stringNotation = "${project.group}:${project.name}:${project.version}"
-		}
-		/*
-		We reuse the contract dependency section to set up the path
-		to the folder that contains the contract definitions. In our case the
-		path will be /groupId/artifactId/version/contracts
-		 */
-		contractRepository {
-			repositoryUrl = "git://file://${System.getenv("ROOT")}/target/contract_empty_git/"
-		}
-		// The mode can't be classpath
-		contractsMode = "LOCAL"
-	}
-}
-
-publish.dependsOn("publishStubsToScm")
-publishToMavenLocal.dependsOn("publishStubsToScm")

-

With such a setup:

  • Contracts from the default src/test/resources/contracts directory will be picked
  • Tests will be generated from the contracts
  • Stubs will be created from the contracts
  • Once the tests pass

    • Git project will be cloned to a temporary directory
    • The stubs and contracts will be committed in the cloned repository
  • Finally, a push will be done to that repo’s origin

Keeping contracts with the producer and stubs in an external repository

It is also possible to keep the contracts in the producer repository, but keep the stubs in an external git repo. -This is most useful when you want to use the base consumer-producer collaboration flow, but do not have a possibility to -use an artifact repository for storing the stubs.

In order to do that, use the usual producer setup, and then add the pushStubsToScm goal and set -contractsRepositoryUrl to the repository where you want to keep the stubs.

3.6.4 Consumer

On the consumer side when passing the repositoryRoot parameter, -either from the @AutoConfigureStubRunner annotation, the -JUnit rule, JUnit 5 extension or properties, it’s enough to pass the URL of the -SCM repository, prefixed with the protocol. For example

@AutoConfigureStubRunner(
-    stubsMode="REMOTE",
-    repositoryRoot="git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git",
-    ids="com.example:bookstore:0.0.1.RELEASE"
-)

With such a setup:

  • Git project will be cloned to a temporary directory
  • The SCM stub downloader will go to META-INF/groupId/artifactId/version/ folder -to find stub definitions and contracts. E.g. for com.example:foo:1.0.0 the path would be -META-INF/com.example/foo/1.0.0/
  • Stub servers will be started and fed with mappings
  • Messaging definitions will be read and used in the messaging tests

3.7 Can I use the Pact Broker?

When using Pact you can use the Pact Broker -to store and share Pact definitions. Starting from Spring Cloud Contract -2.0.0 one can fetch Pact files from the Pact Broker to generate -tests and stubs.

As a prerequisite the Pact Converter and Pact Stub Downloader -are required. You have to add them via the spring-cloud-contract-pact dependency. -You can read more about it in the Section 10.1.1, “Pact Converter” section.

[Important]Important

Pact follows the Consumer Contract convention. That means -that the Consumer creates the Pact definitions first, then -shares the files with the Producer. Those expectations are generated -from the Consumer’s code and can break the Producer if the expectations -are not met.

3.7.1 Pact Consumer

The consumer uses Pact framework to generate Pact files. The -Pact files are sent to the Pact Broker. An example of such -setup can be found here.

3.7.2 Producer

For the producer, to use the Pact files from the Pact Broker, we can reuse the -same mechanism we use for external contracts. We route Spring Cloud Contract -to use the Pact implementation via the URL that contains -the pact:// protocol. It’s enough to pass the URL to the -Pact Broker. An example of such setup can be found here.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <!-- Base class mappings etc. -->
-
-        <!-- We want to pick contracts from a Git repository -->
-        <contractsRepositoryUrl>pact://http://localhost:8085</contractsRepositoryUrl>
-
-        <!-- We reuse the contract dependency section to set up the path
-        to the folder that contains the contract definitions. In our case the
-        path will be /groupId/artifactId/version/contracts -->
-        <contractDependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>${project.artifactId}</artifactId>
-            <!-- When + is passed, a latest tag will be applied when fetching pacts -->
-            <version>+</version>
-        </contractDependency>
-
-        <!-- The contracts mode can't be classpath -->
-        <contractsMode>REMOTE</contractsMode>
-    </configuration>
-    <!-- Don't forget to add spring-cloud-contract-pact to the classpath! -->
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-contract-pact</artifactId>
-            <version>${spring-cloud-contract.version}</version>
-        </dependency>
-    </dependencies>
-</plugin>

-

Gradle.  -

buildscript {
-	repositories {
-		//...
-	}
-
-	dependencies {
-		// ...
-		// Don't forget to add spring-cloud-contract-pact to the classpath!
-		classpath "org.springframework.cloud:spring-cloud-contract-pact:${contractVersion}"
-	}
-}
-
-contracts {
-	// When + is passed, a latest tag will be applied when fetching pacts
-	contractDependency {
-		stringNotation = "${project.group}:${project.name}:+"
-	}
-	contractRepository {
-		repositoryUrl = "pact://http://localhost:8085"
-	}
-	// The mode can't be classpath
-	contractsMode = "REMOTE"
-	// Base class mappings etc.
-}

-

With such a setup:

  • Pact files will be downloaded from the Pact Broker
  • Spring Cloud Contract will convert the Pact files into tests and stubs
  • The JAR with the stubs gets automatically created as usual

3.7.3 Pact Consumer (Producer Contract approach)

In the scenario where you don’t want to do Consumer Contract approach -(for every single consumer define the expectations) but you’d prefer -to do Producer Contracts (the producer provides the contracts and -publishes stubs), it’s enough to use Spring Cloud Contract with -Stub Runner option. An example of such setup can be found here.

First, remember to add Stub Runner and Spring Cloud Contract Pact module -as test dependencies.

Maven.  -

<dependencyManagement>
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-dependencies</artifactId>
-            <version>${spring-cloud.version}</version>
-            <type>pom</type>
-            <scope>import</scope>
-        </dependency>
-    </dependencies>
-</dependencyManagement>
-
-<!-- Don't forget to add spring-cloud-contract-pact to the classpath! -->
-<dependencies>
-    <!-- ... -->
-    <dependency>
-        <groupId>org.springframework.cloud</groupId>
-        <artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-        <scope>test</scope>
-    </dependency>
-    <dependency>
-        <groupId>org.springframework.cloud</groupId>
-        <artifactId>spring-cloud-contract-pact</artifactId>
-        <scope>test</scope>
-    </dependency>
-</dependencies>

-

Gradle.  -

dependencyManagement {
-    imports {
-        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
-    }
-}
-
-dependencies {
-    //...
-    testCompile("org.springframework.cloud:spring-cloud-starter-contract-stub-runner")
-    // Don't forget to add spring-cloud-contract-pact to the classpath!
-    testCompile("org.springframework.cloud:spring-cloud-contract-pact")
-}

-

Next, just pass the URL of the Pact Broker to repositoryRoot, prefixed -with pact:// protocol. E.g. pact://http://localhost:8085

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureStubRunner(stubsMode = StubRunnerProperties.StubsMode.REMOTE,
-		ids = "com.example:beer-api-producer-pact",
-		repositoryRoot = "pact://http://localhost:8085")
-public class BeerControllerTest {
-    //Inject the port of the running stub
-    @StubRunnerPort("beer-api-producer-pact") int producerPort;
-    //...
-}

With such a setup:

  • Pact files will be downloaded from the Pact Broker
  • Spring Cloud Contract will convert the Pact files into stub definitions
  • The stub servers will be started and fed with stubs

For more information about Pact support you can go to -the Section 10.7, “Using the Pact Stub Downloader” section.

3.8 How can I debug the request/response being sent by the generated tests client?

The generated tests all boil down to RestAssured in some form or fashion which relies on Apache HttpClient. HttpClient has a facility called wire logging which logs the entire request and response to HttpClient. Spring Boot has a logging common application property for doing this sort of thing, just add this to your application properties

logging.level.org.apache.http.wire=DEBUG

3.8.1 How can I debug the mapping/request/response being sent by WireMock?

Starting from version 1.2.0 we turn on WireMock logging to -info and the WireMock notifier to being verbose. Now you will -exactly know what request was received by WireMock server and which -matching response definition was picked.

To turn off this feature just bump WireMock logging to ERROR

logging.level.com.github.tomakehurst.wiremock=ERROR

3.8.2 How can I see what got registered in the HTTP server stub?

You can use the mappingsOutputFolder property on @AutoConfigureStubRunner, StubRunnerRule or -`StubRunnerExtension`to dump all mappings per artifact id. Also the port at which the given stub server -was started will be attached.

3.8.3 Can I reference text from file?

Yes! With version 1.2.0 we’ve added such a possibility. It’s enough to call file(…​) method in the -DSL and provide a path relative to where the contract lays. -If you’re using YAML just use the bodyFromFile property.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__spring_cloud_contract_stub_runner.html b/multi/multi__spring_cloud_contract_stub_runner.html index 668ecc65ad..a5ffb82f50 100644 --- a/multi/multi__spring_cloud_contract_stub_runner.html +++ b/multi/multi__spring_cloud_contract_stub_runner.html @@ -1,868 +1,13 @@ - - - 6. Spring Cloud Contract Stub Runner

6. Spring Cloud Contract Stub Runner

One of the issues that you might encounter while using Spring Cloud Contract Verifier is -passing the generated WireMock JSON stubs from the server side to the client side (or to -various clients). The same takes place in terms of client-side generation for messaging.

Copying the JSON files and setting the client side for messaging manually is out of the -question. That is why we introduced Spring Cloud Contract Stub Runner. It can -automatically download and run the stubs for you.

6.1 Snapshot versions

Add the additional snapshot repository to your build.gradle file to use snapshot -versions, which are automatically uploaded after every successful build:

Maven.  -

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

-

Gradle.  -

buildscript {
-	repositories {
-		mavenCentral()
-		mavenLocal()
-		maven { url "https://repo.spring.io/snapshot" }
-		maven { url "https://repo.spring.io/milestone" }
-		maven { url "https://repo.spring.io/release" }
-	}

-

6.2 Publishing Stubs as JARs

The easiest approach would be to centralize the way stubs are kept. For example, you can -keep them as jars in a Maven repository.

[Tip]Tip

For both Maven and Gradle, the setup comes ready to work. However, you can customize -it if you want to.

Maven.  -

<!-- 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>
+
 
-<!-- Next add the assembly plugin to your build -->
-<!-- we want the assembly plugin to generate the JAR -->
-<plugin>
-	<groupId>org.apache.maven.plugins</groupId>
-	<artifactId>maven-assembly-plugin</artifactId>
-	<executions>
-		<execution>
-			<id>stub</id>
-			<phase>prepare-package</phase>
-			<goals>
-				<goal>single</goal>
-			</goals>
-			<inherited>false</inherited>
-			<configuration>
-				<attach>true</attach>
-				<descriptors>
-					${basedir}/src/assembly/stub.xml
-				</descriptors>
-			</configuration>
-		</execution>
-	</executions>
-</plugin>
+
+
 
-<!-- Finally setup your assembly. Below you can find the contents of src/main/assembly/stub.xml -->
-<assembly
-	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>stubs</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>src/main/java</directory>
-			<outputDirectory>/</outputDirectory>
-			<includes>
-				<include>**com/example/model/*.*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${project.build.directory}/classes</directory>
-			<outputDirectory>/</outputDirectory>
-			<includes>
-				<include>**com/example/model/*.*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${project.build.directory}/snippets/stubs</directory>
-			<outputDirectory>META-INF/${project.groupId}/${project.artifactId}/${project.version}/mappings</outputDirectory>
-			<includes>
-				<include>**/*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${basedir}/src/test/resources/contracts</directory>
-			<outputDirectory>META-INF/${project.groupId}/${project.artifactId}/${project.version}/contracts</outputDirectory>
-			<includes>
-				<include>**/*.groovy</include>
-			</includes>
-		</fileSet>
-	</fileSets>
-</assembly>

-

Gradle.  -

ext {
-	contractsDir = file("mappings")
-	stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
-}
+
 
-// Automatically added by plugin:
-// copyContracts - copies contracts to the output folder from which JAR will be created
-// verifierStubsJar - JAR with a provided stub suffix
-// the presented publication is also added by the plugin but you can modify it as you wish
+Page Redirection
 
-publishing {
-	publications {
-		stubs(MavenPublication) {
-			artifactId "${project.name}-stubs"
-			artifact verifierStubsJar
-		}
-	}
-}

-

6.3 Stub Runner Core

Runs stubs for service collaborators. Treating stubs as contracts of services allows to use stub-runner as an implementation of -Consumer Driven Contracts.

Stub Runner allows you to automatically download the stubs of the provided dependencies (or pick those from the classpath), start WireMock servers for them and feed them with proper stub definitions. -For messaging, special stub routes are defined.

6.3.1 Retrieving stubs

You can pick the following options of acquiring stubs

  • Aether based solution that downloads JARs with stubs from Artifactory / Nexus
  • Classpath scanning solution that searches classpath via pattern to retrieve stubs
  • Write your own implementation of the org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder for full customization

The latter example is described in the Custom Stub Runner section.

Stub downloading

You can control the stub downloading via the stubsMode switch. It picks value from the -StubRunnerProperties.StubsMode enum. You can use the following options

  • StubRunnerProperties.StubsMode.CLASSPATH (default value) - will pick stubs from the classpath
  • StubRunnerProperties.StubsMode.LOCAL - will pick stubs from a local storage (e.g. .m2)
  • StubRunnerProperties.StubsMode.REMOTE - will pick stubs from a remote location

Example:

@AutoConfigureStubRunner(repositoryRoot="https://foo.bar", ids = "com.example:beer-api-producer:+:stubs:8095", stubsMode = StubRunnerProperties.StubsMode.LOCAL)

Classpath scanning

If you set the stubsMode property to StubRunnerProperties.StubsMode.CLASSPATH -(or set nothing since CLASSPATH is the default value) then classpath will get scanned. -Let’s look at the following example:

@AutoConfigureStubRunner(ids = {
-    "com.example:beer-api-producer:+:stubs:8095",
-    "com.example.foo:bar:1.0.0:superstubs:8096"
-})

If you’ve added the dependencies to your classpath

Maven.  -

<dependency>
-    <groupId>com.example</groupId>
-    <artifactId>beer-api-producer-restdocs</artifactId>
-    <classifier>stubs</classifier>
-    <version>0.0.1-SNAPSHOT</version>
-    <scope>test</scope>
-    <exclusions>
-        <exclusion>
-            <groupId>*</groupId>
-            <artifactId>*</artifactId>
-        </exclusion>
-    </exclusions>
-</dependency>
-<dependency>
-    <groupId>com.example.foo</groupId>
-    <artifactId>bar</artifactId>
-    <classifier>superstubs</classifier>
-    <version>1.0.0</version>
-    <scope>test</scope>
-    <exclusions>
-        <exclusion>
-            <groupId>*</groupId>
-            <artifactId>*</artifactId>
-        </exclusion>
-    </exclusions>
-</dependency>

-

Gradle.  -

testCompile("com.example:beer-api-producer-restdocs:0.0.1-SNAPSHOT:stubs") {
-    transitive = false
-}
-testCompile("com.example.foo:bar:1.0.0:superstubs") {
-    transitive = false
-}

-

Then the following locations on your classpath will get scanned. For com.example:beer-api-producer-restdocs

  • /META-INF/com.example/beer-api-producer-restdocs/*/.*
  • /contracts/com.example/beer-api-producer-restdocs/*/.*
  • /mappings/com.example/beer-api-producer-restdocs/*/.*

and com.example.foo:bar

  • /META-INF/com.example.foo/bar/*/.*
  • /contracts/com.example.foo/bar/*/.*
  • /mappings/com.example.foo/bar/*/.*
[Tip]Tip

As you can see you have to explicitly provide the group and artifact ids when packaging the -producer stubs.

The producer would setup the contracts like this:

└── src
-    └── test
-        └── resources
-            └── contracts
-                └── com.example
-                    └── beer-api-producer-restdocs
-                        └── nested
-                            └── contract3.groovy

To achieve proper stub packaging.

Or using the Maven assembly plugin or -Gradle Jar task you have to create the following -structure in your stubs jar.

└── META-INF
-    └── com.example
-        └── beer-api-producer-restdocs
-            └── 2.0.0
-                ├── contracts
-                │   └── nested
-                │       └── contract2.groovy
-                └── mappings
-                    └── mapping.json

By maintaining this structure classpath gets scanned and you can profit from the messaging / -HTTP stubs without the need to download artifacts.

Configuring HTTP Server Stubs

Stub Runner has a notion of a HttpServerStub that abstracts the underlaying -concrete implementation of the HTTP server (e.g. WireMock is one of the implementations). -Sometimes, you need to perform some additional tuning of the stub servers, -that is concrete for the given implementation. To do that, Stub Runner gives you -the httpServerStubConfigurer property that is available in the annotation, -JUnit rule, and is accessible via system properties, where you can provide -your implementation of the org.springframework.cloud.contract.stubrunner.HttpServerStubConfigurer interface. The implementations can alter -the configuration files for the given HTTP server stub.

Spring Cloud Contract Stub Runner comes with an implementation that you -can extend, for WireMock - org.springframework.cloud.contract.stubrunner.provider.wiremock.WireMockHttpServerStubConfigurer. In the configure method -you can provide your own, custom configuration for the given stub. The use -case might be starting WireMock for the given artifact id, on an HTTPs port. Example:

WireMockHttpServerStubConfigurer implementation.  -

@CompileStatic
-static class HttpsForFraudDetection extends WireMockHttpServerStubConfigurer {
-
-	private static final Log log = LogFactory.getLog(HttpsForFraudDetection)
-
-	@Override
-	WireMockConfiguration configure(WireMockConfiguration httpStubConfiguration, HttpServerStubConfiguration httpServerStubConfiguration) {
-		if (httpServerStubConfiguration.stubConfiguration.artifactId == "fraudDetectionServer") {
-			int httpsPort = SocketUtils.findAvailableTcpPort()
-			log.info("Will set HTTPs port [" + httpsPort + "] for fraud detection server")
-			return httpStubConfiguration
-					.httpsPort(httpsPort)
-		}
-		return httpStubConfiguration
-	}
-}

-

You can then reuse it via the annotation

@AutoConfigureStubRunner(mappingsOutputFolder = "target/outputmappings/",
-		httpServerStubConfigurer = HttpsForFraudDetection)

Whenever an https port is found, it will take precedence over the http one.

6.3.2 Running stubs

Running using main app

You can set the following options to the main class:

-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'
-                                  (default: stubs)
---maxPort, --maxp <Integer>     Maximum port value to be assigned to
-                                  the WireMock instance. Defaults to
-                                  15000 (default: 15000)
---minPort, --minp <Integer>     Minimum port value to be assigned to
-                                  the WireMock instance. Defaults to
-                                  10000 (default: 10000)
--p, --password                  Password to user when connecting to
-                                  repository
---phost, --proxyHost            Proxy host to use for repository
-                                  requests
---pport, --proxyPort [Integer]  Proxy port to use for repository
-                                  requests
--r, --root                      Location of a Jar containing server
-                                  where you keep your stubs (e.g. http:
-                                  //nexus.
-                                  net/content/repositories/repository)
--s, --stubs                     Comma separated list of Ivy
-                                  representation of jars with stubs.
-                                  Eg. groupid:artifactid1,groupid2:
-                                  artifactid2:classifier
---sm, --stubsMode               Stubs mode to be used. Acceptable values
-                                  [CLASSPATH, LOCAL, REMOTE]
--u, --username                  Username to user when connecting to
-                                  repository

HTTP Stubs

Stubs are defined in JSON documents, whose syntax is defined in WireMock documentation

Example:

{
-    "request": {
-        "method": "GET",
-        "url": "/ping"
-    },
-    "response": {
-        "status": 200,
-        "body": "pong",
-        "headers": {
-            "Content-Type": "text/plain"
-        }
-    }
-}

Viewing registered mappings

Every stubbed collaborator exposes list of defined mappings under __/admin/ endpoint.

You can also use the mappingsOutputFolder property to dump the mappings to files. - For annotation based approach it would look like this

@AutoConfigureStubRunner(ids="a.b.c:loanIssuance,a.b.c:fraudDetectionServer",
-mappingsOutputFolder = "target/outputmappings/")

and for the JUnit approach like this:

@ClassRule @Shared StubRunnerRule rule = new StubRunnerRule()
-			.repoRoot("http://some_url")
-			.downloadStub("a.b.c", "loanIssuance")
-			.downloadStub("a.b.c:fraudDetectionServer")
-			.withMappingsOutputFolder("target/outputmappings")

Then if you check out the folder target/outputmappings you would see the following structure

.
-├── fraudDetectionServer_13705
-└── loanIssuance_12255

That means that there were two stubs registered. fraudDetectionServer was registered at port 13705 -and loanIssuance at port 12255. If we take a look at one of the files we would see (for WireMock) -mappings available for the given server:

[{
-  "id" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7",
-  "request" : {
-    "url" : "/name",
-    "method" : "GET"
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "fraudDetectionServer"
-  },
-  "uuid" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7"
-},
-...
-]

Messaging Stubs

Depending on the provided Stub Runner dependency and the DSL the messaging routes are automatically set up.

6.4 Stub Runner JUnit Rule and Stub Runner JUnit5 Extension

Stub Runner comes with a JUnit rule thanks to which you can very easily download and run stubs for given group and artifact id:

@ClassRule
-public static StubRunnerRule rule = new StubRunnerRule().repoRoot(repoRoot())
-		.stubsMode(StubRunnerProperties.StubsMode.REMOTE)
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs",
-				"loanIssuance")
-		.downloadStub(
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer");
-
-@BeforeClass
-@AfterClass
-public static void setupProps() {
-	System.clearProperty("stubrunner.repository.root");
-	System.clearProperty("stubrunner.classifier");
-}

There’s also a StubRunnerExtension available for JUnit 5. StubRunnerRule and StubRunnerExtension work in a very -similar fashion. After the rule/ extension is executed, Stub Runner connects to your Maven repository and for the given list of dependencies tries to:

  • download them
  • cache them locally
  • unzip them to a temporary folder
  • start a WireMock server for each Maven dependency on a random port from the provided range of ports / provided port
  • feed the WireMock server with all JSON files that are valid WireMock definitions
  • can also send messages (remember to pass an implementation of MessageVerifier interface)

Stub Runner uses Eclipse Aether mechanism to download the Maven dependencies. -Check their docs for more information.

Since the StubRunnerRule and StubRunnerExtension implement the StubFinder they allow you to find the started stubs:

package org.springframework.cloud.contract.stubrunner;
-
-import java.net.URL;
-import java.util.Collection;
-import java.util.Map;
-
-import org.springframework.cloud.contract.spec.Contract;
-
-/**
- * Contract for finding registered stubs.
- *
- * @author Marcin Grzejszczak
- */
-public interface StubFinder extends StubTrigger {
-
-	/**
-	 * For the given groupId and artifactId tries to find the matching URL of the running
-	 * stub.
-	 * @param groupId - might be null. In that case a search only via artifactId takes
-	 * place
-	 * @param artifactId - artifact id of the stub
-	 * @return URL of a running stub or throws exception if not found
-	 * @throws StubNotFoundException in case of not finding a stub
-	 */
-	URL findStubUrl(String groupId, String artifactId) throws StubNotFoundException;
-
-	/**
-	 * For the given Ivy notation {@code [groupId]:artifactId:[version]:[classifier]}
-	 * tries to find the matching URL of the running stub. You can also pass only
-	 * {@code artifactId}.
-	 * @param ivyNotation - Ivy representation of the Maven artifact
-	 * @return URL of a running stub or throws exception if not found
-	 * @throws StubNotFoundException in case of not finding a stub
-	 */
-	URL findStubUrl(String ivyNotation) throws StubNotFoundException;
-
-	/**
-	 * @return all running stubs
-	 */
-	RunningStubs findAllRunningStubs();
-
-	/**
-	 * @return the list of Contracts
-	 */
-	Map<StubConfiguration, Collection<Contract>> getContracts();
-
-}

Example of usage in Spock tests:

@ClassRule
-@Shared
-StubRunnerRule rule = new StubRunnerRule()
-		.stubsMode(StubRunnerProperties.StubsMode.REMOTE)
-		.repoRoot(StubRunnerRuleSpec.getResource("/m2repo/repository").toURI().toString())
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")
-		.withMappingsOutputFolder("target/outputmappingsforrule")
-
-
-def 'should start WireMock servers'() {
-	expect: 'WireMocks are running'
-		rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance') != null
-		rule.findStubUrl('loanIssuance') != null
-		rule.findStubUrl('loanIssuance') == rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance')
-		rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer') != null
-	and:
-		rule.findAllRunningStubs().isPresent('loanIssuance')
-		rule.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs', 'fraudDetectionServer')
-		rule.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer')
-	and: 'Stubs were registered'
-		"${rule.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
-		"${rule.findStubUrl('fraudDetectionServer').toString()}/name".toURL().text == 'fraudDetectionServer'
-}
-
-def 'should output mappings to output folder'() {
-	when:
-		def url = rule.findStubUrl('fraudDetectionServer')
-	then:
-		new File("target/outputmappingsforrule", "fraudDetectionServer_${url.port}").exists()
-}

Example of usage in JUnit tests:

	@Test
-	public void should_start_wiremock_servers() throws Exception {
-		// expect: 'WireMocks are running'
-		then(rule.findStubUrl("org.springframework.cloud.contract.verifier.stubs",
-				"loanIssuance")).isNotNull();
-		then(rule.findStubUrl("loanIssuance")).isNotNull();
-		then(rule.findStubUrl("loanIssuance")).isEqualTo(rule.findStubUrl(
-				"org.springframework.cloud.contract.verifier.stubs", "loanIssuance"));
-		then(rule.findStubUrl(
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer"))
-						.isNotNull();
-		// and:
-		then(rule.findAllRunningStubs().isPresent("loanIssuance")).isTrue();
-		then(rule.findAllRunningStubs().isPresent(
-				"org.springframework.cloud.contract.verifier.stubs",
-				"fraudDetectionServer")).isTrue();
-		then(rule.findAllRunningStubs().isPresent(
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer"))
-						.isTrue();
-		// and: 'Stubs were registered'
-		then(httpGet(rule.findStubUrl("loanIssuance").toString() + "/name"))
-				.isEqualTo("loanIssuance");
-		then(httpGet(rule.findStubUrl("fraudDetectionServer").toString() + "/name"))
-				.isEqualTo("fraudDetectionServer");
-	}
-
-	private String httpGet(String url) throws Exception {
-		try (InputStream stream = URI.create(url).toURL().openStream()) {
-			return StreamUtils.copyToString(stream, Charset.forName("UTF-8"));
-		}
-	}
-
-}

JUnit 5 Extension example:

// Visible for Junit
-@RegisterExtension
-static StubRunnerExtension stubRunnerExtension = new StubRunnerExtension()
-		.repoRoot(repoRoot()).stubsMode(StubRunnerProperties.StubsMode.REMOTE)
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs",
-				"loanIssuance")
-		.downloadStub(
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")
-		.withMappingsOutputFolder("target/outputmappingsforrule");
-
-@BeforeAll
-@AfterAll
-static void setupProps() {
-	System.clearProperty("stubrunner.repository.root");
-	System.clearProperty("stubrunner.classifier");
-}
-
-private static String repoRoot() {
-	try {
-		return StubRunnerRuleJUnitTest.class.getResource("/m2repo/repository/")
-				.toURI().toString();
-	}
-	catch (Exception e) {
-		return "";
-	}
-}

Check the Common properties for JUnit and Spring for more information on how to apply global configuration of Stub Runner.

[Important]Important

To use the JUnit rule or JUnit 5 extension together with messaging, you have to provide an implementation of the -MessageVerifier interface to the rule builder (e.g. rule.messageVerifier(new MyMessageVerifier())). -If you don’t do this, then whenever you try to send a message an exception will be thrown.

6.4.1 Maven settings

The stub downloader honors Maven settings for a different local repository folder. -Authentication details for repositories and profiles are currently not taken into account, so you need to specify it using the properties mentioned above.

6.4.2 Providing fixed ports

You can also run your stubs on fixed ports. You can do it in two different ways. One is to pass it in the properties, and the other via fluent API of -JUnit rule.

6.4.3 Fluent API

When using the StubRunnerRule or StubRunnerExtension you can add a stub to download and then pass the port for the last downloaded stub.

@ClassRule
-public static StubRunnerRule rule = new StubRunnerRule().repoRoot(repoRoot())
-		.stubsMode(StubRunnerProperties.StubsMode.REMOTE)
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs",
-				"loanIssuance")
-		.withPort(12345).downloadStub(
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer:12346");
-
-@BeforeClass
-@AfterClass
-public static void setupProps() {
-	System.clearProperty("stubrunner.repository.root");
-	System.clearProperty("stubrunner.classifier");
-}

You can see that for this example the following test is valid:

then(rule.findStubUrl("loanIssuance"))
-		.isEqualTo(URI.create("http://localhost:12345").toURL());
-then(rule.findStubUrl("fraudDetectionServer"))
-		.isEqualTo(URI.create("http://localhost:12346").toURL());

6.4.4 Stub Runner with Spring

Sets up Spring configuration of the Stub Runner project.

By providing a list of stubs inside your configuration file the Stub Runner automatically downloads -and registers in WireMock the selected stubs.

If you want to find the URL of your stubbed dependency you can autowire the StubFinder interface and use -its methods as presented below:

@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
-@SpringBootTest(properties = [" stubrunner.cloud.enabled=false",
-		'foo=${stubrunner.runningstubs.fraudDetectionServer.port}',
-		'fooWithGroup=${stubrunner.runningstubs.org.springframework.cloud.contract.verifier.stubs.fraudDetectionServer.port}'])
-@AutoConfigureStubRunner(mappingsOutputFolder = "target/outputmappings/",
-		httpServerStubConfigurer = HttpsForFraudDetection)
-@ActiveProfiles("test")
-class StubRunnerConfigurationSpec extends Specification {
-
-	@Autowired
-	StubFinder stubFinder
-	@Autowired
-	Environment environment
-	@StubRunnerPort("fraudDetectionServer")
-	int fraudDetectionServerPort
-	@StubRunnerPort("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")
-	int fraudDetectionServerPortWithGroupId
-	@Value('${foo}')
-	Integer foo
-
-	@BeforeClass
-	@AfterClass
-	void setupProps() {
-		System.clearProperty("stubrunner.repository.root")
-		System.clearProperty("stubrunner.classifier")
-	}
-
-	def 'should start WireMock servers'() {
-		expect: 'WireMocks are running'
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance') != null
-			stubFinder.findStubUrl('loanIssuance') != null
-			stubFinder.findStubUrl('loanIssuance') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance')
-			stubFinder.findStubUrl('loanIssuance') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance')
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT:stubs')
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer') != null
-		and:
-			stubFinder.findAllRunningStubs().isPresent('loanIssuance')
-			stubFinder.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs', 'fraudDetectionServer')
-			stubFinder.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer')
-		and: 'Stubs were registered'
-			"${stubFinder.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
-			"${stubFinder.findStubUrl('fraudDetectionServer').toString()}/name".toURL().text == 'fraudDetectionServer'
-		and: 'Fraud Detection is an HTTPS endpoint'
-			stubFinder.findStubUrl('fraudDetectionServer').toString().startsWith("https")
-	}
-
-	def 'should throw an exception when stub is not found'() {
-		when:
-			stubFinder.findStubUrl('nonExistingService')
-		then:
-			thrown(StubNotFoundException)
-		when:
-			stubFinder.findStubUrl('nonExistingGroupId', 'nonExistingArtifactId')
-		then:
-			thrown(StubNotFoundException)
-	}
-
-	def 'should register started servers as environment variables'() {
-		expect:
-			environment.getProperty("stubrunner.runningstubs.loanIssuance.port") != null
-			stubFinder.findAllRunningStubs().getPort("loanIssuance") == (environment.getProperty("stubrunner.runningstubs.loanIssuance.port") as Integer)
-		and:
-			environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") != null
-			stubFinder.findAllRunningStubs().getPort("fraudDetectionServer") == (environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") as Integer)
-		and:
-			environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") != null
-			stubFinder.findAllRunningStubs().getPort("fraudDetectionServer") == (environment.getProperty("stubrunner.runningstubs.org.springframework.cloud.contract.verifier.stubs.fraudDetectionServer.port") as Integer)
-	}
-
-	def 'should be able to interpolate a running stub in the passed test property'() {
-		given:
-			int fraudPort = stubFinder.findAllRunningStubs().getPort("fraudDetectionServer")
-		expect:
-			fraudPort > 0
-			environment.getProperty("foo", Integer) == fraudPort
-			environment.getProperty("fooWithGroup", Integer) == fraudPort
-			foo == fraudPort
-	}
-
-	@Issue("#573")
-	def 'should be able to retrieve the port of a running stub via an annotation'() {
-		given:
-			int fraudPort = stubFinder.findAllRunningStubs().getPort("fraudDetectionServer")
-		expect:
-			fraudPort > 0
-			fraudDetectionServerPort == fraudPort
-			fraudDetectionServerPortWithGroupId == fraudPort
-	}
-
-	def 'should dump all mappings to a file'() {
-		when:
-			def url = stubFinder.findStubUrl("fraudDetectionServer")
-		then:
-			new File("target/outputmappings/", "fraudDetectionServer_${url.port}").exists()
-	}
-
-	@Configuration
-	@EnableAutoConfiguration
-	static class Config {}
-
-	@CompileStatic
-	static class HttpsForFraudDetection extends WireMockHttpServerStubConfigurer {
-
-		private static final Log log = LogFactory.getLog(HttpsForFraudDetection)
-
-		@Override
-		WireMockConfiguration configure(WireMockConfiguration httpStubConfiguration, HttpServerStubConfiguration httpServerStubConfiguration) {
-			if (httpServerStubConfiguration.stubConfiguration.artifactId == "fraudDetectionServer") {
-				int httpsPort = SocketUtils.findAvailableTcpPort()
-				log.info("Will set HTTPs port [" + httpsPort + "] for fraud detection server")
-				return httpStubConfiguration
-						.httpsPort(httpsPort)
-			}
-			return httpStubConfiguration
-		}
-	}
-}

for the following configuration file:

stubrunner:
-  repositoryRoot: classpath:m2repo/repository/
-  ids:
-    - org.springframework.cloud.contract.verifier.stubs:loanIssuance
-    - org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer
-    - org.springframework.cloud.contract.verifier.stubs:bootService
-  stubs-mode: remote

Instead of using the properties you can also use the properties inside the @AutoConfigureStubRunner. -Below you can find an example of achieving the same result by setting values on the annotation.

@AutoConfigureStubRunner(
-		ids = ["org.springframework.cloud.contract.verifier.stubs:loanIssuance",
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer",
-				"org.springframework.cloud.contract.verifier.stubs:bootService"],
-		stubsMode = StubRunnerProperties.StubsMode.REMOTE,
-		repositoryRoot = "classpath:m2repo/repository/")

Stub Runner Spring registers environment variables in the following manner -for every registered WireMock server. Example for Stub Runner ids - com.example:foo, com.example:bar.

  • stubrunner.runningstubs.foo.port
  • stubrunner.runningstubs.com.example.foo.port
  • stubrunner.runningstubs.bar.port
  • stubrunner.runningstubs.com.example.bar.port

Which you can reference in your code.

You can also use the @StubRunnerPort annotation to inject the port of a running stub. -Value of the annotation can be the groupid:artifactid or just the artifactid. Example for Stub Runner ids -com.example:foo, com.example:bar.

@StubRunnerPort("foo")
-int fooPort;
-@StubRunnerPort("com.example:bar")
-int barPort;

6.5 Stub Runner Spring Cloud

Stub Runner can integrate with Spring Cloud.

For real life examples you can check the

6.5.1 Stubbing Service Discovery

The most important feature of Stub Runner Spring Cloud is the fact that it’s stubbing

  • DiscoveryClient
  • Ribbon ServerList

that means that regardless of the fact whether you’re using Zookeeper, Consul, Eureka or anything else, you don’t need that in your tests. -We’re starting WireMock instances of your dependencies and we’re telling your application whenever you’re using Feign, load balanced RestTemplate -or DiscoveryClient directly, to call those stubbed servers instead of calling the real Service Discovery tool.

For example this test will pass

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'
-	and: 'Stubs can be reached via load service discovery'
-		restTemplate.getForObject('http://loanIssuance/name', String) == 'loanIssuance'
-		restTemplate.getForObject('http://someNameThatShouldMapFraudDetectionServer/name', String) == 'fraudDetectionServer'
-}

for the following configuration file

stubrunner:
-  idsToServiceIds:
-    ivyNotation: someValueInsideYourCode
-    fraudDetectionServer: someNameThatShouldMapFraudDetectionServer

Test profiles and service discovery

In your integration tests you typically don’t want to call neither a discovery service (e.g. Eureka) -or Config Server. That’s why you create an additional test configuration in which you want to disable -these features.

Due to certain limitations of spring-cloud-commons to achieve this you have disable these properties -via a static block like presented below (example for Eureka)

    //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");
-    }

6.5.2 Additional Configuration

You can match the artifactId of the stub with the name of your app by using the stubrunner.idsToServiceIds: map. -You can disable Stub Runner Ribbon support by providing: stubrunner.cloud.ribbon.enabled equal to false -You can disable Stub Runner support by providing: stubrunner.cloud.enabled equal to false

[Tip]Tip

By default all service discovery will be stubbed. That means that regardless of the fact if you have -an existing DiscoveryClient its results will be ignored. However, if you want to reuse it, just set - stubrunner.cloud.delegate.enabled to true and then your existing DiscoveryClient results will be - merged with the stubbed ones.

The default Maven configuration used by Stub Runner can be tweaked either -via the following system properties or environment variables

  • maven.repo.local - path to the custom maven local repository location
  • org.apache.maven.user-settings - path to custom maven user settings location
  • org.apache.maven.global-settings - path to maven global settings location

6.6 Stub Runner Boot Application

Spring Cloud Contract Stub Runner Boot is a Spring Boot application that exposes REST endpoints to -trigger the messaging labels and to access started WireMock servers.

One of the use-cases is to run some smoke (end to end) tests on a deployed application. -You can check out the Spring Cloud Pipelines -project for more information.

6.6.1 How to use it?

Stub Runner Server

Just add the

compile "org.springframework.cloud:spring-cloud-starter-stub-runner"

Annotate a class with @EnableStubRunnerServer, build a fat-jar and you’re ready to go!

For the properties check the Stub Runner Spring section.

Stub Runner Server Fat Jar

You can download a standalone JAR from Maven (e.g. for version 2.0.1.RELEASE), as follows:

$ wget -O stub-runner.jar 'https://search.maven.org/remotecontent?filepath=org/springframework/cloud/spring-cloud-contract-stub-runner-boot/2.0.1.RELEASE/spring-cloud-contract-stub-runner-boot-2.0.1.RELEASE.jar'
-$ java -jar stub-runner.jar --stubrunner.ids=... --stubrunner.repositoryRoot=...

Spring Cloud CLI

Starting from 1.4.0.RELEASE version of the Spring Cloud CLI -project you can start Stub Runner Boot by executing spring cloud stubrunner.

In order to pass the configuration just create a stubrunner.yml file in the current working directory -or a subdirectory called config or in ~/.spring-cloud. The file could look like this -(example for running stubs installed locally)

stubrunner.yml.  -

stubrunner:
-  stubsMode: LOCAL
-  ids:
-    - com.example:beer-api-producer:+:9876

-

and then just call spring cloud stubrunner from your terminal window to start -the Stub Runner server. It will be available at port 8750.

6.6.2 Endpoints

HTTP

  • GET /stubs - returns a list of all running stubs in ivy:integer notation
  • GET /stubs/{ivy} - returns a port for the given ivy notation (when calling the endpoint ivy can also be artifactId only)

Messaging

For Messaging

  • GET /triggers - returns a list of all running labels in ivy : [ label1, label2 …​] notation
  • POST /triggers/{label} - executes a trigger with label
  • POST /triggers/{ivy}/{label} - executes a trigger with label for the given ivy notation (when calling the endpoint ivy can also be artifactId only)

6.6.3 Example

@ContextConfiguration(classes = StubRunnerBoot, loader = SpringBootContextLoader)
-@SpringBootTest(properties = "spring.cloud.zookeeper.enabled=false")
-@ActiveProfiles("test")
-class StubRunnerBootSpec extends Specification {
-
-	@Autowired
-	StubRunning stubRunning
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning),
-				new TriggerController(stubRunning))
-	}
-
-	def 'should return a list of running stub servers in "full ivy:port" notation'() {
-		when:
-			String response = RestAssuredMockMvc.get('/stubs').body.asString()
-		then:
-			def root = new JsonSlurper().parseText(response)
-			root.'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs' instanceof Integer
-	}
-
-	def 'should return a port on which a [#stubId] stub is running'() {
-		when:
-			def response = RestAssuredMockMvc.get("/stubs/${stubId}")
-		then:
-			response.statusCode == 200
-			Integer.valueOf(response.body.asString()) > 0
-		where:
-			stubId << ['org.springframework.cloud.contract.verifier.stubs:bootService:+:stubs',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService:+',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService',
-					   'bootService']
-	}
-
-	def 'should return 404 when missing stub was called'() {
-		when:
-			def response = RestAssuredMockMvc.get("/stubs/a:b:c:d")
-		then:
-			response.statusCode == 404
-	}
-
-	def 'should return a list of messaging labels that can be triggered when version and classifier are passed'() {
-		when:
-			String response = RestAssuredMockMvc.get('/triggers').body.asString()
-		then:
-			def root = new JsonSlurper().parseText(response)
-			root.'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs'?.containsAll(["delete_book", "return_book_1", "return_book_2"])
-	}
-
-	def 'should trigger a messaging label'() {
-		given:
-			StubRunning stubRunning = Mock()
-			RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning), new TriggerController(stubRunning))
-		when:
-			def response = RestAssuredMockMvc.post("/triggers/delete_book")
-		then:
-			response.statusCode == 200
-		and:
-			1 * stubRunning.trigger('delete_book')
-	}
-
-	def 'should trigger a messaging label for a stub with [#stubId] ivy notation'() {
-		given:
-			StubRunning stubRunning = Mock()
-			RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning), new TriggerController(stubRunning))
-		when:
-			def response = RestAssuredMockMvc.post("/triggers/$stubId/delete_book")
-		then:
-			response.statusCode == 200
-		and:
-			1 * stubRunning.trigger(stubId, 'delete_book')
-		where:
-			stubId << ['org.springframework.cloud.contract.verifier.stubs:bootService:stubs', 'org.springframework.cloud.contract.verifier.stubs:bootService', 'bootService']
-	}
-
-	def 'should throw exception when trigger is missing'() {
-		when:
-			RestAssuredMockMvc.post("/triggers/missing_label")
-		then:
-			Exception e = thrown(Exception)
-			e.message.contains("Exception occurred while trying to return [missing_label] label.")
-			e.message.contains("Available labels are")
-			e.message.contains("org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT:stubs=[]")
-			e.message.contains("org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs=")
-	}
-
-}

6.6.4 Stub Runner Boot with Service Discovery

One of the possibilities of using Stub Runner Boot is to use it as a feed of stubs for "smoke-tests". What does it mean? - Let’s assume that you don’t want to deploy 50 microservice to a test environment in order - to check if your application is working fine. You’ve already executed a suite of tests during the build process - but you would also like to ensure that the packaging of your application is fine. What you can do - is to deploy your application to an environment, start it and run a couple of tests on it to see if - it’s working fine. We can call those tests smoke-tests since their idea is to check only a handful - of testing scenarios.

The problem with this approach is such that if you’re doing microservices most likely you’re - using a service discovery tool. Stub Runner Boot allows you to solve this issue by starting the - required stubs and register them in a service discovery tool. Let’s take a look at an example of - such a setup with Eureka. Let’s assume that Eureka was already running.

@SpringBootApplication
-@EnableStubRunnerServer
-@EnableEurekaClient
-@AutoConfigureStubRunner
-public class StubRunnerBootEurekaExample {
-
-	public static void main(String[] args) {
-		SpringApplication.run(StubRunnerBootEurekaExample.class, args);
-	}
-
-}

As you can see we want to start a Stub Runner Boot server @EnableStubRunnerServer, enable Eureka client @EnableEurekaClient -and we want to have the stub runner feature turned on @AutoConfigureStubRunner.

Now let’s assume that we want to start this application so that the stubs get automatically registered. - We can do it by running the app java -jar ${SYSTEM_PROPS} stub-runner-boot-eureka-example.jar where - ${SYSTEM_PROPS} would contain the following list of properties

* -Dstubrunner.repositoryRoot=https://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)
-*
-* (1) - we tell Stub Runner where all the stubs reside (2) - we don't want the default
-* behaviour where the discovery service is stubbed. That's why the stub registration will
-* be picked (3) - we provide a list of stubs to download (4) - we provide a list of

That way your deployed application can send requests to started WireMock servers via the service -discovery. Most likely points 1-3 could be set by default in application.yml cause they are not -likely to change. That way you can provide only the list of stubs to download whenever you start -the Stub Runner Boot.

6.7 Stubs Per Consumer

There are cases in which 2 consumers of the same endpoint want to have 2 different responses.

[Tip]Tip

This approach also allows you to immediately know which consumer is using which part of your API. -You can remove part of a response that your API produces and you can see which of your autogenerated tests -fails. If none fails then you can safely delete that part of the response cause nobody is using it.

Let’s look at the following example for contract defined for the producer called producer. -There are 2 consumers: foo-consumer and bar-consumer.

Consumer foo-service

request {
-   url '/foo'
-   method GET()
-}
-response {
-    status OK()
-    body(
-       foo: "foo"
-    }
-}

Consumer bar-service

request {
-   url '/foo'
-   method GET()
-}
-response {
-    status OK()
-    body(
-       bar: "bar"
-    }
-}

You can’t produce for the same request 2 different responses. That’s why you can properly package the -contracts and then profit from the stubsPerConsumer feature.

On the producer side the consumers can have a folder that contains contracts related only to them. -By setting the stubrunner.stubs-per-consumer flag to true we no longer register all stubs but only those that -correspond to the consumer application’s name. In other words we’ll scan the path of every stub and -if it contains the subfolder with name of the consumer in the path only then will it get registered.

On the foo producer side the contracts would look like this

.
-└── contracts
-    ├── bar-consumer
-    │   ├── bookReturnedForBar.groovy
-    │   └── shouldCallBar.groovy
-    └── foo-consumer
-        ├── bookReturnedForFoo.groovy
-        └── shouldCallFoo.groovy

Being the bar-consumer consumer you can either set the spring.application.name or the stubrunner.consumer-name to bar-consumer -Or set the test as follows:

@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/",
-		stubsMode = StubRunnerProperties.StubsMode.REMOTE,
-		stubsPerConsumer = true)
-class StubRunnerStubsPerConsumerSpec extends Specification {
-...
-}

Then only the stubs registered under a path that contains the bar-consumer in its name (i.e. those from the -src/test/resources/contracts/bar-consumer/some/contracts/…​ folder) will be allowed to be referenced.

Or set the consumer name explicitly

@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
-@SpringBootTest
-@AutoConfigureStubRunner(ids = "org.springframework.cloud.contract.verifier.stubs:producerWithMultipleConsumers",
-		repositoryRoot = "classpath:m2repo/repository/",
-		consumerName = "foo-consumer",
-		stubsMode = StubRunnerProperties.StubsMode.REMOTE,
-		stubsPerConsumer = true)
-class StubRunnerStubsPerConsumerWithConsumerNameSpec extends Specification {
-...
-}

Then only the stubs registered under a path that contains the foo-consumer in its name (i.e. those from the -src/test/resources/contracts/foo-consumer/some/contracts/…​ folder) will be allowed to be referenced.

You can check out issue 224 for more -information about the reasons behind this change.

6.8 Common

This section briefly describes common properties, including:

6.8.1 Common Properties for JUnit and Spring

You can set repetitive properties by using system properties or Spring configuration -properties. Here are their names with their default values:

Property nameDefault valueDescription

stubrunner.minPort

10000

Minimum value of a port for a started WireMock with stubs.

stubrunner.maxPort

15000

Maximum value of a port for a started WireMock with stubs.

stubrunner.repositoryRoot

 

Maven repo URL. If blank, then call the local maven repo.

stubrunner.classifier

stubs

Default classifier for the stub artifacts.

stubrunner.stubsMode

CLASSPATH

The way you want to fetch and register the stubs

stubrunner.ids

 

Array of Ivy notation stubs to download.

stubrunner.username

 

Optional username to access the tool that stores the JARs with -stubs.

stubrunner.password

 

Optional password to access the tool that stores the JARs with -stubs.

stubrunner.stubsPerConsumer

false

Set to true if you want to use different stubs for -each consumer instead of registering all stubs for every consumer.

stubrunner.consumerName

 

If you want to use a stub for each consumer and want to -override the consumer name just change this value.

6.8.2 Stub Runner Stubs IDs

You can provide the stubs to download via the stubrunner.ids system property. They -follow this pattern:

groupId:artifactId:version:classifier:port

Note that version, classifier and port are optional.

  • If you do not provide the port, a random one will be picked.
  • If you do not provide the classifier, the default is used. (Note that you can -pass an empty classifier this way: groupId:artifactId:version:).
  • If you do not provide the version, then the + will be passed and the latest one is -downloaded.

port means the port of the WireMock server.

[Important]Important

Starting with version 1.0.4, you can provide a range of versions that you -would like the Stub Runner to take into consideration. You can read more about the -Aether versioning -ranges here.

6.9 Stub Runner Docker

We’re publishing a spring-cloud/spring-cloud-contract-stub-runner Docker image -that will start the standalone version of Stub Runner.

If you want to learn more about the basics of Maven, artifact ids, -group ids, classifiers and Artifact Managers, just click here Section 4.5, “Docker Project”.

6.9.1 How to use it

Just execute the docker image. You can pass any of the Section 6.8.1, “Common Properties for JUnit and Spring” -as environment variables. The convention is that all the -letters should be upper case. The camel case notation should -and the dot (.) should be separated via underscore (_). E.g. - the stubrunner.repositoryRoot property should be represented - as a STUBRUNNER_REPOSITORY_ROOT environment variable.

6.9.2 Example of client side usage in a non JVM project

We’d like to use the stubs created in this Section 4.5.4, “Server side (nodejs)” step. -Let’s assume that we want to run the stubs on port 9876. The NodeJS code -is available here:

$ git clone https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs
-$ cd bookstore

Let’s run the Stub Runner Boot application with the stubs.

# Provide the Spring Cloud Contract Docker version
-$ SC_CONTRACT_DOCKER_VERSION="..."
-# The IP at which the app is running and Docker container can reach it
-$ APP_IP="192.168.0.100"
-# Spring Cloud Contract Stub Runner properties
-$ STUBRUNNER_PORT="8083"
-# Stub coordinates 'groupId:artifactId:version:classifier:port'
-$ STUBRUNNER_IDS="com.example:bookstore:0.0.1.RELEASE:stubs:9876"
-$ STUBRUNNER_REPOSITORY_ROOT="http://${APP_IP}:8081/artifactory/libs-release-local"
-# Run the docker with Stub Runner Boot
-$ docker run  --rm -e "STUBRUNNER_IDS=${STUBRUNNER_IDS}" -e "STUBRUNNER_REPOSITORY_ROOT=${STUBRUNNER_REPOSITORY_ROOT}" -e "STUBRUNNER_STUBS_MODE=REMOTE" -p "${STUBRUNNER_PORT}:${STUBRUNNER_PORT}" -p "9876:9876" springcloud/spring-cloud-contract-stub-runner:"${SC_CONTRACT_DOCKER_VERSION}"

What’s happening is that

  • a standalone Stub Runner application got started
  • it downloaded the stub with coordinates com.example:bookstore:0.0.1.RELEASE:stubs on port 9876
  • it got downloaded from Artifactory running at http://192.168.0.100:8081/artifactory/libs-release-local
  • after a while Stub Runner will be running on port 8083
  • and the stubs will be running at port 9876

On the server side we built a stateful stub. Let’s use curl to assert -that the stubs are setup properly.

# let's execute the first request (no response is returned)
-$ curl -H "Content-Type:application/json" -X POST --data '{ "title" : "Title", "genre" : "Genre", "description" : "Description", "author" : "Author", "publisher" : "Publisher", "pages" : 100, "image_url" : "https://d213dhlpdb53mu.cloudfront.net/assets/pivotal-square-logo-41418bd391196c3022f3cd9f3959b3f6d7764c47873d858583384e759c7db435.svg", "buy_url" : "https://pivotal.io" }' http://localhost:9876/api/books
-# Now time for the second request
-$ curl -X GET http://localhost:9876/api/books
-# You will receive contents of the JSON
[Important]Important

If you want use the stubs that you have built locally, on your host, -then you should pass the environment variable -e STUBRUNNER_STUBS_MODE=LOCAL and mount -the volume of your local m2 -v "${HOME}/.m2/:/root/.m2:ro"

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__spring_cloud_contract_verifier.html b/multi/multi__spring_cloud_contract_verifier.html index fa59eb5e81..a5ffb82f50 100644 --- a/multi/multi__spring_cloud_contract_verifier.html +++ b/multi/multi__spring_cloud_contract_verifier.html @@ -1,4155 +1,13 @@ - - - 2. Spring Cloud Contract Verifier

2. Spring Cloud Contract Verifier

2.1 Introduction

[Tip]Tip

The Accurest project was initially started by Marcin Grzejszczak and Jakub Kubrynski (codearte.io)

Just to make long story short - Spring Cloud Contract Verifier is a tool that enables Consumer Driven Contract (CDC) development of JVM-based applications. It is shipped -with Contract Definition Language (DSL). Contract definitions are used to produce following resources:

  • JSON stub definitions to be used by WireMock when doing integration testing on the client code (client tests). -Test code must still be written by hand, test data is produced by Spring Cloud Contract Verifier.
  • Messaging routes if you’re using one. We’re integrating with Spring Integration, Spring Cloud Stream, Spring AMQP and Apache Camel. You can however set your own integrations if you want to
  • Acceptance tests (in JUnit or Spock) used to verify if server-side implementation of the API is compliant with the contract (server tests). -Full test is generated by Spring Cloud Contract Verifier.

Spring Cloud Contract Verifier moves TDD to the level of software architecture.

2.1.1 Why?

Let us assume that we have a system comprising of multiple microservices:

Microservices Architecture

Testing issues

If we wanted to test the application in top left corner if it can communicate with other services then we could do one of two things:

  • deploy all microservices and perform end to end tests
  • mock other microservices in unit / integration tests

Both have their advantages but also a lot of disadvantages. Let’s focus on the latter.

Deploy all microservices and perform end to end tests

Advantages:

  • simulates production
  • tests real communication between services

Disadvantages:

  • to test one microservice we would have to deploy 6 microservices, a couple of databases etc.
  • the environment where the tests would be conducted would be locked for a single suite of tests (i.e. nobody else would be able to run the tests in the meantime).
  • long to run
  • very late feedback
  • extremely hard to debug

Mock other microservices in unit / integration tests

Advantages:

  • very fast feedback
  • no infrastructure requirements

Disadvantages:

  • the implementor of the service creates stubs thus they might have nothing to do with the reality
  • you can go to production with passing tests and failing production

To solve the aforementioned issues Spring Cloud Contract Verifier with Stub Runner were created. Their main idea is to give you very fast feedback, without the need -to set up the whole world of microservices. If you work on stubs then the only applications you need are those that your application is using directly.

Stubbed Services

Spring Cloud Contract Verifier gives you the certainty that the stubs that you’re using were created by the service that you’re calling. Also if you can use them it means that they were -tested against the producer’s side. In other words - you can trust those stubs.

2.1.2 Purposes

The main purposes of Spring Cloud Contract Verifier with Stub Runner are:

  • to ensure that WireMock / Messaging stubs (used when developing the client) are doing exactly what actual server-side implementation will do,
  • to promote ATDD method and Microservices architectural style,
  • to provide a way to publish changes in contracts that are immediately visible on both sides,
  • to generate boilerplate test code used on the server side.
[Important]Important

Spring Cloud Contract Verifier’s purpose is NOT to start writing business features in the contracts. -Let’s assume that we have a business use case of fraud check. If a user can be a fraud for 100 different reasons, -we would assume that you would create 2 contracts. One for the positive and one for the negative fraud case. -Contract tests are used to test contracts between applications and not to simulate full behaviour.

2.1.3 How

Define the contract

As consumers we need to define what exactly we want to achieve. We need to formulate our expectations. That’s why we write the following contract.

Let’s assume that we’d like to send the request containing the id of the client and the amount he wants to borrow from us. We’d like to send it to the /fraudcheck url via the PUT method.

package contracts
+
 
-org.springframework.cloud.contract.spec.Contract.make {
-	request { // (1)
-		method 'PUT' // (2)
-		url '/fraudcheck' // (3)
-		body([ // (4)
-			   "client.id": $(regex('[0-9]{10}')),
-			   loanAmount: 99999
-		])
-		headers { // (5)
-			contentType('application/json')
-		}
-	}
-	response { // (6)
-		status 200 // (7)
-		body([ // (8)
-			   fraudCheckStatus: "FRAUD",
-			   "rejection.reason": "Amount too high"
-		])
-		headers { // (9)
-			contentType('application/json')
-		}
-	}
-}
+
+
 
-/*
-From the Consumer perspective, when shooting a request in the integration test:
+
 
-(1) - If the consumer sends a request
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `clientId` that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the response will be sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` equal to `application/json`
+Page Redirection
 
-From the Producer perspective, in the autogenerated producer-side test:
-
-(1) - A request will be sent to the producer
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `clientId` that will have a generated value that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the test will assert if the response has been sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` matching `application/json.*`
- */

Client Side

Spring Cloud Contract will generate stubs, which you can use during client side testing. -You will have a WireMock instance / Messaging route up and running that simulates the service Y. -You would like to feed that instance with a proper stub definition.

At some point in time you need to send a request to the Fraud Detection service.

ResponseEntity<FraudServiceResponse> response =
-		restTemplate.exchange("http://localhost:" + port + "/fraudcheck", HttpMethod.PUT,
-				new HttpEntity<>(request, httpHeaders),
-				FraudServiceResponse.class);

Annotate your test class with @AutoConfigureStubRunner. In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators.

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment=WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, workOffline = true)
-@DirtiesContext
-public class LoanApplicationServiceTests {

After that, during the tests Spring Cloud Contract will automatically find the stubs (simulating the real service) in Maven repository and expose them on configured (or random) port.

Server Side

Being a service Y since you are developing your stub, you need to be sure that it’s actually resembling your -concrete implementation. You can’t have a situation where your stub acts in one way and your application on -production behaves in a different way.

That’s why from the provided stub acceptance tests will be generated that will ensure -that your application behaves in the same way as you define in your stub.

The autogenerated test would look like this:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-    // given:
-        MockMvcRequestSpecification request = given()
-                .header("Content-Type", "application/vnd.fraud.v1+json")
-                .body("{\"client.id\":\"1234567890\",\"loanAmount\":99999}");
-
-    // when:
-        ResponseOptions response = given().spec(request)
-                .put("/fraudcheck");
-
-    // then:
-        assertThat(response.statusCode()).isEqualTo(200);
-        assertThat(response.header("Content-Type")).matches("application/vnd.fraud.v1.json.*");
-    // and:
-        DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-        assertThatJson(parsedJson).field("['fraudCheckStatus']").matches("[A-Z]{5}");
-        assertThatJson(parsedJson).field("['rejection.reason']").isEqualTo("Amount too high");
-}

2.1.4 Step by step guide to CDC

Let’s take an example of Fraud Detection and Loan Issuance process. The business scenario is such that we want to issue loans to people but don’t want them to steal the money from us. The current implementation of our system grants loans to everybody.

Let’s assume that the Loan Issuance is a client to the -Fraud Detection server. In the current sprint we are required to develop a new feature - if a client wants to borrow too much money then we mark him as fraud.

Technical remark - Fraud Detection will have artifact id http-server, Loan Issuance http-client and both have group id com.example.

Social remark - both client and server development teams need to communicate directly and discuss changes while -going through the process. CDC is all about communication.

The server side code is available here and the client side code here.

[Tip]Tip

In this case the ownership of the contracts lays on the producer side. It means that physically -all the contract are present in the producer’s repository

Technical note

If using the SNAPSHOT / Milestone / Release Candidate versions please add the following section to your

Maven.  -

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

-

Gradle.  -

repositories {
-	mavenCentral()
-	mavenLocal()
-	maven { url "https://repo.spring.io/snapshot" }
-	maven { url "https://repo.spring.io/milestone" }
-	maven { url "https://repo.spring.io/release" }
-}

-

Consumer side (Loan Issuance)

As a developer of the Loan Issuance service (a consumer of the Fraud Detection server):

start doing TDD by writing a test to your feature

@Test
-public void shouldBeRejectedDueToAbnormalLoanAmount() {
-	// given:
-	LoanApplication application = new LoanApplication(new Client("1234567890"),
-			99999);
-	// when:
-	LoanApplicationResult loanApplication = service.loanApplication(application);
-	// then:
-	assertThat(loanApplication.getLoanApplicationStatus())
-			.isEqualTo(LoanApplicationStatus.LOAN_APPLICATION_REJECTED);
-	assertThat(loanApplication.getRejectionReason()).isEqualTo("Amount too high");
-}

We’ve just written a test of our new feature. If a loan application for a big amount is received we should reject that loan application with some description.

write the missing implementation

At some point in time you need to send a request to the Fraud Detection service. Let’s assume that we’d like to send the request containing the id of the client and the amount he wants to borrow from us. We’d like to send it to the /fraudcheck url via the PUT method.

ResponseEntity<FraudServiceResponse> response =
-		restTemplate.exchange("http://localhost:" + port + "/fraudcheck", HttpMethod.PUT,
-				new HttpEntity<>(request, httpHeaders),
-				FraudServiceResponse.class);

For simplicity we’ve hardcoded the port of the Fraud Detection service at 8080 and our application is running on 8090.

If we’d start the written test it would obviously break since we have no service running on port 8080.

clone the Fraud Detection service repository locally

We’ll start playing around with the server side contract. That’s why we need to first clone it.

git clone https://your-git-server.com/server-side.git local-http-server-repo

define the contract locally in the repo of Fraud Detection service

As consumers we need to define what exactly we want to achieve. We need to formulate our expectations. That’s why we write the following contract.

[Important]Important

We’re placing the contract under src/test/resources/contracts/fraud folder. The fraud folder -is important cause we’ll reference that folder in the producer’s test base class name.

package contracts
-
-org.springframework.cloud.contract.spec.Contract.make {
-	request { // (1)
-		method 'PUT' // (2)
-		url '/fraudcheck' // (3)
-		body([ // (4)
-			   "client.id": $(regex('[0-9]{10}')),
-			   loanAmount: 99999
-		])
-		headers { // (5)
-			contentType('application/json')
-		}
-	}
-	response { // (6)
-		status 200 // (7)
-		body([ // (8)
-			   fraudCheckStatus: "FRAUD",
-			   "rejection.reason": "Amount too high"
-		])
-		headers { // (9)
-			contentType('application/json')
-		}
-	}
-}
-
-/*
-From the Consumer perspective, when shooting a request in the integration test:
-
-(1) - If the consumer sends a request
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `clientId` that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the response will be sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` equal to `application/json`
-
-From the Producer perspective, in the autogenerated producer-side test:
-
-(1) - A request will be sent to the producer
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `clientId` that will have a generated value that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the test will assert if the response has been sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` matching `application/json.*`
- */

The Contract is written using a statically typed Groovy DSL. You might be wondering what are those -value(client(…​), server(…​)) parts. By using this notation Spring Cloud Contract allows you to -define parts of a JSON / URL / etc. which are dynamic. In case of an identifier or a timestamp you -don’t want to hardcode a value. You want to allow some different ranges of values. That’s why for -the consumer side you can set regular expressions matching those values. You can provide the body -either by means of a map notation or String with interpolations. -Consult the docs -for more information. We highly recommend using the map notation!

[Tip]Tip

It’s really important that you understand the map notation to set up contracts. Please read the -Groovy docs regarding JSON

The aforementioned contract is an agreement between two sides that:

  • if an HTTP request is sent with

    • a method PUT on an endpoint /fraudcheck
    • JSON body with client.id matching the regular expression [0-9]{10} and loanAmount equal to 99999
    • and with a header Content-Type equal to application/vnd.fraud.v1+json
  • then an HTTP response would be sent to the consumer that

    • has status 200
    • contains JSON body with the fraudCheckStatus field containing a value FRAUD and the rejectionReason field having value Amount too high
    • and a Content-Type header with a value of application/vnd.fraud.v1+json

Once we’re ready to check the API in practice in the integration tests we need to just install the stubs locally

add the Spring Cloud Contract Verifier plugin

We can add either Maven or Gradle plugin - in this example we’ll show how to add Maven. First we need to add the Spring Cloud Contract BOM.

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-dependencies.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Next, the Spring Cloud Contract Verifier Maven plugin

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-</plugin>

Since the plugin was added we get the Spring Cloud Contract Verifier features which from the provided contracts:

  • generate and run tests
  • produce and install stubs

We don’t want to generate tests since we, as consumers, want only to play with the stubs. That’s why we need to skip the tests generation and execution. When we execute:

cd local-http-server-repo
-./mvnw clean install -DskipTests

In the logs we’ll see something like this:

[INFO] --- spring-cloud-contract-maven-plugin:1.0.0.BUILD-SNAPSHOT:generateStubs (default-generateStubs) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar
-[INFO]
-[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar
-[INFO]
-[INFO] --- spring-boot-maven-plugin:1.5.5.BUILD-SNAPSHOT:repackage (default) @ http-server ---
-[INFO]
-[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ http-server ---
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.jar
-[INFO] Installing /some/path/http-server/pom.xml to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.pom
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar

This line is extremely important

[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar

It’s confirming that the stubs of the http-server have been installed in the local repository.

run the integration tests

In order to profit from the Spring Cloud Contract Stub Runner functionality of automatic stub downloading you have to do the following in our consumer side project (Loan Application service).

Add the Spring Cloud Contract BOM

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-dependencies.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Add the dependency to Spring Cloud Contract Stub Runner

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-	<scope>test</scope>
-</dependency>

Annotate your test class with @AutoConfigureStubRunner. In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators. Also provide the offline work switch since you’re playing with the collaborators offline (optional step).

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment=WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"}, workOffline = true)
-@DirtiesContext
-public class LoanApplicationServiceTests {

Now if you run your tests you’ll see sth like this:

2016-07-19 14:22:25.403  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Desired version is + - will try to resolve the latest version
-2016-07-19 14:22:25.438  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved version is 0.0.1-SNAPSHOT
-2016-07-19 14:22:25.439  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolving artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT using remote repositories []
-2016-07-19 14:22:25.451  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar
-2016-07-19 14:22:25.465  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacking stub from JAR [URI: file:/path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar]
-2016-07-19 14:22:25.475  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacked file to [/var/folders/0p/xwq47sq106x1_g3dtv6qfm940000gq/T/contracts100276532569594265]
-2016-07-19 14:22:27.737  INFO 41050 --- [           main] o.s.c.c.stubrunner.StubRunnerExecutor    : All stubs are now running RunningStubs [namesAndPorts={com.example:http-server:0.0.1-SNAPSHOT:stubs=8080}]

Which means that Stub Runner has found your stubs and started a server for app with group id com.example, artifact id http-server with version 0.0.1-SNAPSHOT of the stubs and with stubs classifier on port 8080.

file a PR

What we did until now is an iterative process. We can play around with the contract, install it locally and work on the consumer side until we’re happy with the contract.

Once we’re satisfied with the results and the test passes publish a PR to the server side. Currently the consumer side work is done.

Producer side (Fraud Detection server)

As a developer of the Fraud Detection server (a server to the Loan Issuance service):

initial implementation

As a reminder here you can see the initial implementation

@RequestMapping(value = "/fraudcheck", method = PUT)
-public FraudCheckResult fraudCheck(@RequestBody FraudCheck fraudCheck) {
-return new FraudCheckResult(FraudCheckStatus.OK, NO_REASON);
-}

take over the PR

git checkout -b contract-change-pr master
-git pull https://your-git-server.com/server-side-fork.git contract-change-pr

You have to add the dependencies needed by the autogenerated tests

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>

In the configuration of the Maven plugin we passed the packageWithBaseClasses property

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-</plugin>
[Important]Important

We’ve decided to use the "convention based" naming by setting the packageWithBaseClasses property. -That means that 2 last packages will be combined into a name of the base test class. In our case the contracts -were placed under src/test/resources/contracts/fraud. Since we don’t have 2 packages starting from the contracts -folder we’re picking only one which is fraud. We’re adding the Base suffix and we’re capitalizing fraud. -That gives us the FraudBase test class name.

That’s because all the generated tests will extend that class. Over there you can set up your Spring Context or -whatever is necessary. In our case we’re using Rest Assured MVC to start the server side FraudDetectionController.

package com.example.fraud;
-
-import org.junit.Before;
-
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-
-public class FraudBase {
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.standaloneSetup(new FraudDetectionController(),
-				new FraudStatsController(stubbedStatsProvider()));
-	}
-
-	private StatsProvider stubbedStatsProvider() {
-		return fraudType -> {
-			switch (fraudType) {
-			case DRUNKS:
-				return 100;
-			case ALL:
-				return 200;
-			}
-			return 0;
-		};
-	}
-
-	public void assertThatRejectionReasonIsNull(Object rejectionReason) {
-		assert rejectionReason == null;
-	}
-}

Now, if you run the ./mvnw clean install you would get sth like this:

Results :
-
-Tests in error:
-  ContractVerifierTest.validate_shouldMarkClientAsFraud:32 » IllegalState Parsed...

That’s because you have a new contract from which a test was generated and it failed since you haven’t implemented the feature. The autogenerated test would look like this:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-    // given:
-        MockMvcRequestSpecification request = given()
-                .header("Content-Type", "application/vnd.fraud.v1+json")
-                .body("{\"client.id\":\"1234567890\",\"loanAmount\":99999}");
-
-    // when:
-        ResponseOptions response = given().spec(request)
-                .put("/fraudcheck");
-
-    // then:
-        assertThat(response.statusCode()).isEqualTo(200);
-        assertThat(response.header("Content-Type")).matches("application/vnd.fraud.v1.json.*");
-    // and:
-        DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-        assertThatJson(parsedJson).field("['fraudCheckStatus']").matches("[A-Z]{5}");
-        assertThatJson(parsedJson).field("['rejection.reason']").isEqualTo("Amount too high");
-}

As you can see all the producer() parts of the Contract that were present in the value(consumer(…​), producer(…​)) blocks got injected into the test.

What’s important here to note is that on the producer side we also are doing TDD. We have expectations in form of a test. This test is shooting a request to our own application to an URL, headers and body defined in the contract. It also is expecting very precisely defined values in the response. In other words you have is your red part of red, green and refactor. Time to convert the red into the green.

write the missing implementation

Now since we now what is the expected input and expected output let’s write the missing implementation.

@RequestMapping(value = "/fraudcheck", method = PUT)
-public FraudCheckResult fraudCheck(@RequestBody FraudCheck fraudCheck) {
-if (amountGreaterThanThreshold(fraudCheck)) {
-	return new FraudCheckResult(FraudCheckStatus.FRAUD, AMOUNT_TOO_HIGH);
-}
-return new FraudCheckResult(FraudCheckStatus.OK, NO_REASON);
-}

If we execute ./mvnw clean install again the tests will pass. Since the Spring Cloud Contract Verifier plugin adds the tests to the generated-test-sources you can actually run those tests from your IDE.

deploy your app

Once you’ve finished your work it’s time to deploy your change. First merge the branch

git checkout master
-git merge --no-ff contract-change-pr
-git push origin master

Then we assume that your CI would run sth like ./mvnw clean deploy which would publish both the application and the stub artifcats.

Consumer side (Loan Issuance) final step

As a developer of the Loan Issuance service (a consumer of the Fraud Detection server):

merge branch to master

git checkout master
-git merge --no-ff contract-change-pr

work online

Now you can disable the offline work for Spring Cloud Contract Stub Runner and provide where the repository with your stubs is placed. At this moment the stubs of the server side will be automatically downloaded from Nexus / Artifactory. -You can switch off the value of the workOffline parameter in your annotation. Below you can see an -example of achieving the same by changing the properties.

stubrunner:
-  ids: 'com.example:http-server-dsl:+:stubs:8080'
-  repositoryRoot: https://repo.spring.io/libs-snapshot

And that’s it!

2.1.5 Dependencies

The best way to add the dependencies is to just use the proper starter dependency.

For stub-runner use spring-cloud-starter-stub-runner and when you’re using a plugin just add -spring-cloud-starter-contract-verifier.

2.1.6 Additional links

Below you can find some resources related to Spring Cloud Contract Verifier and Stub Runner. Note that some can be outdated since the Spring Cloud Contract Verifier project -is under constant development.

Spring Cloud Contract video

You can check out the video from the Warsaw JUG about Spring Cloud Contract:

2.1.7 Samples

Here you can find some samples.

2.2 FAQ

2.2.1 Why use Spring Cloud Contract Verifier and not X ?

For the time being Spring Cloud Contract Verifier is a JVM based tool. So it could be your first pick when you’re already creating -software for the JVM. This project has a lot of really interesting features but especially quite a few of them definitely make -Spring Cloud Contract Verifier stand out on the "market" of Consumer Driven Contract (CDC) tooling. Out of many the most interesting are:

  • Possibility to do CDC with messaging
  • Clear and easy to use, statically typed DSL
  • Possibility to copy paste your current JSON file to the contract and only edit its elements
  • Automatic generation of tests from the defined Contract
  • Stub Runner functionality - the stubs are automatically downloaded at runtime from Nexus / Artifactory
  • Spring Cloud integration - no discovery service is needed for integration tests

2.2.2 What is this value(consumer(), producer()) ?

One of the biggest challenges related to stubs is their reusability. Only if they can be vastly used, will they serve their purpose. -What typically makes that difficult are the hard-coded values of request / response elements. For example dates or ids. -Imagine the following JSON request

{
-    "time" : "2016-10-10 20:10:15",
-    "id" : "9febab1c-6f36-4a0b-88d6-3b6a6d81cd4a",
-    "body" : "foo"
-}

and JSON response

{
-    "time" : "2016-10-10 21:10:15",
-    "id" : "c4231e1f-3ca9-48d3-b7e7-567d55f0d051",
-    "body" : "bar"
-}

Imagine the pain required to set proper value of the time field (let’s assume that this content is generated by the -database) by changing the clock in the system or providing stub implementations of data providers. The same is related -to the field called id. Will you create a stubbed implementation of UUID generator? Makes little sense…​

So as a consumer you would like to send a request that matches any form of a time or any UUID. That way your system -will work as usual - will generate data and you won’t have to stub anything out. Let’s assume that in case of the aforementioned -JSON the most important part is the body field. You can focus on that and provide matching for other fields. In other words -you would like the stub to work like this:

{
-    "time" : "SOMETHING THAT MATCHES TIME",
-    "id" : "SOMETHING THAT MATCHES UUID",
-    "body" : "foo"
-}

As far as the response goes as a consumer you need a concrete value that you can operate on. So such a JSON is valid

{
-    "time" : "2016-10-10 21:10:15",
-    "id" : "c4231e1f-3ca9-48d3-b7e7-567d55f0d051",
-    "body" : "bar"
-}

As you could see in the previous sections we generate tests from contracts. So from the producer’s side the situation looks -much different. We’re parsing the provided contract and in the test we want to send a real request to your endpoints. -So for the case of a producer for the request we can’t have any sort of matching. We need concrete values that the -producer’s backend can work on. Such a JSON would be a valid one:

{
-    "time" : "2016-10-10 20:10:15",
-    "id" : "9febab1c-6f36-4a0b-88d6-3b6a6d81cd4a",
-    "body" : "foo"
-}

On the other hand from the point of view of the validity of the contract the response doesn’t necessarily have to -contain concrete values of time or id. Let’s say that you generate those on the producer side - again, you’d -have to do a lot of stubbing to ensure that you always return the same values. That’s why from the producer’s side -what you might want is the following response:

{
-    "time" : "SOMETHING THAT MATCHES TIME",
-    "id" : "SOMETHING THAT MATCHES UUID",
-    "body" : "bar"
-}

How can you then provide one time a matcher for the consumer and a concrete value for the producer and vice versa? -In Spring Cloud Contract we’re allowing you to provide a dynamic value. That means that it can differ for both -sides of the communication. You can pass the values:

Either via the value method

value(consumer(...), producer(...))
-value(stub(...), test(...))
-value(client(...), server(...))

or using the $() method

$(consumer(...), producer(...))
-$(stub(...), test(...))
-$(client(...), server(...))

You can read more about this in the Contract DSL section.

Calling value() or $() tells Spring Cloud Contract that you will be passing a dynamic value. -Inside the consumer() method you pass the value that should be used on the consumer side (in the generated stub). -Inside the producer() method you pass the value that should be used on the producer side (in the generated test).

[Tip]Tip

If on one side you have passed the regular expression and you haven’t passed the other, then the -other side will get auto-generated.

Most often you will use that method together with the regex helper method. E.g. consumer(regex('[0-9]{10}')).

To sum it up the contract for the aforementioned scenario would look more or less like this (the regular expression -for time and UUID are simplified and most likely invalid but we want to keep things very simple in this example):

org.springframework.cloud.contract.spec.Contract.make {
-				request {
-					method 'GET'
-					url '/someUrl'
-					body([
-					    time : value(consumer(regex('[0-9]{4}-[0-9]{2}-[0-9]{2} [0-2][0-9]-[0-5][0-9]-[0-5][0-9]')),
-					    id: value(consumer(regex('[0-9a-zA-z]{8}-[0-9a-zA-z]{4}-[0-9a-zA-z]{4}-[0-9a-zA-z]{12}'))
-					    body: "foo"
-					])
-				}
-			response {
-				status 200
-				body([
-					    time : value(producer(regex('[0-9]{4}-[0-9]{2}-[0-9]{2} [0-2][0-9]-[0-5][0-9]-[0-5][0-9]')),
-					    id: value([producer(regex('[0-9a-zA-z]{8}-[0-9a-zA-z]{4}-[0-9a-zA-z]{4}-[0-9a-zA-z]{12}'))
-					    body: "bar"
-					])
-			}
-}
[Important]Important

Please read the Groovy docs related to JSON to understand how to -properly structure the request / response bodies.

2.2.3 How to do Stubs versioning?

API Versioning

Let’s try to answer a question what versioning really means. If you’re referring to the API version then there are -different approaches.

  • use Hypermedia, links and do not version your API by any means
  • pass versions through headers / urls

I will not try to answer a question which approach is better. Whatever suit your needs and allows you to generate -business value should be picked.

Let’s assume that you do version your API. In that case you should provide as many contracts as many versions you support. -You can create a subfolder for every version or append it to th contract name - whatever suits you more.

JAR versioning

If by versioning you mean the version of the JAR that contains the stubs then there are essentially two main approaches.

Let’s assume that you’re doing Continuous Delivery / Deployment which means that you’re generating a new version of -the jar each time you go through the pipeline and that jar can go to production at any time. For example your jar version -looks like this (it got built on the 20.10.2016 at 20:15:21) :

1.0.0.20161020-201521-RELEASE

In that case your generated stub jar will look like this.

1.0.0.20161020-201521-RELEASE-stubs.jar

In this case you should inside your application.yml or @AutoConfigureStubRunner when referencing stubs provide the - latest version of the stubs. You can do that by passing the + sign. Example

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:8080"})

If the versioning however is fixed (e.g. 1.0.4.RELEASE or 2.1.1) then you have to set the concrete value of the jar -version. Example for 2.1.1.

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:2.1.1:stubs:8080"})

Dev or prod stubs

You can manipulate the classifier to run the tests against current development version of the stubs of other services - or the ones that were deployed to production. If you alter your build to deploy the stubs with the prod-stubs classifier - once you reach production deployment then you can run tests in one case with dev stubs and one with prod stubs.

Example of tests using development version of stubs

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:8080"})

Example of tests using production version of stubs

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:prod-stubs:8080"})

You can pass those values also via properties from your deployment pipeline.

2.2.4 Common repo with contracts

Another way of storing contracts other than having them with the producer is keeping them in a common place. -It can be related to security issues where the consumers can’t clone the producer’s code. Also if you keep -contracts in a single place then you, as a producer, will know how many consumers you have and which -consumer will you break with your local changes.

Repo structure

Let’s assume that we have a producer with coordinates com.example:server and 3 consumers: client1, -client2, client3. Then in the repository with common contracts you would have the following setup -(which you can checkout here:

├── com
-│   └── example
-│       └── server
-│           ├── client1
-│           │   └── expectation.groovy
-│           ├── client2
-│           │   └── expectation.groovy
-│           ├── client3
-│           │   └── expectation.groovy
-│           └── pom.xml
-├── mvnw
-├── mvnw.cmd
-├── pom.xml
-└── src
-    └── assembly
-        └── contracts.xml

As you can see the under the slash-delimited groupid / artifact id folder (com/example/server) you have -expectations of the 3 consumers (client1, client2 and client3). Expectations are the standard Groovy DSL -contract files as described throughout this documentation. This repository has to produce a JAR file that maps -one to one to the contents of the repo.

Example of a pom.xml inside the server folder.

<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<groupId>com.example</groupId>
-	<artifactId>server</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
-
-	<name>Server Stubs</name>
-	<description>POM used to install locally stubs for consumer side</description>
-
-	<parent>
-		<groupId>org.springframework.boot</groupId>
-		<artifactId>spring-boot-starter-parent</artifactId>
-		<version>1.5.4.RELEASE</version>
-		<relativePath />
-	</parent>
-
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<java.version>1.8</java.version>
-		<spring-cloud-contract.version>1.2.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
-		<spring-cloud-dependencies.version>Edgware.BUILD-SNAPSHOT</spring-cloud-dependencies.version>
-		<excludeBuildFolders>true</excludeBuildFolders>
-	</properties>
-
-	<dependencyManagement>
-		<dependencies>
-			<dependency>
-				<groupId>org.springframework.cloud</groupId>
-				<artifactId>spring-cloud-dependencies</artifactId>
-				<version>${spring-cloud-dependencies.version}</version>
-				<type>pom</type>
-				<scope>import</scope>
-			</dependency>
-		</dependencies>
-	</dependencyManagement>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.springframework.cloud</groupId>
-				<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-				<version>${spring-cloud-contract.version}</version>
-				<extensions>true</extensions>
-				<configuration>
-					<!-- By default it would search under src/test/resources/ -->
-					<contractsDirectory>${project.basedir}</contractsDirectory>
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
-
-	<repositories>
-		<repository>
-			<id>spring-snapshots</id>
-			<name>Spring Snapshots</name>
-			<url>https://repo.spring.io/snapshot</url>
-			<snapshots>
-				<enabled>true</enabled>
-			</snapshots>
-		</repository>
-		<repository>
-			<id>spring-milestones</id>
-			<name>Spring Milestones</name>
-			<url>https://repo.spring.io/milestone</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</repository>
-		<repository>
-			<id>spring-releases</id>
-			<name>Spring Releases</name>
-			<url>https://repo.spring.io/release</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</repository>
-	</repositories>
-	<pluginRepositories>
-		<pluginRepository>
-			<id>spring-snapshots</id>
-			<name>Spring Snapshots</name>
-			<url>https://repo.spring.io/snapshot</url>
-			<snapshots>
-				<enabled>true</enabled>
-			</snapshots>
-		</pluginRepository>
-		<pluginRepository>
-			<id>spring-milestones</id>
-			<name>Spring Milestones</name>
-			<url>https://repo.spring.io/milestone</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</pluginRepository>
-		<pluginRepository>
-			<id>spring-releases</id>
-			<name>Spring Releases</name>
-			<url>https://repo.spring.io/release</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</pluginRepository>
-	</pluginRepositories>
-
-</project>

As you can see there are no dependencies other than the Spring Cloud Contract Maven Plugin. -Those poms are necessary for the consumer side to run mvn clean install -DskipTests to locally install - stubs of the producer project.

The pom.xml in the root folder can look like this:

<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<groupId>com.example.standalone</groupId>
-	<artifactId>contracts</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
-
-	<name>Contracts</name>
-	<description>Contains all the Spring Cloud Contracts, well, contracts. JAR used by the producers to generate tests and stubs</description>
-
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-	</properties>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-assembly-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>contracts</id>
-						<phase>prepare-package</phase>
-						<goals>
-							<goal>single</goal>
-						</goals>
-						<configuration>
-							<attach>true</attach>
-							<descriptor>${basedir}/src/assembly/contracts.xml</descriptor>
-							<!-- If you want an explicit classifier remove the following line -->
-							<appendAssemblyId>false</appendAssemblyId>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-
-</project>

It’s using the assembly plugin in order to build the JAR with all the contracts. Example of such setup is here:

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-		  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>project</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>${project.basedir}</directory>
-			<outputDirectory>/</outputDirectory>
-			<useDefaultExcludes>true</useDefaultExcludes>
-			<excludes>
-				<exclude>**/${project.build.directory}/**</exclude>
-				<exclude>mvnw</exclude>
-				<exclude>mvnw.cmd</exclude>
-				<exclude>.mvn/**</exclude>
-				<exclude>src/**</exclude>
-			</excludes>
-		</fileSet>
-	</fileSets>
-</assembly>

Workflow

The workflow would look similar to the one presented in the Step by step guide to CDC. The only difference - is that the producer doesn’t own the contracts anymore. So the consumer and the producer have to work on - common contracts in a common repository.

Consumer

When the consumer wants to work on the contracts offline, instead of cloning the producer code, the -consumer team clones the common repository, goes to the required producer’s folder (e.g. com/example/server) -and runs mvn clean install -DskipTests to install locally the stubs converted from the contracts.

[Tip]Tip

You need to have Maven installed locally

Producer

As a producer it’s enough to alter the Spring Cloud Contract Verifier to provide the URL and the dependency -of the JAR containing the contracts:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<contractsRepositoryUrl>http://link/to/your/nexus/or/artifactory/or/sth</contractsRepositoryUrl>
-		<contractDependency>
-			<groupId>com.example.standalone</groupId>
-			<artifactId>contracts</artifactId>
-		</contractDependency>
-	</configuration>
-</plugin>

With this setup the JAR with groupid com.example.standalone and artifactid contracts will be downloaded -from http://link/to/your/nexus/or/artifactory/or/sth. It will be then unpacked in a local temporary folder -and contracts present under the com/example/server will be picked as the ones used to generate the -tests and the stubs. Due to this convention the producer team will know which consumer teams will be broken -when some incompatible changes are done.

The rest of the flow looks the same.

2.2.5 Can I have multiple base classes for tests?

Yes! Check out the Different base classes for contracts sections -of either Gradle or Maven plugins.

2.2.6 How can I debug the request/response being sent by the generated tests client?

The generated tests all boil down to RestAssured in some form or fashion which relies on Apache HttpClient. HttpClient has a facility called wire logging which logs the entire request and response to HttpClient. Spring Boot has a logging common application property for doing this sort of thing, just add this to your application properties

logging.level.org.apache.http.wire=DEBUG

2.2.7 How can I debug the mapping/request/response being sent by WireMock?

Starting from version 1.2.0 we turn on WireMock logging to -info and the WireMock notifier to being verbose. Now you will -exactly know what request was received by WireMock server and which -matching response definition was picked.

To turn off this feature just bump WireMock logging to ERROR

logging.level.com.github.tomakehurst.wiremock=ERROR

2.2.8 How can I see what got registered in the HTTP server stub?

You can use the mappingsOutputFolder property on @AutoConfigureStubRunner or StubRunnerRule -to dump all mappings per artifact id. Also the port at which the given stub server was -started will be attached.

2.2.9 Can I reference the request from the response?

Yes! With version 1.1.0 we’ve added such a possibility. On the HTTP stub server side we’re providing support -for this for WireMock. In case of other HTTP server stubs you’ll have to implement the approach yourself.

2.2.10 Can I reference text from file?

Yes! With version 1.2.0 we’ve added such a possibility. It’s enough to call file(…​) method in the -DSL and provide a path relative to where the contract lays.

2.3 Spring Cloud Contract Verifier HTTP

2.3.1 Gradle Project

Prerequisites

In order to use Spring Cloud Contract Verifier with WireMock you have to use Gradle or Maven plugin.

[Warning]Warning

If you want to use Spock in your projects you have to add separately -the spock-core and spock-spring modules. Check Spock docs for more information

Add gradle plugin with dependencies
buildscript {
-	repositories {
-		mavenCentral()
-	}
-	dependencies {
-	    classpath "org.springframework.boot:spring-boot-gradle-plugin:${springboot_version}"
-		classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${verifier_version}"
-	}
-}
-
-apply plugin: 'groovy'
-apply plugin: 'spring-cloud-contract'
-
-dependencyManagement {
-	imports {
-		mavenBom "org.springframework.cloud:spring-cloud-contract-dependencies:${verifier_version}"
-	}
-}
-
-dependencies {
-	testCompile 'org.codehaus.groovy:groovy-all:2.4.6'
-	// example with adding Spock core and Spock Spring
-	testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
-	testCompile 'org.spockframework:spock-spring:1.0-groovy-2.4'
-	testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
-}
Gradle and Rest Assured 2.0

By default Rest Assured 3.x is added to the classpath. However in order to give the users the -opportunity to use Rest Assured 2.x it’s enough to add it to the plugins classpath.

buildscript {
-	repositories {
-		mavenCentral()
-	}
-	dependencies {
-	    classpath "org.springframework.boot:spring-boot-gradle-plugin:${springboot_version}"
-		classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${verifier_version}"
-		classpath "com.jayway.restassured:rest-assured:2.5.0"
-		classpath "com.jayway.restassured:spring-mock-mvc:2.5.0"
-	}
-}
-
-depenendencies {
-    // all dependencies
-    // you can exclude rest-assured from spring-cloud-contract-verifier
-    testCompile "com.jayway.restassured:rest-assured:2.5.0"
-    testCompile "com.jayway.restassured:spring-mock-mvc:2.5.0"
-}

That way the plugin will automatically see that Rest Assured 2.x is present on the classpath -and will modify the imports accordingly.

Snapshot versions for Gradle

Add the additional snapshot repository to your build.gradle to use snapshot versions which are automatically uploaded after every successful build:

buildscript {
-	repositories {
-		mavenCentral()
-		mavenLocal()
-		maven { url "https://repo.spring.io/snapshot" }
-		maven { url "https://repo.spring.io/milestone" }
-		maven { url "https://repo.spring.io/release" }
-	}
-}
Add stubs

By default Spring Cloud Contract Verifier is looking for stubs in src/test/resources/contracts directory.

Directory containing stub definitions is treated as a class name, and each stub definition is treated as a single test. -We assume that it contains at least one directory which will be used as test class name. If there is more than one level of nested directories all except the last one will be used as package name. -So with following structure

src/test/resources/contracts/myservice/shouldCreateUser.groovy
-src/test/resources/contracts/myservice/shouldReturnUser.groovy

Spring Cloud Contract Verifier will create test class defaultBasePackage.MyService with two methods

  • shouldCreateUser()
  • shouldReturnUser()

Run plugin

Plugin registers itself to be invoked before check task. You have nothing to do as long as you want it to be part of your build process. If you just want to generate tests please invoke generateContractTests task.

Default setup

Default Gradle Plugin setup creates the following Gradle part of the build (it’s a pseudocode)

contracts {
-    targetFramework = 'JUNIT'
-    testMode = 'MockMvc'
-    generatedTestSourcesDir = project.file("${project.buildDir}/generated-test-sources/contracts")
-    contractsDslDir = "${project.rootDir}/src/test/resources/contracts"
-    basePackageForTests = 'org.springframework.cloud.verifier.tests'
-    stubsOutputDir = project.file("${project.buildDir}/stubs")
-
-    // the following properties are used when you want to provide where the JAR with contract lays
-    contractDependency {
-        stringNotation = ''
-    }
-    contractsPath = ''
-    contractsWorkOffline = false
-    contractRepository {
-        cacheDownloadedContracts(true)
-    }
-}
-
-tasks.create(type: Jar, name: 'verifierStubsJar', dependsOn: 'generateClientStubs') {
-    baseName = project.name
-    classifier = contracts.stubsSuffix
-    from contractVerifier.stubsOutputDir
-}
-
-project.artifacts {
-    archives task
-}
-
-tasks.create(type: Copy, name: 'copyContracts') {
-    from contracts.contractsDslDir
-    into contracts.stubsOutputDir
-}
-
-verifierStubsJar.dependsOn 'copyContracts'
-
-publishing {
-    publications {
-        stubs(MavenPublication) {
-            artifactId project.name
-            artifact verifierStubsJar
-        }
-    }
-}

Configure plugin

To change default configuration just add contracts snippet to your Gradle config

contracts {
-	testMode = 'MockMvc'
-	baseClassForTests = 'org.mycompany.tests'
-	generatedTestSourcesDir = project.file('src/generatedContract')
-}
Configuration options
  • testMode - defines mode for acceptance tests. By default MockMvc which is based on Spring’s MockMvc. It can also be changed to JaxRsClient or to Explicit for real HTTP calls.
  • imports - array with imports that should be included in generated tests (for example ['org.myorg.Matchers']). By default empty array []
  • staticImports - array with static imports that should be included in generated tests(for example ['org.myorg.Matchers.*']). By default empty array []
  • basePackageForTests - specifies base package for all generated tests. If not set the value will be picked from baseClassForTests’s package and from -`packageWithBaseClasses. If neither of these are set then the value will be set to org.springframework.cloud.contract.verifier.tests
  • baseClassForTests - base class for all generated tests. By default spock.lang.Specification if using Spock tests.
  • packageWithBaseClasses - instead of providing a fixed value for base class you can provide a package where all the base classes lay. Takes precedence over baseClassForTests.
  • baseClassMappings - explicitly map contract package to a FQN of a base class. Takes precedence over packageWithBaseClasses and baseClassForTests.
  • ruleClassForTests - specifies Rule which should be added to generated test classes.
  • ignoredFiles - Ant matcher allowing defining stub files for which processing should be skipped. By default empty array []
  • contractsDslDir - directory containing contracts written using the GroovyDSL. By default $rootDir/src/test/resources/contracts
  • generatedTestSourcesDir - test source directory where tests generated from Groovy DSL should be placed. By default $buildDir/generated-test-sources/contractVerifier
  • stubsOutputDir - dir where the generated WireMock stubs from Groovy DSL should be placed
  • targetFramework - the target test framework to be used; currently Spock and JUnit are supported with JUnit being the default framework

The following properties are used when you want to provide where the JAR with contract lays

  • contractDependency - the Dependency that provides groupid:artifactid:version:classifier coordinates. You can use the contractDependency closure to set it up
  • contractsPath - if contract deps are downloaded will default to groupid/artifactid where groupid will be slash separated. Otherwise will scan contracts under provided directory
  • contractsWorkOffline - in order not to download the dependencies each time you can download them once and work offline afterwards (reuse local Maven repo)
Single base class for all tests

When using Spring Cloud Contract Verifier in default MockMvc you need to create a base specification for all generated acceptance tests. In this class you need to point to endpoint which should be verified.

abstract class BaseMockMvcSpec extends Specification {
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new PairIdController())
-	}
-
-	void isProperCorrelationId(Integer correlationId) {
-		assert correlationId == 123456
-	}
-
-	void isEmpty(String value) {
-		assert value == null
-	}
-
-}

In case of using Explicit mode, you can use base class to initialize the whole tested app similarly as in regular integration tests. In case of JAXRSCLIENT mode this base class -should also contain protected WebTarget webTarget field, right now the only option to test JAX-RS API is to start a web server.

Different base classes for contracts

If your base classes differ between contracts you can tell the Spring Cloud Contract plugin which class should get -extended by the autogenerated tests. You have two options:

  • follow a convention by providing the packageWithBaseClasses
  • provide explicit mapping via baseClassMappings

Convention

The convention is such that if you have a contract under e.g. src/test/resources/contract/foo/bar/baz/ and provide the value of the packageWithBaseClasses property -to com.example.base then we will assume that there is a BarBazBase class under com.example.base package. In other words we take last two parts of package -if they exist and form a class with a Base suffix. Takes precedence over baseClassForTests. Example of usage in the contracts closure:

packageWithBaseClasses = 'com.example.base'

Mapping

You can manually map a regular expression of the contract’s package to fully qualified name of the base class for the matched contract. -Let’s take a look at the following example:

baseClassForTests = "com.example.FooBase"
-baseClassMappings {
-	baseClassMapping('.*/com/.*', 'com.example.ComBase')
-	baseClassMapping('.*/bar/.*':'com.example.BarBase')
-}

Let’s assume that you have contracts under - - src/test/resources/contract/com/ - - src/test/resources/contract/foo/

By providing the baseClassForTests we have a fallback in case mapping didn’t succeed (you could also provide -the packageWithBaseClasses as fallback). That way the tests generated from src/test/resources/contract/com/ contracts -will be extending the com.example.ComBase whereas the rest of tests will extend com.example.FooBase.

Invoking generated tests

To ensure that provider side is complaint with defined contracts, you need to invoke:

./gradlew generateContractTests test

Spring Cloud Contract Verifier on consumer side

In consumer service you need to configure Spring Cloud Contract Verifier plugin in exactly the same way as in case of provider. If you don’t want to use Stub Runner then you need to copy contracts stored in -src/test/resources/contracts and generate WireMock json stubs using:

./gradlew generateClientStubs

Note that stubsOutputDir option has to be set for stub generation to work.

When present, json stubs can be used in consumer automated tests.

@ContextConfiguration(loader == SpringApplicationContextLoader, classes == Application)
-class LoanApplicationServiceSpec extends Specification {
-
- @ClassRule
- @Shared
- WireMockClassRule wireMockRule == new WireMockClassRule()
-
- @Autowired
- LoanApplicationService sut
-
- def 'should successfully apply for loan'() {
-   given:
- 	LoanApplication application =
-			new LoanApplication(client: new Client(clientPesel: '12345678901'), amount: 123.123)
-   when:
-	LoanApplicationResult loanApplication == sut.loanApplication(application)
-   then:
-	loanApplication.loanApplicationStatus == LoanApplicationStatus.LOAN_APPLIED
-	loanApplication.rejectionReason == null
- }
-}

Underneath LoanApplication makes a call to FraudDetection service. This request is handled by WireMock server configured using stubs generated by Spring Cloud Contract Verifier.

2.3.2 Using in your Maven project

Add maven plugin

Add the Spring Cloud Contract BOM

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-dependencies.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Next, the Spring Cloud Contract Verifier Maven plugin

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-</plugin>

You can read more in the Spring Cloud Contract Maven Plugin Docs

Maven and Rest Assured 2.0

By default Rest Assured 3.x is added to the classpath. However in order to give the users the -opportunity to use Rest Assured 2.x it’s enough to add it to the plugins classpath.

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <packageWithBaseClasses>com.example</packageWithBaseClasses>
-    </configuration>
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-contract-verifier</artifactId>
-            <version>${spring-cloud-contract.version}</version>
-        </dependency>
-        <dependency>
-           <groupId>com.jayway.restassured</groupId>
-           <artifactId>rest-assured</artifactId>
-           <version>2.5.0</version>
-           <scope>compile</scope>
-        </dependency>
-        <dependency>
-           <groupId>com.jayway.restassured</groupId>
-           <artifactId>spring-mock-mvc</artifactId>
-           <version>2.5.0</version>
-           <scope>compile</scope>
-        </dependency>
-    </dependencies>
-</plugin>
-
-<dependencies>
-    <!-- all dependencies -->
-    <!-- you can exclude rest-assured from spring-cloud-contract-verifier -->
-    <dependency>
-       <groupId>com.jayway.restassured</groupId>
-       <artifactId>rest-assured</artifactId>
-       <version>2.5.0</version>
-       <scope>test</scope>
-    </dependency>
-    <dependency>
-       <groupId>com.jayway.restassured</groupId>
-       <artifactId>spring-mock-mvc</artifactId>
-       <version>2.5.0</version>
-       <scope>test</scope>
-    </dependency>
-</dependencies>

That way the plugin will automatically see that Rest Assured 3.x is present on the classpath -and will modify the imports accordingly.

Snapshot versions for Maven

For Snapshot / Milestone versions you have to add the following section to your pom.xml

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

Add stubs

By default Spring Cloud Contract Verifier is looking for stubs in src/test/resources/contracts directory. -Directory containing stub definitions is treated as a class name, and each stub definition is treated as a single test. -We assume that it contains at least one directory which will be used as test class name. If there is more than one level of nested directories all except the last one will be used as package name. -So with following structure

src/test/resources/contracts/myservice/shouldCreateUser.groovy
-src/test/resources/contracts/myservice/shouldReturnUser.groovy

Spring Cloud Contract Verifier will create test class defaultBasePackage.MyService with two methods - - shouldCreateUser() - - shouldReturnUser()

Run plugin

Plugin goal generateTests is assigned to be invoked in phase generate-test-sources. You have nothing to do as long as you want it to be part of your build process. If you just want to generate tests please invoke generateTests goal.

Configure plugin

To change default configuration just add configuration section to plugin definition or execution definition.

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <executions>
-        <execution>
-            <goals>
-                <goal>convert</goal>
-                <goal>generateStubs</goal>
-                <goal>generateTests</goal>
-            </goals>
-        </execution>
-    </executions>
-    <configuration>
-        <basePackageForTests>org.springframework.cloud.verifier.twitter.place</basePackageForTests>
-        <baseClassForTests>org.springframework.cloud.verifier.twitter.place.BaseMockMvcSpec</baseClassForTests>
-    </configuration>
-</plugin>
Important configuration options
  • testMode - defines mode for acceptance tests. By default MockMvc which is based on Spring’s MockMvc. It can also be changed to JaxRsClient or to Explicit for real HTTP calls.
  • basePackageForTests - specifies base package for all generated tests. If not set the value will be picked from baseClassForTests’s package and from -`packageWithBaseClasses. If neither of these are set then the value will be set to org.springframework.cloud.contract.verifier.tests
  • ruleClassForTests - specifies Rule which should be added to generated test classes.
  • baseClassForTests - base class for generated tests. By default spock.lang.Specification if using Spock tests.
  • contractsDirectory - directory containing contracts written using the GroovyDSL. By default /src/test/resources/contracts.
  • testFramework - the target test framework to be used; currently Spock and JUnit are supported with JUnit being the default framework
  • packageWithBaseClasses - instead of providing a fixed value for base class you can provide a package where all the base classes lay. -The convention is such that if you have a contract under src/test/resources/contract/foo/bar/baz/ and provide the value of this property -to com.example.base then we will assume that there is a BarBazBase class under com.example.base package. Takes precedence -over baseClassForTests
  • baseClassMappings - list of base class mappings that where you have to provide contractPackageRegex which is checked -against the package in which the contract lays and baseClassFQN that maps to fully qualified name of the base class for the matched -contract. If you have a contract under src/test/resources/contract/foo/bar/baz/ and map the property .*com.example.base.BaseClass then -the test class generated from these contracts will extend com.example.base.BaseClass. Takes precedence over packageWithBaseClasses - and baseClassForTests.

If you want to download your contract definitions from a Maven repository you can use

  • contractDependency - the contract dependency that contains all the packaged contracts
  • contractsPath - path to concrete contracts in the JAR with packaged contracts. Defaults to groupid/artifactid where gropuid is slash separated.
  • contractsWorkOffline - if the dependencies should be downloaded or local Maven only should be reused
  • contractsRepositoryUrl - DEPRECATED PROPERTY - please use the contractRepository closure - URL to a repo with the artifacts with contracts, if not provided should use the current Maven ones
  • contractRepository - closure where you can define properties related to repository with contracts

    • username - username to be used to connect to the repo
    • password - username to be used to connect to the repo
    • proxyHost - proxy host to be used to connect to the repo
    • proxyPort - proxy port to be used to connect to the repo
    • cacheDownloadedContracts - if you want to reuse download JARs that contain contract definitions. -We cache only non-snapshot, explicitly provided versions (e.g. + or 1.0.0.BUILD-SNAPSHOT won’t get cached). -By default this feature is turned on.
Single base class for all tests

When using Spring Cloud Contract Verifier in default MockMvc you need to create a base specification for all generated acceptance tests. -In this class you need to point to endpoint which should be verified.

package org.mycompany.tests
-
-import org.mycompany.ExampleSpringController
-import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc
-import spock.lang.Specification
-
-class  MvcSpec extends Specification {
-  def setup() {
-   RestAssuredMockMvc.standaloneSetup(new ExampleSpringController())
-  }
-}

In case of using Explicit mode, you can use base class to initialize the whole tested app similarly as in regular integration tests. In case of JAXRSCLIENT mode this base class should also contain protected WebTarget webTarget field, right now the only option to test JAX-RS API is to start a web server.

Different base classes for contracts

If your base classes differ between contracts you can tell the Spring Cloud Contract plugin which class should get -extended by the autogenerated tests. You have two options:

  • follow a convention by providing the packageWithBaseClasses
  • provide explicit mapping via baseClassMappings

Convention

The convention is such that if you have a contract under e.g. src/test/resources/contract/hello/v1/ and provide the value of the packageWithBaseClasses property -to hello then we will assume that there is a HelloV1Base class under hello package. In other words we take last two parts of package -if they exist and form a class with a Base suffix. Takes precedence over baseClassForTests. Example of usage:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<packageWithBaseClasses>hello</packageWithBaseClasses>
-	</configuration>
-</plugin>

Mapping

You can manually map a regular expression of the contract’s package to fully qualified name of the base class for the matched contract. -You have to provide a list baseClassMappings of baseClassMapping that takes a contractPackageRegex to baseClassFQN mapping. -Let’s take a look at the following example:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<baseClassForTests>com.example.FooBase</baseClassForTests>
-		<baseClassMappings>
-			<baseClassMapping>
-				<contractPackageRegex>.*com.*</contractPackageRegex>
-				<baseClassFQN>com.example.TestBase</baseClassFQN>
-			</baseClassMapping>
-		</baseClassMappings>
-	</configuration>
-</plugin>

Let’s assume that you have contracts under - - src/test/resources/contract/com/ - - src/test/resources/contract/foo/

By providing the baseClassForTests we have a fallback in case mapping didn’t succeed (you could also provide -the packageWithBaseClasses as fallback). That way the tests generated from src/test/resources/contract/com/ contracts -will be extending the com.example.ComBase whereas the rest of tests will extend com.example.FooBase.

Invoking generated tests

Spring Cloud Contract Maven Plugin generates verification code into directory /generated-test-sources/contractVerifier and attach this directory to testCompile goal.

For Groovy Spock code use:

<plugin>
-	<groupId>org.codehaus.gmavenplus</groupId>
-	<artifactId>gmavenplus-plugin</artifactId>
-	<version>1.5</version>
-	<executions>
-		<execution>
-			<goals>
-				<goal>testCompile</goal>
-			</goals>
-		</execution>
-	</executions>
-	<configuration>
-		<testSources>
-			<testSource>
-				<directory>${project.basedir}/src/test/groovy</directory>
-				<includes>
-					<include>**/*.groovy</include>
-				</includes>
-			</testSource>
-			<testSource>
-				<directory>${project.build.directory}/generated-test-sources/contractVerifier</directory>
-				<includes>
-					<include>**/*.groovy</include>
-				</includes>
-			</testSource>
-		</testSources>
-	</configuration>
-</plugin>

To ensure that provider side is complaint with defined contracts, you need to invoke mvn generateTest test

FAQ with Maven Plugin

Maven Plugin and STS

In case you see the following exception while using STS

STS Exception

when you click on the marker you should see sth like this

 plugin:1.1.0.M1:convert:default-convert:process-test-resources) org.apache.maven.plugin.PluginExecutionException: Execution default-convert of goal org.springframework.cloud:spring-
- cloud-contract-maven-plugin:1.1.0.M1:convert failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at
- org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331) at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362) at
-...
- org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: java.lang.NullPointerException at
- org.eclipse.m2e.core.internal.builder.plexusbuildapi.EclipseIncrementalBuildContext.hasDelta(EclipseIncrementalBuildContext.java:53) at
- org.sonatype.plexus.build.incremental.ThreadBuildContext.hasDelta(ThreadBuildContext.java:59) at

In order to fix this issue just provide the following section in your pom.xml

<build>
-    <pluginManagement>
-        <plugins>
-            <!--This plugin's configuration is used to store Eclipse m2e settings
-                only. It has no influence on the Maven build itself. -->
-            <plugin>
-                <groupId>org.eclipse.m2e</groupId>
-                <artifactId>lifecycle-mapping</artifactId>
-                <version>1.0.0</version>
-                <configuration>
-                    <lifecycleMappingMetadata>
-                        <pluginExecutions>
-                             <pluginExecution>
-                                <pluginExecutionFilter>
-                                    <groupId>org.springframework.cloud</groupId>
-                                    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-                                    <versionRange>[1.0,)</versionRange>
-                                    <goals>
-                                        <goal>convert</goal>
-                                    </goals>
-                                </pluginExecutionFilter>
-                                <action>
-                                    <execute />
-                                </action>
-                             </pluginExecution>
-                        </pluginExecutions>
-                    </lifecycleMappingMetadata>
-                </configuration>
-            </plugin>
-        </plugins>
-    </pluginManagement>
-</build>

Spring Cloud Contract Verifier on consumer side

You can actually use the Spring Cloud Contract Verifier also for the consumer side! -You can use the plugin so that it only converts the contracts and generates the stubs. -To achieve that you need to configure Spring Cloud Contract Verifier plugin in exactly -the same way as in case of provider. You need to copy contracts stored in -src/test/resources/contracts and generate WireMock json stubs using: -mvn generateStubs command. By default generated WireMock mapping is -stored in directory target/mappings. Your project should create from -this generated mappings additional artifact with classifier stubs for -easy deploy to maven repository.

Sample configuration:

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${verifier-plugin.version}</version>
-    <executions>
-        <execution>
-            <goals>
-                <goal>convert</goal>
-                <goal>generateStubs</goal>
-            </goals>
-        </execution>
-    </executions>
-</plugin>

When present, json stubs can be used in consumer automated tests.

@RunWith(SpringTestRunner.class)
-@SpringBootTest
-@AutoConfigureStubRunner
-public class LoanApplicationServiceTests {
-
-  @Autowired
-  LoanApplicationService service;
-
-  @Test
-  public void shouldSuccessfullyApplyForLoan() {
-    //given:
- 	LoanApplication application =
-			new LoanApplication(new Client("12345678901"), 123.123);
-    //when:
-	LoanApplicationResult loanApplication = service.loanApplication(application);
-    // then:
-	assertThat(loanApplication.loanApplicationStatus).isEqualTo(LoanApplicationStatus.LOAN_APPLIED);
-	assertThat(loanApplication.rejectionReason).isNull();
-  }
-}

Underneath LoanApplication makes a call to the FraudDetection service. This request is handled by -a WireMock server configured using stubs generated by Spring Cloud Contract Verifier.

2.3.3 Scenarios

It’s possible to handle scenarios with Spring Cloud Contract Verifier. All you need to do is to stick to proper naming convention while creating your contracts. The convention requires to include order number followed by the underscore.

my_contracts_dir\
-  scenario1\
-    1_login.groovy
-    2_showCart.groovy
-    3_logout.groovy

Such tree will cause Spring Cloud Contract Verifier generating WireMock’s scenario with name scenario1 and three steps:

  • login marked as Started pointing to:
  • showCart marked as Step1 pointing to:
  • logout marked as Step2 which will close the scenario.

More details about WireMock scenarios can be found under http://wiremock.org/stateful-behaviour.html

Spring Cloud Contract Verifier will also generate tests with guaranteed order of execution.

2.3.4 Stubs and transitive dependencies

The Maven and Gradle plugin that we’re created are adding the tasks that create the stubs jar for you. What can be problematic -is that when reusing the stubs you can by mistake import all of that stub dependencies! When building a Maven artifact -even though you have a couple of different jars, all of them share one pom:

├── github-webhook-0.0.1.BUILD-20160903.075506-1-stubs.jar
-├── github-webhook-0.0.1.BUILD-20160903.075506-1-stubs.jar.sha1
-├── github-webhook-0.0.1.BUILD-20160903.075655-2-stubs.jar
-├── github-webhook-0.0.1.BUILD-20160903.075655-2-stubs.jar.sha1
-├── github-webhook-0.0.1.BUILD-SNAPSHOT.jar
-├── github-webhook-0.0.1.BUILD-SNAPSHOT.pom
-├── github-webhook-0.0.1.BUILD-SNAPSHOT-stubs.jar
-├── ...
-└── ...

There are three possibilities of working with those dependencies so as not to have any issues with transitive dependencies.

Mark all application dependencies as optional

If in the github-webhook application we would mark all of our dependencies as optional, when you include the -github-webhook stubs in another application (or when that dependency gets downloaded by Stub Runner) then, since -all of the depenencies are optional, they will not get downloaded.

Create a separate artifactid for stubs

If you create a separate artifactid then you can set it up in whatever way you wish. For example by having no dependencies at all.

Exclude dependencies on the consumer side

As a consumer, if you add the stub dependency to your classpath you can explicitly exclude the unwanted dependencies.

2.4 Spring Cloud Contract Verifier Messaging

Spring Cloud Contract Verifier allows you to verify your application that uses messaging as means of communication. -All of our integrations are working with Spring but you can also create one yourself and use it.

2.4.1 Integrations

You can use one of the four integration configurations:

  • Apache Camel
  • Spring Integration
  • Spring Cloud Stream
  • Spring AMQP

Since we’re using Spring Boot then if you have added one of the aforementioned libraries -to the classpath then automatically all the messaging configuration will be set up.

[Important]Important

Remember to put @AutoConfigureMessageVerifier on the base class of your -generated tests. Otherwise messaging part of Spring Cloud Contract Verifier will not work.

[Important]Important

If you want to use Spring Cloud Stream remember to add a -org.springframework.cloud:spring-cloud-stream-test-support dependency.

Maven.  -

<dependency>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-stream-test-support</artifactId>
-    <scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-stream-test-support"

-

2.4.2 Manual Integration Testing

The main interface used by the tests is the org.springframework.cloud.contract.verifier.messaging.MessageVerifier. -It defines how to send and receive messages. You can create your own implementation to achieve the -same goal.

In the a test you can inject a ContractVerifierMessageExchange to send and receive messages that follow the contract. -Then add @AutoConfigureMessageVerifier to your test, e.g.

@RunWith(SpringTestRunner.class)
-@SpringBootTest
-@AutoConfigureMessageVerifier
-public static class MessagingContractTests {
-
-  @Autowired
-  private MessageVerifier verifier;
-  ...
-}
[Note]Note

If your tests require stubs as well, then -@AutoConfigureStubRunner includes the messaging configuration, so -you only need the one annotation.

2.4.3 Publisher side test generation

Having the input or outputMessage sections in your DSL will result in creation of tests on the publisher’s side. By default -JUnit tests will be created, however there is also a possibility to create Spock tests.

There are 3 main scenarios that we should take into consideration:

  • Scenario 1: there is no input message that produces an output one. The output message is triggered by a component -inside the application (e.g. scheduler)
  • Scenario 2: the input message triggers an output message
  • Scenario 3: the input message is consumed and there is no output message
[Important]Important

The destination passed to messageFrom or sentTo can have different meanings for different - messaging implementations. For Stream and Integration it’s first resolved as a destination of a channel, and then if - there is no such destination it’s resolved as a channel name. For Camel that’s a certain component (e.x. jms).

Example for Camel:

Scenario 1 (no input message)

For the given contract:

def contractDsl = Contract.make {
-	label 'some_label'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('activemq:output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-			messagingContentType(applicationJson())
-		}
-	}
-}

The following JUnit test will be created:

'''
- // when:
-  bookReturnedTriggered();
-
- // then:
-  ContractVerifierMessage response = contractVerifierMessaging.receive("activemq:output");
-  assertThat(response).isNotNull();
-  assertThat(response.getHeader("BOOK-NAME")).isNotNull();
-  assertThat(response.getHeader("BOOK-NAME").toString()).isEqualTo("foo");
-  assertThat(response.getHeader("contentType")).isNotNull();
-  assertThat(response.getHeader("contentType").toString()).isEqualTo("application/json");
- // and:
-  DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.getPayload()));
-  assertThatJson(parsedJson).field("bookName").isEqualTo("foo");
-'''

And the following Spock test would be created:

'''
- when:
-  bookReturnedTriggered()
-
- then:
-  ContractVerifierMessage response = contractVerifierMessaging.receive('activemq:output')
-  assert response != null
-  response.getHeader('BOOK-NAME')?.toString()  == 'foo'
-  response.getHeader('contentType')?.toString()  == 'application/json'
- and:
-  DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.payload))
-  assertThatJson(parsedJson).field("bookName").isEqualTo("foo")
-
-'''

Scenario 2 (output triggered by input)

For the given contract:

def contractDsl = Contract.make {
-	label 'some_label'
-	input {
-		messageFrom('jms:input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('jms:output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

The following JUnit test will be created:

'''
-// given:
- ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-  "{\\"bookName\\":\\"foo\\"}"
-, headers()
-  .header("sample", "header"));
-
-// when:
- contractVerifierMessaging.send(inputMessage, "jms:input");
-
-// then:
- ContractVerifierMessage response = contractVerifierMessaging.receive("jms:output");
- assertThat(response).isNotNull();
- assertThat(response.getHeader("BOOK-NAME")).isNotNull();
- assertThat(response.getHeader("BOOK-NAME").toString()).isEqualTo("foo");
-// and:
- DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.getPayload()));
- assertThatJson(parsedJson).field("bookName").isEqualTo("foo");
-'''

And the following Spock test would be created:

"""\
-given:
-   ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-    '''{"bookName":"foo"}''',
-    ['sample': 'header']
-  )
-
-when:
-   contractVerifierMessaging.send(inputMessage, 'jms:input')
-
-then:
-   ContractVerifierMessage response = contractVerifierMessaging.receive('jms:output')
-   assert response !- null
-   response.getHeader('BOOK-NAME')?.toString()  == 'foo'
-and:
-   DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.payload))
-   assertThatJson(parsedJson).field("bookName").isEqualTo("foo")
-"""

Scenario 3 (no output message)

For the given contract:

def contractDsl = Contract.make {
-	label 'some_label'
-	input {
-		messageFrom('jms:delete')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-		assertThat('bookWasDeleted()')
-	}
-}

The following JUnit test will be created:

'''
-// given:
- ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-	"{\\"bookName\\":\\"foo\\"}"
-, headers()
-	.header("sample", "header"));
-
-// when:
- contractVerifierMessaging.send(inputMessage, "jms:delete");
-
-// then:
- bookWasDeleted();
-'''

And the following Spock test would be created:

'''
-given:
-	 ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-		\'\'\'{"bookName":"foo"}\'\'\',
-		['sample': 'header']
-	)
-
-when:
-	 contractVerifierMessaging.send(inputMessage, 'jms:delete')
-
-then:
-	 noExceptionThrown()
-	 bookWasDeleted()
-'''

2.4.4 Consumer Stub Side generation

Unlike the HTTP part - in Messaging we need to publish the Groovy DSL inside the JAR with a stub. Then it’s parsed on the consumer side -and proper stubbed routes are created.

For more information please consult the Stub Runner Messaging sections.

Maven.  -

<dependencies>
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
-	</dependency>
-
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-		<scope>test</scope>
-	</dependency>
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-stream-test-support</artifactId>
-		<scope>test</scope>
-	</dependency>
-</dependencies>
-
-<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>Edgware.BUILD-SNAPSHOT</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

-

Gradle.  -

ext {
-	contractsDir = file("mappings")
-	stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
-}
-
-// Automatically added by plugin:
-// copyContracts - copies contracts to the output folder from which JAR will be created
-// verifierStubsJar - JAR with a provided stub suffix
-// the presented publication is also added by the plugin but you can modify it as you wish
-
-publishing {
-	publications {
-		stubs(MavenPublication) {
-			artifactId "${project.name}-stubs"
-			artifact verifierStubsJar
-		}
-	}
-}

-

2.5 Spring Cloud Contract Stub Runner

One of the issues that you could have encountered while using Spring Cloud Contract Verifier was to pass the generated WireMock JSON stubs from the server side to the client side (or various clients). - The same takes place in terms of client side generation for messaging.

Copying the JSON files / setting the client side for messaging manually is out of the question.

That’s why we’ll introduce Spring Cloud Contract Stub Runner that can download and run the stubs -automatically for you.

2.5.1 Snapshot versions

Add the additional snapshot repository to your build.gradle to use snapshot versions which are automatically uploaded after every successful build:

Maven.  -

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

-

Gradle.  -

buildscript {
-	repositories {
-		mavenCentral()
-		mavenLocal()
-		maven { url "https://repo.spring.io/snapshot" }
-		maven { url "https://repo.spring.io/milestone" }
-		maven { url "https://repo.spring.io/release" }
-	}

-

2.5.2 Publishing stubs as JARs

The easiest approach would be to centralize the way stubs are kept. For example you can keep them as JARs in a Maven repository.

[Tip]Tip

For both Maven and Gradle the setup comes out of the box. But you can customize it if you want to.

Maven.  -

<!-- 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>
-
-<!-- Next add the assembly plugin to your build -->
-<!-- we want the assembly plugin to generate the JAR -->
-<plugin>
-	<groupId>org.apache.maven.plugins</groupId>
-	<artifactId>maven-assembly-plugin</artifactId>
-	<executions>
-		<execution>
-			<id>stub</id>
-			<phase>prepare-package</phase>
-			<goals>
-				<goal>single</goal>
-			</goals>
-			<inherited>false</inherited>
-			<configuration>
-				<attach>true</attach>
-				<descriptor>${basedir}/src/assembly/stub.xml</descriptor>
-			</configuration>
-		</execution>
-	</executions>
-</plugin>
-
-<!-- Finally setup your assembly. Below you can find the contents of src/main/assembly/stub.xml -->
-<assembly
-	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>stubs</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>src/main/java</directory>
-			<outputDirectory>/</outputDirectory>
-			<includes>
-				<include>**com/example/model/*.*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${project.build.directory}/classes</directory>
-			<outputDirectory>/</outputDirectory>
-			<includes>
-				<include>**com/example/model/*.*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${project.build.directory}/snippets/stubs</directory>
-			<outputDirectory>META-INF/${project.groupId}/${project.artifactId}/${project.version}/mappings</outputDirectory>
-			<includes>
-				<include>**/*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${basedir}/src/test/resources/contracts</directory>
-			<outputDirectory>META-INF/${project.groupId}/${project.artifactId}/${project.version}/contracts</outputDirectory>
-			<includes>
-				<include>**/*.groovy</include>
-			</includes>
-		</fileSet>
-	</fileSets>
-</assembly>

-

Gradle.  -

ext {
-	contractsDir = file("mappings")
-	stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
-}
-
-// Automatically added by plugin:
-// copyContracts - copies contracts to the output folder from which JAR will be created
-// verifierStubsJar - JAR with a provided stub suffix
-// the presented publication is also added by the plugin but you can modify it as you wish
-
-publishing {
-	publications {
-		stubs(MavenPublication) {
-			artifactId "${project.name}-stubs"
-			artifact verifierStubsJar
-		}
-	}
-}

-

2.6 Stub Runner Core

Runs stubs for service collaborators. Treating stubs as contracts of services allows to use stub-runner as an implementation of -Consumer Driven Contracts.

Stub Runner allows you to automatically download the stubs of the provided dependencies (or pick those from the classpath), start WireMock servers for them and feed them with proper stub definitions. -For messaging, special stub routes are defined.

2.6.1 Retrieving stubs

You can pick the following options of acquiring stubs

  • Aether based solution that downloads JARs with stubs from Artifactory / Nexus
  • Classpath scanning solution that searches classpath via pattern to retrieve stubs
  • Write your own implementation of the org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder for full customization

The latter example is described in the Custom Stub Runner section.

Stub downloading

If you provide the stubrunner.repositoryRoot or stubrunner.workOffline flag will be set -to true then Stub Runner will connect to the given server and download the required jars. -It will then unpack the JAR to a temporary folder and reference those files in further -contract processing.

Example:

@AutoConfigureStubRunner(repositoryRoot="https://foo.bar", ids = "com.example:beer-api-producer:+:stubs:8095")

Classpath scanning

If you DON’T provide the stubrunner.repositoryRoot and stubrunner.workOffline flag will -be set to false (that’s the default) then classpath will get scanned. Let’s look at the -following example:

@AutoConfigureStubRunner(ids = {
-    "com.example:beer-api-producer:+:stubs:8095",
-    "com.example.foo:bar:1.0.0:superstubs:8096"
-})

If you’ve added the dependencies to your classpath

Maven.  -

<dependency>
-    <groupId>com.example</groupId>
-    <artifactId>beer-api-producer-restdocs</artifactId>
-    <classifier>stubs</classifier>
-    <version>0.0.1-SNAPSHOT</version>
-    <scope>test</scope>
-    <exclusions>
-        <exclusion>
-            <groupId>*</groupId>
-            <artifactId>*</artifactId>
-        </exclusion>
-    </exclusions>
-</dependency>
-<dependency>
-    <groupId>com.example.foo</groupId>
-    <artifactId>bar</artifactId>
-    <classifier>superstubs</classifier>
-    <version>1.0.0</version>
-    <scope>test</scope>
-    <exclusions>
-        <exclusion>
-            <groupId>*</groupId>
-            <artifactId>*</artifactId>
-        </exclusion>
-    </exclusions>
-</dependency>

-

Gradle.  -

testCompile("com.example:beer-api-producer-restdocs:0.0.1-SNAPSHOT:stubs") {
-    transitive = false
-}
-testCompile("com.example.foo:bar:1.0.0:superstubs") {
-    transitive = false
-}

-

Then the following locations on your classpath will get scanned. For com.example:beer-api-producer-restdocs

  • /META-INF/com.example/beer-api-producer-restdocs/*/.*
  • /contracts/com.example/beer-api-producer-restdocs/*/.*
  • /mappings/com.example/beer-api-producer-restdocs/*/.*

and com.example.foo:bar

  • /META-INF/com.example.foo/bar/*/.*
  • /contracts/com.example.foo/bar/*/.*
  • /mappings/com.example.foo/bar/*/.*
[Tip]Tip

As you can see you have to explicitly provide the group and artifact ids when packaging the -producer stubs.

The producer would setup the contracts like this:

└── src
-    └── test
-        └── resources
-            └── contracts
-                └── com.example
-                    └── beer-api-producer-restdocs
-                        └── nested
-                            └── contract3.groovy

To achieve proper stub packaging.

Or using the Maven assembly plugin or -Gradle Jar task you have to create the following -structure in your stubs jar.

└── META-INF
-    └── com.example
-        └── beer-api-producer-restdocs
-            └── 2.0.0
-                ├── contracts
-                │   └── nested
-                │       └── contract2.groovy
-                └── mappings
-                    └── mapping.json

By maintaining this structure classpath gets scanned and you can profit from the messaging / -HTTP stubs without the need to download artifacts.

2.6.2 Running stubs

Limitations

[Important]Important

There might be a problem with StubRunner shutting down ports between tests. You might - have a situation in which you get port conflicts. As long as you use the same context across tests - everything works fine. But when the context are different (e.g. different stubs or different profiles) - then you have to either use @DirtiesContext to shut down the stub servers, or else run them on - different ports per test.

Running using main app

You can set the following options to the main class:

-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'
-                                  (default: stubs)
---maxPort, --maxp <Integer>     Maximum port value to be assigned to
-                                  the WireMock instance. Defaults to
-                                  15000 (default: 15000)
---minPort, --minp <Integer>     Minimum port value to be assigned to
-                                  the WireMock instance. Defaults to
-                                  10000 (default: 10000)
--p, --password                  Password to user when connecting to
-                                  repository
---phost, --proxyHost            Proxy host to use for repository
-                                  requests
---pport, --proxyPort [Integer]  Proxy port to use for repository
-                                  requests
--r, --root                      Location of a Jar containing server
-                                  where you keep your stubs (e.g. http:
-                                  //nexus.
-                                  net/content/repositories/repository)
--s, --stubs                     Comma separated list of Ivy
-                                  representation of jars with stubs.
-                                  Eg. groupid:artifactid1,groupid2:
-                                  artifactid2:classifier
--u, --username                  Username to user when connecting to
-                                  repository
---wo, --workOffline             Switch to work offline. Defaults to
-                                  'false'

HTTP Stubs

Stubs are defined in JSON documents, whose syntax is defined in WireMock documentation

Example:

{
-    "request": {
-        "method": "GET",
-        "url": "/ping"
-    },
-    "response": {
-        "status": 200,
-        "body": "pong",
-        "headers": {
-            "Content-Type": "text/plain"
-        }
-    }
-}

Viewing registered mappings

Every stubbed collaborator exposes list of defined mappings under __/admin/ endpoint.

You can also use the mappingsOutputFolder property to dump the mappings to files. - For annotation based approach it would look like this

@AutoConfigureStubRunner(ids="a.b.c:loanIssuance,a.b.c:fraudDetectionServer",
-mappingsOutputFolder = "target/outputmappings/")

and for the JUnit approach like this:

@ClassRule @Shared StubRunnerRule rule = new StubRunnerRule()
-			.repoRoot("http://some_url")
-			.downloadStub("a.b.c", "loanIssuance")
-			.downloadStub("a.b.c:fraudDetectionServer")
-			.withMappingsOutputFolder("target/outputmappings")

Then if you check out the folder target/outputmappings you would see the following structure

.
-├── fraudDetectionServer_13705
-└── loanIssuance_12255

That means that there were two stubs registered. fraudDetectionServer was registered at port 13705 -and loanIssuance at port 12255. If we take a look at one of the files we would see (for WireMock) -mappings available for the given server:

[{
-  "id" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7",
-  "request" : {
-    "url" : "/name",
-    "method" : "GET"
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "fraudDetectionServer"
-  },
-  "uuid" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7"
-},
-...
-]

Messaging Stubs

Depending on the provided Stub Runner dependency and the DSL the messaging routes are automatically set up.

2.7 Stub Runner JUnit Rule

Stub Runner comes with a JUnit rule thanks to which you can very easily download and run stubs for given group and artifact id:

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

After that rule gets executed Stub Runner connects to your Maven repository and for the given list of dependencies tries to:

  • download them
  • cache them locally
  • unzip them to a temporary folder
  • start a WireMock server for each Maven dependency on a random port from the provided range of ports / provided port
  • feed the WireMock server with all JSON files that are valid WireMock definitions
  • can also send messages (remember to pass an implementation of MessageVerifier interface)

Stub Runner uses Eclipse Aether mechanism to download the Maven dependencies. -Check their docs for more information.

Since the StubRunnerRule implements the StubFinder it allows you to find the started stubs:

package org.springframework.cloud.contract.stubrunner;
-
-import java.net.URL;
-import java.util.Collection;
-import java.util.Map;
-
-import org.springframework.cloud.contract.spec.Contract;
-
-public interface StubFinder extends StubTrigger {
-	/**
-	 * For the given groupId and artifactId tries to find the matching
-	 * URL of the running stub.
-	 *
-	 * @param groupId - might be null. In that case a search only via artifactId takes place
-	 * @return URL of a running stub or throws exception if not found
-	 */
-	URL findStubUrl(String groupId, String artifactId) throws StubNotFoundException;
-
-	/**
-	 * For the given Ivy notation {@code [groupId]:artifactId:[version]:[classifier]} tries to
-	 * find the matching URL of the running stub. You can also pass only {@code artifactId}.
-	 *
-	 * @param ivyNotation - Ivy representation of the Maven artifact
-	 * @return URL of a running stub or throws exception if not found
-	 */
-	URL findStubUrl(String ivyNotation) throws StubNotFoundException;
-
-	/**
-	 * Returns all running stubs
-	 */
-	RunningStubs findAllRunningStubs();
-
-	/**
-	 * Returns the list of Contracts
-	 */
-	Map<StubConfiguration, Collection<Contract>> getContracts();
-}

Example of usage in Spock tests:

@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")
-		.withMappingsOutputFolder("target/outputmappingsforrule")
-
-
-def 'should start WireMock servers'() {
-	expect: 'WireMocks are running'
-		rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance') != null
-		rule.findStubUrl('loanIssuance') != null
-		rule.findStubUrl('loanIssuance') == rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance')
-		rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer') != null
-	and:
-		rule.findAllRunningStubs().isPresent('loanIssuance')
-		rule.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs', 'fraudDetectionServer')
-		rule.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer')
-	and: 'Stubs were registered'
-		"${rule.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
-		"${rule.findStubUrl('fraudDetectionServer').toString()}/name".toURL().text == 'fraudDetectionServer'
-}
-
-def 'should output mappings to output folder'() {
-	when:
-		def url = rule.findStubUrl('fraudDetectionServer')
-	then:
-		new File("target/outputmappingsforrule", "fraudDetectionServer_${url.port}").exists()
-}

Example of usage in JUnit tests:

@Test
-public void should_start_wiremock_servers() throws Exception {
-	// expect: 'WireMocks are running'
-		then(rule.findStubUrl("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")).isNotNull();
-		then(rule.findStubUrl("loanIssuance")).isNotNull();
-		then(rule.findStubUrl("loanIssuance")).isEqualTo(rule.findStubUrl("org.springframework.cloud.contract.verifier.stubs", "loanIssuance"));
-		then(rule.findStubUrl("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")).isNotNull();
-	// and:
-		then(rule.findAllRunningStubs().isPresent("loanIssuance")).isTrue();
-		then(rule.findAllRunningStubs().isPresent("org.springframework.cloud.contract.verifier.stubs", "fraudDetectionServer")).isTrue();
-		then(rule.findAllRunningStubs().isPresent("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")).isTrue();
-	// and: 'Stubs were registered'
-		then(httpGet(rule.findStubUrl("loanIssuance").toString() + "/name")).isEqualTo("loanIssuance");
-		then(httpGet(rule.findStubUrl("fraudDetectionServer").toString() + "/name")).isEqualTo("fraudDetectionServer");
-}

Check the Common properties for JUnit and Spring for more information on how to apply global configuration of Stub Runner.

[Important]Important

To use the JUnit rule together with messaging you have to provide an implementation of the -MessageVerifier interface to the rule builder (e.g. rule.messageVerifier(new MyMessageVerifier())). -If you don’t do this then whenever you try to send a message an exception will be thrown.

2.7.1 Maven settings

The stub downloader honors Maven settings for a different local repository folder. -Authentication details for repositories and profiles are currently not taken into account, so you need to specify it using the properties mentioned above.

2.7.2 Providing fixed ports

You can also run your stubs on fixed ports. You can do it in two different ways. One is to pass it in the properties, and the other via fluent API of -JUnit rule.

2.7.3 Fluent API

When using the StubRunnerRule you can add a stub to download and then pass the port for the last downloaded stub.

@ClassRule public static StubRunnerRule rule = new StubRunnerRule()
-		.repoRoot(repoRoot())
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")
-		.withPort(12345)
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer:12346");

You can see that for this example the following test is valid:

then(rule.findStubUrl("loanIssuance")).isEqualTo(URI.create("http://localhost:12345").toURL());
-then(rule.findStubUrl("fraudDetectionServer")).isEqualTo(URI.create("http://localhost:12346").toURL());

2.7.4 Stub Runner with Spring

Sets up Spring configuration of the Stub Runner project.

By providing a list of stubs inside your configuration file the Stub Runner automatically downloads -and registers in WireMock the selected stubs.

If you want to find the URL of your stubbed dependency you can autowire the StubFinder interface and use -its methods as presented below:

@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
-@SpringBootTest(properties = [" stubrunner.cloud.enabled=false",
-		"stubrunner.camel.enabled=false",
-		'foo=${stubrunner.runningstubs.fraudDetectionServer.port}'])
-@AutoConfigureStubRunner(mappingsOutputFolder = "target/outputmappings/")
-@DirtiesContext
-@ActiveProfiles("test")
-class StubRunnerConfigurationSpec extends Specification {
-
-	@Autowired StubFinder stubFinder
-	@Autowired Environment environment
-	@Value('${foo}') Integer foo
-
-	@BeforeClass
-	@AfterClass
-	void setupProps() {
-		System.clearProperty("stubrunner.repository.root")
-		System.clearProperty("stubrunner.classifier")
-	}
-
-	def 'should start WireMock servers'() {
-		expect: 'WireMocks are running'
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance') != null
-			stubFinder.findStubUrl('loanIssuance') != null
-			stubFinder.findStubUrl('loanIssuance') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance')
-			stubFinder.findStubUrl('loanIssuance') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance')
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT:stubs')
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer') != null
-		and:
-			stubFinder.findAllRunningStubs().isPresent('loanIssuance')
-			stubFinder.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs', 'fraudDetectionServer')
-			stubFinder.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer')
-		and: 'Stubs were registered'
-			"${stubFinder.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
-			"${stubFinder.findStubUrl('fraudDetectionServer').toString()}/name".toURL().text == 'fraudDetectionServer'
-	}
-
-	def 'should throw an exception when stub is not found'() {
-		when:
-			stubFinder.findStubUrl('nonExistingService')
-		then:
-			thrown(StubNotFoundException)
-		when:
-			stubFinder.findStubUrl('nonExistingGroupId', 'nonExistingArtifactId')
-		then:
-			thrown(StubNotFoundException)
-	}
-
-	def 'should register started servers as environment variables'() {
-		expect:
-			environment.getProperty("stubrunner.runningstubs.loanIssuance.port") != null
-			stubFinder.findAllRunningStubs().getPort("loanIssuance") == (environment.getProperty("stubrunner.runningstubs.loanIssuance.port") as Integer)
-		and:
-			environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") != null
-			stubFinder.findAllRunningStubs().getPort("fraudDetectionServer") == (environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") as Integer)
-	}
-
-	def 'should be able to interpolate a running stub in the passed test property'() {
-		given:
-			int fraudPort = stubFinder.findAllRunningStubs().getPort("fraudDetectionServer")
-		expect:
-			fraudPort > 0
-			environment.getProperty("foo", Integer) == fraudPort
-			foo == fraudPort
-	}
-
-	def 'should dump all mappings to a file'() {
-		when:
-			def url = stubFinder.findStubUrl("fraudDetectionServer")
-		then:
-			new File("target/outputmappings/", "fraudDetectionServer_${url.port}").exists()
-	}
-
-	@Configuration
-	@EnableAutoConfiguration
-	static class Config {}
-}

for the following configuration file:

stubrunner:
-  repositoryRoot: classpath:m2repo/repository/
-  ids:
-    - org.springframework.cloud.contract.verifier.stubs:loanIssuance
-    - org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer
-    - org.springframework.cloud.contract.verifier.stubs:bootService
-  cloud:
-    enabled: false
-  camel:
-    enabled: false
-
-spring.cloud:
-  consul.enabled: false
-  service-registry.enabled: false

Instead of using the properties you can also use the properties inside the @AutoConfigureStubRunner. -Below you can find an example of achieving the same result by setting values on the annotation.

@AutoConfigureStubRunner(
-		ids = ["org.springframework.cloud.contract.verifier.stubs:loanIssuance",
-		"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer",
-		"org.springframework.cloud.contract.verifier.stubs:bootService"],
-		repositoryRoot = "classpath:m2repo/repository/")

Stub Runner Spring registers environment variables in the following manner -for every registered WireMock server. Example for Stub Runner ids - com.example:foo, com.example:bar.

  • stubrunner.runningstubs.foo.port
  • stubrunner.runningstubs.bar.port

Which you can reference in your code.

2.8 Stub Runner Spring Cloud

Stub Runner can integrate with Spring Cloud.

For real life examples you can check the

2.8.1 Stubbing Service Discovery

The most important feature of Stub Runner Spring Cloud is the fact that it’s stubbing

  • DiscoveryClient
  • Ribbon ServerList

that means that regardless of the fact whether you’re using Zookeeper, Consul, Eureka or anything else, you don’t need that in your tests. -We’re starting WireMock instances of your dependencies and we’re telling your application whenever you’re using Feign, load balanced RestTemplate -or DiscoveryClient directly, to call those stubbed servers instead of calling the real Service Discovery tool.

For example this test will pass

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'
-	and: 'Stubs can be reached via load service discovery'
-		restTemplate.getForObject('http://loanIssuance/name', String) == 'loanIssuance'
-		restTemplate.getForObject('http://someNameThatShouldMapFraudDetectionServer/name', String) == 'fraudDetectionServer'
-}

for the following configuration file

spring.cloud:
-  zookeeper.enabled: false
-  consul.enabled: false
-eureka.client.enabled: false
-stubrunner:
-  camel.enabled: false
-  idsToServiceIds:
-    ivyNotation: someValueInsideYourCode
-    fraudDetectionServer: someNameThatShouldMapFraudDetectionServer

Test profiles and service discovery

In your integration tests you typically don’t want to call neither a discovery service (e.g. Eureka) -or Config Server. That’s why you create an additional test configuration in which you want to disable -these features.

Due to certain limitations of spring-cloud-commons to achieve this you have disable these properties -via a static block like presented below (example for Eureka)

    //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");
-    }

2.8.2 Additional Configuration

You can match the artifactId of the stub with the name of your app by using the stubrunner.idsToServiceIds: map. -You can disable Stub Runner Ribbon support by providing: stubrunner.cloud.ribbon.enabled equal to false -You can disable Stub Runner support by providing: stubrunner.cloud.enabled equal to false

[Tip]Tip

By default all service discovery will be stubbed. That means that regardless of the fact if you have -an existing DiscoveryClient its results will be ignored. However, if you want to reuse it, just set - stubrunner.cloud.delegate.enabled to true and then your existing DiscoveryClient results will be - merged with the stubbed ones.

2.9 Stub Runner Boot Application

Spring Cloud Contract Stub Runner Boot is a Spring Boot application that exposes REST endpoints to -trigger the messaging labels and to access started WireMock servers.

One of the use-cases is to run some smoke (end to end) tests on a deployed application. -You can check out the Spring Cloud Pipelines -project for more information.

2.9.1 How to use it?

Stub Runner Server

Just add the

compile "org.springframework.cloud:spring-cloud-starter-stub-runner"

Annotate a class with @EnableStubRunnerServer, build a fat-jar and you’re ready to go!

For the properties check the Stub Runner Spring section.

Spring Cloud CLI

Starting from 1.4.0.RELEASE version of the Spring Cloud CLI -project you can start Stub Runner Boot by executing spring cloud stubrunner.

In order to pass the configuration just create a stubrunner.yml file in the current working directory -or a subdirectory called config or in ~/.spring-cloud. The file could look like this -(example for running stubs installed locally)

stubrunner.yml.  -

stubrunner:
-  workOffline: true
-  ids:
-    - com.example:beer-api-producer:+:9876

-

and then just call spring cloud stubrunner from your terminal window to start -the Stub Runner server. It will be available at port 8750.

2.9.2 Endpoints

HTTP

  • GET /stubs - returns a list of all running stubs in ivy:integer notation
  • GET /stubs/{ivy} - returns a port for the given ivy notation (when calling the endpoint ivy can also be artifactId only)

Messaging

For Messaging

  • GET /triggers - returns a list of all running labels in ivy : [ label1, label2 …​] notation
  • POST /triggers/{label} - executes a trigger with label
  • POST /triggers/{ivy}/{label} - executes a trigger with label for the given ivy notation (when calling the endpoint ivy can also be artifactId only)

2.9.3 Example

@ContextConfiguration(classes = StubRunnerBoot, loader = SpringBootContextLoader)
-@SpringBootTest(properties = "spring.cloud.zookeeper.enabled=false")
-@ActiveProfiles("test")
-class StubRunnerBootSpec extends Specification {
-
-	@Autowired StubRunning stubRunning
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning),
-				new TriggerController(stubRunning))
-	}
-
-	def 'should return a list of running stub servers in "full ivy:port" notation'() {
-		when:
-			String response = RestAssuredMockMvc.get('/stubs').body.asString()
-		then:
-			def root = new JsonSlurper().parseText(response)
-			root.'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs' instanceof Integer
-	}
-
-	def 'should return a port on which a [#stubId] stub is running'() {
-		when:
-			def response = RestAssuredMockMvc.get("/stubs/${stubId}")
-		then:
-			response.statusCode == 200
-			response.body.as(Integer) > 0
-		where:
-			stubId << ['org.springframework.cloud.contract.verifier.stubs:bootService:+:stubs',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService:+',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService',
-					   'bootService']
-	}
-
-	def 'should return 404 when missing stub was called'() {
-		when:
-			def response = RestAssuredMockMvc.get("/stubs/a:b:c:d")
-		then:
-			response.statusCode == 404
-	}
-
-	def 'should return a list of messaging labels that can be triggered when version and classifier are passed'() {
-		when:
-			String response = RestAssuredMockMvc.get('/triggers').body.asString()
-		then:
-			def root = new JsonSlurper().parseText(response)
-			root.'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs'?.containsAll(["delete_book","return_book_1","return_book_2"])
-	}
-
-	def 'should trigger a messaging label'() {
-		given:
-			StubRunning stubRunning = Mock()
-			RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning), new TriggerController(stubRunning))
-		when:
-			def response = RestAssuredMockMvc.post("/triggers/delete_book")
-		then:
-			response.statusCode == 200
-		and:
-			1 * stubRunning.trigger('delete_book')
-	}
-
-	def 'should trigger a messaging label for a stub with [#stubId] ivy notation'() {
-		given:
-			StubRunning stubRunning = Mock()
-			RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning), new TriggerController(stubRunning))
-		when:
-			def response = RestAssuredMockMvc.post("/triggers/$stubId/delete_book")
-		then:
-			response.statusCode == 200
-		and:
-			1 * stubRunning.trigger(stubId, 'delete_book')
-		where:
-			stubId << ['org.springframework.cloud.contract.verifier.stubs:bootService:stubs', 'org.springframework.cloud.contract.verifier.stubs:bootService', 'bootService']
-	}
-
-	def 'should throw exception when trigger is missing'() {
-		when:
-			RestAssuredMockMvc.post("/triggers/missing_label")
-		then:
-			Exception e = thrown(Exception)
-			e.message.contains("Exception occurred while trying to return [missing_label] label.")
-			e.message.contains("Available labels are")
-			e.message.contains("org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT:stubs=[]")
-			e.message.contains("org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs=")
-	}
-
-}

2.9.4 Stub Runner Boot with Service Discovery

One of the possibilities of using Stub Runner Boot is to use it as a feed of stubs for "smoke-tests". What does it mean? - Let’s assume that you don’t want to deploy 50 microservice to a test environment in order - to check if your application is working fine. You’ve already executed a suite of tests during the build process - but you would also like to ensure that the packaging of your application is fine. What you can do - is to deploy your application to an environment, start it and run a couple of tests on it to see if - it’s working fine. We can call those tests smoke-tests since their idea is to check only a handful - of testing scenarios.

The problem with this approach is such that if you’re doing microservices most likely you’re - using a service discovery tool. Stub Runner Boot allows you to solve this issue by starting the - required stubs and register them in a service discovery tool. Let’s take a look at an example of - such a setup with Eureka. Let’s assume that Eureka was already running.

@SpringBootApplication
-@EnableStubRunnerServer
-@EnableEurekaClient
-@AutoConfigureStubRunner
-public class StubRunnerBootEurekaExample {
-
-	public static void main(String[] args) {
-		SpringApplication.run(StubRunnerBootEurekaExample.class, args);
-	}
-
-}

As you can see we want to start a Stub Runner Boot server @EnableStubRunnerServer, enable Eureka client @EnableEurekaClient -and we want to have the stub runner feature turned on @AutoConfigureStubRunner.

Now let’s assume that we want to start this application so that the stubs get automatically registered. - We can do it by running the app java -jar ${SYSTEM_PROPS} stub-runner-boot-eureka-example.jar where - ${SYSTEM_PROPS} would contain the following list of properties

-Dstubrunner.repositoryRoot=https://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)
-
-(1) - we tell Stub Runner where all the stubs reside
-(2) - we don't want the default behaviour where the discovery service is stubbed. That's why the stub registration will be picked
-(3) - we provide a list of stubs to download
-(4) - we provide a list of artifactId to serviceId mapping

That way your deployed application can send requests to started WireMock servers via the service -discovery. Most likely points 1-3 could be set by default in application.yml cause they are not -likely to change. That way you can provide only the list of stubs to download whenever you start -the Stub Runner Boot.

2.10 Stubs Per Consumer

There are cases in which 2 consumers of the same endpoint want to have 2 different responses.

[Tip]Tip

This approach also allows you to immediately know which consumer is using which part of your API. -You can remove part of a response that your API produces and you can see which of your autogenerated tests -fails. If none fails then you can safely delete that part of the response cause nobody is using it.

Let’s look at the following example for contract defined for the producer called producer. -There are 2 consumers: foo-consumer and bar-consumer.

Consumer foo-service

request {
-   url '/foo'
-   method GET()
-}
-response {
-    status 200
-    body(
-       foo: "foo"
-    }
-}

Consumer bar-service

request {
-   url '/foo'
-   method GET()
-}
-response {
-    status 200
-    body(
-       bar: "bar"
-    }
-}

You can’t produce for the same request 2 different responses. That’s why you can properly package the -contracts and then profit from the stubsPerConsumer feature.

On the producer side the consumers can have a folder that contains contracts related only to them. -By setting the stubrunner.stubs-per-consumer flag to true we no longer register all stubs but only those that -correspond to the consumer application’s name. In other words we’ll scan the path of every stub and -if it contains the subfolder with name of the consumer in the path only then will it get registered.

On the foo producer side the contracts would look like this

.
-└── contracts
-    ├── bar-consumer
-    │   ├── bookReturnedForBar.groovy
-    │   └── shouldCallBar.groovy
-    └── foo-consumer
-        ├── bookReturnedForFoo.groovy
-        └── shouldCallFoo.groovy

Being the bar-consumer consumer you can either set the spring.application.name or the stubrunner.consumer-name to bar-consumer -Or set the test as follows:

@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/",
-		stubsPerConsumer = true)
-@DirtiesContext
-class StubRunnerStubsPerConsumerSpec extends Specification {
-...
-}

Then only the stubs registered under a path that contains the bar-consumer in its name (i.e. those from the -src/test/resources/contracts/bar-consumer/some/contracts/…​ folder) will be allowed to be referenced.

Or set the consumer name explicitly

@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
-@SpringBootTest
-@AutoConfigureStubRunner(ids = "org.springframework.cloud.contract.verifier.stubs:producerWithMultipleConsumers",
-		repositoryRoot = "classpath:m2repo/repository/",
-		consumerName = "foo-consumer",
-		stubsPerConsumer = true)
-@DirtiesContext
-class StubRunnerStubsPerConsumerWithConsumerNameSpec extends Specification {
-...
-}

Then only the stubs registered under a path that contains the foo-consumer in its name (i.e. those from the -src/test/resources/contracts/foo-consumer/some/contracts/…​ folder) will be allowed to be referenced.

You can check out issue 224 for more -information about the reasons behind this change.

2.11 Common

2.11.1 Common properties for JUnit and Spring

Some of the properties that are repetitive can be set using system properties or configuration properties (for Spring). Here are their names with their default values:

Property nameDefault valueDescription

stubrunner.minPort

10000

Minimal value of a port for a started WireMock with stubs

stubrunner.maxPort

15000

Minimal value of a port for a started WireMock with stubs

stubrunner.repositoryRoot

 

Maven repo url. If blank then will call the local maven repo

stubrunner.classifier

stubs

Default classifier for the stub artifacts

stubrunner.workOffline

false

If true then will not contact any remote repositories to download stubs

stubrunner.ids

 

Array of Ivy notation stubs to download

stubrunner.username

 

Optional username to access the tool that stores the JARs with stubs

stubrunner.password

 

Optional password to access the tool that stores the JARs with stubs

stubrunner.stubsPerConsumer

false

Set to true if you want to use different stubs per each consumer instead of registering all stubs for every consumer

stubrunner.consumerName

 

If you want to use stubs per consumer and want to override the consumer name just change this value

Stub runner stubs ids

You can provide the stubs to download via the stubrunner.ids system property. They follow the following pattern:

groupId:artifactId:version:classifier:port

version, classifier and port are optional.

  • If you don’t provide the port then a random one will be picked
  • If you don’t provide the classifier then the default one will be taken. (NOTE that you can pass an empty classifier like this groupId:artifactId:version:)
  • If you don’t provide the version then the + will be passed and the latest one will be downloaded

Where port means the port of the WireMock server.

[Important]Important

Starting from version 1.0.4 as a version you can provide a range of versions that you would like -the Stub Runner to take into consideration. You can read more about the Aether versioning ranges here.

Taken from Aether Docs:

This scheme accepts versions of any form, interpreting a version as a sequence of numeric and alphabetic segments. The characters '-', '_', and '.' as well as the mere -transitions from digit to letter and vice versa delimit the version segments. Delimiters are treated as equivalent.

Numeric segments are compared mathematically, alphabetic segments are compared lexicographically and case-insensitively. However, the following qualifier strings are -recognized and treated specially: "alpha" = "a" < "beta" = "b" < "milestone" = "m" < "cr" = "rc" < "snapshot" < "final" = "ga" < "sp". All of those well-known qualifiers -are considered smaller/older than other strings. An empty segment/string is equivalent to 0.

In addition to the above mentioned qualifiers, the tokens "min" and "max" may be used as final version segment to denote the smallest/greatest version having a given prefix. -For example, "1.2.min" denotes the smallest version in the 1.2 line, "1.2.max" denotes the greatest version in the 1.2 line. A version range of the form "[M.N.*]" is short for "[M.N.min, M.N.max]".

Numbers and strings are considered incomparable against each other. Where version segments of different kind would collide, comparison will instead assume that the previous -segments are padded with trailing 0 or "ga" segments, respectively, until the kind mismatch is resolved, e.g. "1-alpha" = "1.0.0-alpha" < "1.0.1-ga" = "1.0.1".

2.12 Stub Runner for Messaging

Stub Runner has the functionality to run the published stubs in memory. It can integrate with the following frameworks out of the box

  • Spring Integration
  • Spring Cloud Stream
  • Apache Camel
  • Spring AMQP

It also provides points of entry to integrate with any other solution on the market.

2.12.1 Stub triggering

To trigger a message it’s enough to use the StubTrigger interface:

package org.springframework.cloud.contract.stubrunner;
-
-import java.util.Collection;
-import java.util.Map;
-
-public interface StubTrigger {
-
-	/**
-	 * Triggers an event by a given label for a given {@code groupid:artifactid} notation. You can use only {@code artifactId} too.
-	 *
-	 * Feature related to messaging.
-	 *
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger(String ivyNotation, String labelName);
-
-	/**
-	 * Triggers an event by a given label.
-	 *
-	 * Feature related to messaging.
-	 *
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger(String labelName);
-
-	/**
-	 * Triggers all possible events.
-	 *
-	 * Feature related to messaging.
-	 *
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger();
-
-	/**
-	 * Returns a mapping of ivy notation of a dependency to all the labels it has.
-	 *
-	 * Feature related to messaging.
-	 */
-	Map<String, Collection<String>> labels();
-}

For convenience the StubFinder interface extends StubTrigger so it’s enough to use only one in your tests.

StubTrigger gives you the following options to trigger a message:

Trigger by label

stubFinder.trigger('return_book_1')
Trigger by group and artifact ids
stubFinder.trigger('org.springframework.cloud.contract.verifier.stubs:camelService', 'return_book_1')
Trigger by artifact ids
stubFinder.trigger('camelService', 'return_book_1')

Trigger all messages

stubFinder.trigger()

2.13 Stub Runner Camel

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to integrate with Apache Camel. -For the provided artifacts it will automatically download the stubs and register the required -routes.

2.13.1 Adding it to the project

It’s enough to have both Apache Camel and Spring Cloud Contract Stub Runner on classpath. -Remember to annotate your test class with @AutoConfigureStubRunner.

2.13.2 Examples

Stubs structure

Let us assume that we have the following Maven repository with a deployed stubs for the -camelService application.

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── camelService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── camelService-0.0.1-SNAPSHOT.pom
-                            │   ├── camelService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

And the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Let’s consider the following contracts (let' number it with 1):

Contract.make {
-	label 'return_book_1'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('jms:output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and number 2

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('jms:input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('jms:output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			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
-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
-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'])

2.14 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 will automatically download the stubs and register the required -routes.

2.14.1 Adding it to the project

It’s enough to have both Spring Integration and Spring Cloud Contract Stub Runner on classpath. -Remember to annotate your test class with @AutoConfigureStubRunner.

2.14.2 Examples

Stubs structure

Let us assume that we have the following Maven repository with a deployed stubs for the -integrationService application.

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── integrationService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── integrationService-0.0.1-SNAPSHOT.pom
-                            │   ├── integrationService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

And the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Let’s consider the following contracts (let' number it with 1):

Contract.make {
-	label 'return_book_1'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and number 2

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and the following Spring Integration Route:

<?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"
-			 xsi:schemaLocation="http://www.springframework.org/schema/beans
-			https://www.springframework.org/schema/beans/spring-beans.xsd
-			http://www.springframework.org/schema/integration
-			https://www.springframework.org/schema/integration/spring-integration.xsd">
-
-
-	<!-- REQUIRED FOR TESTING -->
-	<bridge input-channel="output"
-			output-channel="outputTest"/>
-
-	<channel id="outputTest">
-		<queue/>
-	</channel>
-
-</beans:beans>

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 output

Message<?> receivedMessage = messaging.receive('outputTest')

And the received message would pass the following assertions

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.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 output destination.

messaging.send(new BookReturned('foo'), [sample: 'header'], 'input')

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

Message<?> receivedMessage = messaging.receive('outputTest')

And the received message would pass the following assertions

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.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 input destination.

messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')

2.15 Stub Runner Stream

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to integrate with Spring Stream. -For the provided artifacts it will automatically download the stubs and register the required -routes.

[Warning]Warning

In Stub Runner’s integration with Stream the messageFrom or sentTo Strings are resolved -first as a destination of a channel, and then if there is no such destination it’s resolved as a -channel name.

[Important]Important

If you want to use Spring Cloud Stream remember to add a -org.springframework.cloud:spring-cloud-stream-test-support dependency.

Maven.  -

<dependency>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-stream-test-support</artifactId>
-    <scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-stream-test-support"

-

2.15.1 Adding it to the project

It’s enough to have both Spring Cloud Stream and Spring Cloud Contract Stub Runner on classpath. -Remember to annotate your test class with @AutoConfigureStubRunner.

2.15.2 Examples

Stubs structure

Let us assume that we have the following Maven repository with a deployed stubs for the -streamService application.

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── streamService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── streamService-0.0.1-SNAPSHOT.pom
-                            │   ├── streamService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

And the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Let’s consider the following contracts (let' number it with 1):

Contract.make {
-	label 'return_book_1'
-	input { triggeredBy('bookReturnedTriggered()') }
-	outputMessage {
-		sentTo('returnBook')
-		body('''{ "bookName" : "foo" }''')
-		headers { header('BOOK-NAME', 'foo') }
-	}
-}

and number 2

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('bookStorage')
-		messageBody([
-			bookName: 'foo'
-		])
-		messageHeaders { header('sample', 'header') }
-	}
-	outputMessage {
-		sentTo('returnBook')
-		body([
-			bookName: 'foo'
-		])
-		headers { header('BOOK-NAME', 'foo') }
-	}
-}

and the following Spring configuration:

stubrunner.repositoryRoot: classpath:m2repo/repository/
-stubrunner.ids: org.springframework.cloud.contract.verifier.stubs:streamService:0.0.1-SNAPSHOT:stubs
-
-spring:
-  cloud:
-    stream:
-      bindings:
-        output:
-          destination: returnBook
-        input:
-          destination: bookStorage
-
-server:
-  port: 0
-
-debug: true

Scenario 1 (no input message)

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

stubFinder.trigger('return_book_1')

Next we’ll want to listen to the output of the message sent to a channel whose destination is returnBook

Message<?> receivedMessage = messaging.receive('returnBook')

And the received message would pass the following assertions

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.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 bookStorage destination.

messaging.send(new BookReturned('foo'), [sample: 'header'], 'bookStorage')

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

Message<?> receivedMessage = messaging.receive('returnBook')

And the received message would pass the following assertions

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.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 output destination.

messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')

2.16 Stub Runner Spring AMQP

Spring Cloud Contract Verifier Stub Runner’s messaging module provides an easy way to integrate with Spring AMQP’s Rabbit Template. -For the provided artifacts it will automatically download the stubs and register the required -routes.

The integration tries to work standalone, that is without interaction with a running RabbitMQ message broker. -It expects a RabbitTemplate on the application context and uses it as a spring boot test @SpyBean. -Thus it can use the mockito spy functionality to verify and introspect messages sent by the application.

On the message consumer side, it considers all @RabbitListener annotated endpoints as well as all `SimpleMessageListenerContainer`s on the application context.

As messages are usually sent to exchanges in AMQP the message contract contains the exchange name as the destination. -Message listeners on the other side are bound to queues. Bindings connect an exchange to a queue. -If message contracts are triggered the Spring AMQP stub runner integration will look for bindings on the application context that match this exchange. -Then it collects the queues from the Spring exchanges and tries to find messages listeners bound to these queues. -The message is triggered to all matching message listeners.

2.16.1 Adding it to the project

It’s enough to have both Spring AMQP and Spring Cloud Contract Stub Runner on the classpath and set the property stubrunner.amqp.enabled=true. -Remember to annotate your test class with @AutoConfigureStubRunner.

2.16.2 Examples

Stubs structure

Let us assume that we have the following Maven repository with a deployed stubs for the -spring-cloud-contract-amqp-test application.

└── .m2
-    └── repository
-        └── com
-            └── example
-                └── spring-cloud-contract-amqp-test
-                    ├── 0.4.0-SNAPSHOT
-                    │   ├── spring-cloud-contract-amqp-test-0.4.0-SNAPSHOT.pom
-                    │   ├── spring-cloud-contract-amqp-test-0.4.0-SNAPSHOT-stubs.jar
-                    │   └── maven-metadata-local.xml
-                    └── maven-metadata-local.xml

And the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── contracts
-    └── shouldProduceValidPersonData.groovy

Let’s consider the following contract:

Contract.make {
-    // Human readable description
-    description 'Should produce valid person data'
-    // Label by means of which the output message can be triggered
-    label 'contract-test.person.created.event'
-    // input to the contract
-    input {
-        // the contract will be triggered by a method
-        triggeredBy('createPerson()')
-    }
-    // output message of the contract
-    outputMessage {
-        // destination to which the output message will be sent
-        sentTo 'contract-test.exchange'
-        headers {
-            header('contentType': 'application/json')
-            header('__TypeId__': 'org.springframework.cloud.contract.stubrunner.messaging.amqp.Person')
-        }
-        // the body of the output message
-        body ([
-                id: $(consumer(9), producer(regex("[0-9]+"))),
-                name: "me"
-        ])
-    }
-}

and the following Spring configuration:

stubrunner:
-  repositoryRoot: classpath:m2repo/repository/
-  ids: org.springframework.cloud.contract.verifier.stubs.amqp:spring-cloud-contract-amqp-test:0.4.0-SNAPSHOT:stubs
-  amqp:
-    enabled: true
-server:
-  port: 0

Triggering the message

So to trigger a message using the contract above we’ll use the StubTrigger interface as follows.

stubTrigger.trigger("contract-test.person.created.event")

The message has the destination contract-test.exchange so the Spring AMQP stub runner integration looks for bindings related to this exchange.

@Bean
-public Binding binding() {
-	return BindingBuilder.bind(new Queue("test.queue")).to(new DirectExchange("contract-test.exchange")).with("#");
-}

The binding definition binds the queue test.queue. -So the following listener definition is a match and is invoked with the contract message.

@Bean
-public SimpleMessageListenerContainer simpleMessageListenerContainer(ConnectionFactory connectionFactory,
-																		MessageListenerAdapter listenerAdapter) {
-	SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
-	container.setConnectionFactory(connectionFactory);
-	container.setQueueNames("test.queue");
-	container.setMessageListener(listenerAdapter);
-
-	return container;
-}

Also, the following annotated listener represents a match and would be invoked.

@RabbitListener(bindings = @QueueBinding(
-		value = @Queue(value = "test.queue"),
-		exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true")))
-public void handlePerson(Person person) {
-	this.person = person;
-}
[Note]Note

The message is directly handed over to the onMessage method of the MessageListener associated with the matching SimpleMessageListenerContainer.

Spring AMQP Test Configuration

In order to avoid that Spring AMQP is trying to connect to a running broker during our tests we configure a mock ConnectionFactory.

To disable the mocked ConnectionFactory set the property stubrunner.amqp.mockConnection=false

stubrunner:
-  amqp:
-    mockConnection: false

2.17 Contract DSL

[Important]Important

Remember that inside the contract file you have to provide the fully qualified name to -the Contract class and the make static import i.e. org.springframework.cloud.spec.Contract.make { …​ }. -You can also provide an import to the Contract class import org.springframework.cloud.spec.Contract and then call - Contract.make { …​ }

Contract DSL is written in Groovy, but don’t be alarmed if you didn’t use Groovy before. Knowledge of the language is not really needed as our DSL uses only -a tiny subset of it (namely literals, method calls and closures). What’s more the DSL is designed to be programmer-readable without any knowledge of the DSL itself - - it’s statically typed.

[Tip]Tip

Spring Cloud Contract supports defining multiple contracts in a single file!

The Contract is present in the spring-cloud-contract-spec module of the Spring Cloud Contract Verifier repository.

Let’s look at full example of a contract definition.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url '/api/12'
-		headers {
-			header 'Content-Type': 'application/vnd.org.springframework.cloud.contract.verifier.twitter-places-analyzer.v1+json'
-		}
-		body '''\
-		[{
-			"created_at": "Sat Jul 26 09:38:57 +0000 2014",
-			"id": 492967299297845248,
-			"id_str": "492967299297845248",
-			"text": "Gonna see you at Warsaw",
-			"place":
-			{
-				"attributes":{},
-				"bounding_box":
-				{
-					"coordinates":
-						[[
-							[-77.119759,38.791645],
-							[-76.909393,38.791645],
-							[-76.909393,38.995548],
-							[-77.119759,38.995548]
-						]],
-					"type":"Polygon"
-				},
-				"country":"United States",
-				"country_code":"US",
-				"full_name":"Washington, DC",
-				"id":"01fbe706f872cb32",
-				"name":"Washington",
-				"place_type":"city",
-				"url": "https://api.twitter.com/1/geo/id/01fbe706f872cb32.json"
-			}
-		}]
-	'''
-	}
-	response {
-		status 200
-	}
-}

Not all features of the DSL are used in example above. If you didn’t find what you are looking for, please check next paragraphs on this page.

You can easily compile Contracts to WireMock stubs mapping using standalone maven command: mvn org.springframework.cloud:spring-cloud-contract-maven-plugin:convert.

2.17.1 Limitations

[Warning]Warning

Spring Cloud Contract Verifier doesn’t support XML properly. Please use JSON or help us implement this feature.

[Warning]Warning

The support for the verification of size of JSON arrays is experimental. If you want to turn it on please provide -the value of a system property spring.cloud.contract.verifier.assert.size equal to true. By default this feature is set to -false. You can also provide the assertJsonSize property in the plugin configuration.

[Warning]Warning

Due to the fact that JSON structure can have any form it’s sometimes impossible to parse it properly when using -the value(consumer(…​), producer(…​)) notation when using that in GString. That’s why we highly recommend using the -Groovy Map notation.

2.17.2 Common Top-Level elements

Description

You can add a description to your contract that is nothing else but an arbitrary text. Example:

		org.springframework.cloud.contract.spec.Contract.make {
-			description('''
-given:
-	An input
-when:
-	Sth happens
-then:
-	Output
-''')
-		}

Name

You can provide a name of your contract. Let’s assume that you’ve provided a name should register a user. -If you do this then the name of the autogenerated test will be equal to validate_should_register_a_user. -Also the name of the stub will be should_register_a_user.json in case of a WireMock stub.

[Important]Important

Please ensure that the name doesn’t contain any characters that will make the generated test - not possible to compile. Also remember that if you provide the same name for multiple contracts then your - autogenerated tests will fail to compile and your generated stubs will override each other.

Ignoring contracts

If you want to ignore a contract you can either set a value of ignored contracts in the plugin configuration -or just set the ignored property on the contract itself:

org.springframework.cloud.contract.spec.Contract.make {
-	ignored()
-}

Passing values from files

Starting with version 1.2.0 it’s possible to pass values from files. Let’s assume that we have -the following resources in our project.

└── src
-    └── test
-        └── resources
-            └── contracts
-                ├── readFromFile.groovy
-                ├── request.json
-                └── response.json

And our contract looks like this:

import org.springframework.cloud.contract.spec.Contract
-
-Contract.make {
-	request {
-		method('PUT')
-		headers {
-			contentType(applicationJson())
-		}
-		body(file("request.json"))
-		url("/1")
-	}
-	response {
-		status 200
-		body(file("response.json"))
-		headers {
-			contentType(textPlain())
-		}
-	}
-}

and the json files look like this:

request.json

{ "status" : "REQUEST" }

response.json

{ "status" : "RESPONSE" }

When test / stub generation takes place then the contents of the file will be -passed to the body of request / response. All thanks to the file(…​) method. -The argument of that method needs to be a file with location relative to the -folder in which the contract lays.

2.17.3 HTTP Top-Level Elements

Following methods can be called in the top-level closure of a contract definition. Request and response are mandatory, priority is optional.

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).
-	request {
-		//...
-	}
-
-	// Definition of HTTP response part of the contract
-	// (a service implementing this contract should respond
-	// with following response after receiving request
-	// specified in "request" part above).
-	response {
-		//...
-	}
-
-	// Contract priority, which can be used for overriding
-	// contracts (1 is highest). Priority is optional.
-	priority 1
-}

2.17.4 Request

HTTP protocol requires only method and address to be specified in a request. The same information is mandatory in request definition of the Contract.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		// HTTP request method (GET/POST/PUT/DELETE).
-		method 'GET'
-
-		// Path component of request URL is specified as follows.
-		urlPath('/users')
-	}
-
-	response {
-		//...
-	}
-}

It is possible to specify whole url instead of just path, but urlPath is the recommended way as it makes the tests host-independent.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'GET'
-
-		// Specifying `url` and `urlPath` in one contract is illegal.
-		url('http://localhost:8888/users')
-	}
-
-	response {
-		//...
-	}
-}

Request may contain query parameters, which are specified in a closure nested in a call to urlPath or url.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-
-		urlPath('/users') {
-
-			// Each parameter is specified in form
-			// `'paramName' : paramValue` where parameter value
-			// may be a simple literal or one of matcher functions,
-			// all of which are used in this example.
-			queryParameters {
-
-				// If a simple literal is used as value
-				// default matcher function is used (equalTo)
-				parameter 'limit': 100
-
-				// `equalTo` function simply compares passed value
-				// using identity operator (==).
-				parameter 'filter': equalTo("email")
-
-				// `containing` function matches strings
-				// that contains passed substring.
-				parameter 'gender': value(consumer(containing("[mf]")), producer('mf'))
-
-				// `matching` function tests parameter
-				// against passed regular expression.
-				parameter 'offset': value(consumer(matching("[0-9]+")), producer(123))
-
-				// `notMatching` functions tests if parameter
-				// does not match passed regular expression.
-				parameter 'loginStartsWith': value(consumer(notMatching(".{0,2}")), producer(3))
-			}
-		}
-
-		//...
-	}
-
-	response {
-		//...
-	}
-}

It may contain additional request headers…​

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-
-		// Each header is added in form `'Header-Name' : 'Header-Value'`.
-		// there are also some helper methods
-		headers {
-			header 'key': 'value'
-			contentType(applicationJson())
-		}
-
-		//...
-	}
-
-	response {
-		//...
-	}
-}

…​and a request body.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-
-		// Currently only JSON format of request body is supported.
-		// Format will be determined from a header or body's content.
-		body '''{ "login" : "john", "name": "John The Contract" }'''
-	}
-
-	response {
-		//...
-	}
-}

Request may contain multipart elements. Just call the multipart() method.

org.springframework.cloud.contract.spec.Contract contractDsl = org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method "PUT"
-		url "/multipart"
-		headers {
-			contentType('multipart/form-data;boundary=AaB03x')
-		}
-		multipart(
-				// key (parameter name), value (parameter value) pair
-				formParameter: $(c(regex('".+"')), p('"formParameterValue"')),
-				someBooleanParameter: $(c(regex(anyBoolean())), p('true')),
-				// a named parameter (e.g. with `file` name) that represents file with
-				// `name` and `content`. You can also call `named("fileName", "fileContent")`
-				file: named(
-						// name of the file
-						name: $(c(regex(nonEmpty())), p('filename.csv')),
-						// content of the file
-						content: $(c(regex(nonEmpty())), p('file content')))
-		)
-	}
-	response {
-		status 200
-	}
-}

In this example we defined parameters either directly by using the map notation, -where the value can be a dynamic property (e.g. formParameter: $(consumer(…​), producer(…​))) - or by using the named(…​) method that allows you to set a named parameter. - A named parameter can set a name and content. You can call it either via - a method with 2 arguments: e.g. named("fileName", "fileContent") or - via a map notation named(name: "fileName", content: "fileContent").

From this contract the generated test will look more or less like this:

// given:
- MockMvcRequestSpecification request = given()
-   .header("Content-Type", "multipart/form-data;boundary=AaB03x")
-   .param("formParameter", "\"formParameterValue\"")
-   .param("someBooleanParameter", "true")
-   .multiPart("file", "filename.csv", "file content".getBytes());
-
-// when:
- ResponseOptions response = given().spec(request)
-   .put("/multipart");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);

The WireMock stub will look more or less like this:

			'''
-{
-  "request" : {
-	"url" : "/multipart",
-	"method" : "PUT",
-	"headers" : {
-	  "Content-Type" : {
-		"matches" : "multipart/form-data;boundary=AaB03x.*"
-	  }
-	},
-	"bodyPatterns" : [ {
-		"matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"formParameter\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n\\".+\\"\\r\\n--\\\\1.*"
-  		}, {
-    			"matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"someBooleanParameter\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n(true|false)\\r\\n--\\\\1.*"
-  		}, {
-	  "matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"file\\"; filename=\\".+\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n.+\\r\\n--\\\\1.*"
-	} ]
-  },
-  "response" : {
-	"status" : 200,
-	"transformers" : [ "response-template" ]
-  }
-}
-	'''

2.17.5 Response

Minimal response must contain HTTP status code.

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-	}
-	response {
-		// Status code sent by the server
-		// in response to request specified above.
-		status 200
-	}
-}

Besides status response may contain headers and body, which are specified the same way as in the request (see previous paragraph).

2.17.6 Dynamic properties

The contract can contain some dynamic properties - timestamps / ids etc. You don’t want to enforce the consumers to stub their -clocks to always return the same value of time so that it gets matched by the stub. That’s why we allow you to provide the dynamic -parts in your contracts in two ways. One is to pass them directly in the -body and one to set them in a separate section called testMatchers and stubMatchers.

Dynamic properties inside the body

You can set the properties inside the body either via the value method

value(consumer(...), producer(...))
-value(c(...), p(...))
-value(stub(...), test(...))
-value(client(...), server(...))

or if you’re using the Groovy map notation for body you can use the $() method

$(consumer(...), producer(...))
-$(c(...), p(...))
-$(stub(...), test(...))
-$(client(...), server(...))

All of the aforementioned approaches are equal. That means that stub and client methods are aliases over the consumer -method. Let’s take a closer look at what we can do with those values in the subsequent sections.

Regular expressions

You can use regular expressions to write your requests in Contract DSL. It is particularly useful when you want to indicate that a given response -should be provided for requests that follow a given pattern. Also, you can use it when you need to use patterns and not exact values both -for your test and your server side tests.

Please see the example below:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method('GET')
-		url $(consumer(~/\/[0-9]{2}/), producer('/12'))
-	}
-	response {
-		status 200
-		body(
-				id: $(anyNumber()),
-				surname: $(
-						consumer('Kowalsky'),
-						producer(regex('[a-zA-Z]+'))
-				),
-				name: 'Jan',
-				created: $(consumer('2014-02-02 12:23:43'), producer(execute('currentDate(it)'))),
-				correlationId: value(consumer('5d1f9fef-e0dc-4f3d-a7e4-72d2220dd827'),
-						producer(regex('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}'))
-				)
-		)
-		headers {
-			header 'Content-Type': 'text/plain'
-		}
-	}
-}

You can also provide only one side of the communication using a regular expression. If you do that then automatically we’ll -provide the generated string that matches the provided regular expression. For example:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url value(consumer(regex('/foo/[0-9]{5}')))
-		body([
-			requestElement: $(consumer(regex('[0-9]{5}')))
-		])
-		headers {
-			header('header', $(consumer(regex('application\\/vnd\\.fraud\\.v1\\+json;.*'))))
-		}
-	}
-	response {
-		status 200
-		body([
-			responseElement: $(producer(regex('[0-9]{7}')))
-		])
-		headers {
-			contentType("application/vnd.fraud.v1+json")
-		}
-	}
-}

In this example for request and response the opposite side of the communication will have the respective data generated.

Spring Cloud Contract comes with a series of predefined regular expressions that you can use in your contracts.

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])')
-protected static final Pattern HOSTNAME_PATTERN = Pattern.compile('((http[s]?|ftp):/)/?([^:/\\s]+)(:[0-9]{1,5})?')
-protected static final Pattern EMAIL = Pattern.compile('[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}')
-protected static final Pattern URL = UrlHelper.URL
-protected static final Pattern UUID = Pattern.compile('[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}')
-protected static final Pattern ANY_DATE = Pattern.compile('(\\d\\d\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])')
-protected static final Pattern ANY_DATE_TIME = Pattern.compile('([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])')
-protected static final Pattern ANY_TIME = Pattern.compile('(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])')
-protected static final Pattern NON_EMPTY = Pattern.compile(/.+/)
-protected static final Pattern NON_BLANK = Pattern.compile(/.*(\S+|\R).*|!^\R*$/)
-protected static final Pattern ISO8601_WITH_OFFSET = Pattern.compile(/([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.\d{3})?(Z|[+-][01]\d:[0-5]\d)/)
-
-protected static Pattern anyOf(String... values){
-	return Pattern.compile(values.collect({"^$it\$"}).join("|"))
-}
-
-String onlyAlphaUnicode() {
-	return ONLY_ALPHA_UNICODE.pattern()
-}
-
-String number() {
-	return NUMBER.pattern()
-}
-
-String anyBoolean() {
-	return TRUE_OR_FALSE.pattern()
-}
-
-String ipAddress() {
-	return IP_ADDRESS.pattern()
-}
-
-String hostname() {
-	return HOSTNAME_PATTERN.pattern()
-}
-
-String email() {
-	return EMAIL.pattern()
-}
-
-String url() {
-	return URL.pattern()
-}
-
-String uuid(){
-	return UUID.pattern()
-}
-
-String isoDate() {
-	return ANY_DATE.pattern()
-}
-
-String isoDateTime() {
-	return ANY_DATE_TIME.pattern()
-}
-
-String isoTime() {
-	return ANY_TIME.pattern()
-}
-
-String iso8601WithOffset() {
-	return ISO8601_WITH_OFFSET.pattern()
-}
-
-String nonEmpty() {
-	return NON_EMPTY.pattern()
-}
-
-String nonBlank() {
-	return NON_BLANK.pattern()
-}

so in your contract you can use it like this

Contract dslWithOptionalsInString = Contract.make {
-	priority 1
-	request {
-		method POST()
-		url '/users/password'
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
-				callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
-		)
-	}
-	response {
-		status 404
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				code: value(consumer("123123"), producer(optional("123123"))),
-				message: "User not found by email = [${value(producer(regex(email())), consumer('not.existing@user.com'))}]"
-		)
-	}
-}
Passing optional parameters

It is possible to provide optional parameters in your contract. It’s only possible to have optional parameter for the:

  • STUB side of the Request
  • TEST side of the Response

Example:

org.springframework.cloud.contract.spec.Contract.make {
-	priority 1
-	request {
-		method 'POST'
-		url '/users/password'
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
-				callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
-		)
-	}
-	response {
-		status 404
-		headers {
-			header 'Content-Type': 'application/json'
-		}
-		body(
-				code: value(consumer("123123"), producer(optional("123123")))
-		)
-	}
-}

By wrapping a part of the body with the optional() method you are in fact creating a regular expression that should be present 0 or more times.

That way for the example above the following test would be generated if you pick Spock:

"""
- given:
-  def request = given()
-    .header("Content-Type", "application/json")
-    .body('''{"email":"abc@abc.com","callback_url":"http://partners.com"}''')
-
- when:
-  def response = given().spec(request)
-    .post("/users/password")
-
- then:
-  response.statusCode == 404
-  response.header('Content-Type')  == 'application/json'
- and:
-  DocumentContext parsedJson = JsonPath.parse(response.body.asString())
-  assertThatJson(parsedJson).field("['code']").matches("(123123)?")
-"""

and the following stub:

'''
-{
-  "request" : {
-    "url" : "/users/password",
-    "method" : "POST",
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.['email'] =~ /([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,6})?/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['callback_url'] =~ /((http[s]?|ftp):\\\\/)\\\\/?([^:\\\\/\\\\s]+)(:[0-9]{1,5})?/)]"
-    } ],
-    "headers" : {
-      "Content-Type" : {
-        "equalTo" : "application/json"
-      }
-    }
-  },
-  "response" : {
-    "status" : 404,
-    "body" : "{\\"code\\":\\"123123\\",\\"message\\":\\"User not found by email == [not.existing@user.com]\\"}",
-    "headers" : {
-      "Content-Type" : "application/json"
-    }
-  },
-  "priority" : 1
-}
-'''
Executing custom methods on server side

It is also possible to define a method call to be executed on the server side during the test. Such a method can be added to the class defined as "baseClassForTests" -in the configuration. Example:

Contract

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url $(consumer(regex('^/api/[0-9]{2}$')), producer('/api/12'))
-		headers {
-			header 'Content-Type': 'application/json'
-		}
-		body '''\
-				[{
-					"text": "Gonna see you at Warsaw"
-				}]
-			'''
-	}
-	response {
-		body (
-				path: $(consumer('/api/12'), producer(regex('^/api/[0-9]{2}$'))),
-				correlationId: $(consumer('1223456'), producer(execute('isProperCorrelationId($it)')))
-		)
-		status 200
-	}
-}

Base class

abstract class BaseMockMvcSpec extends Specification {
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new PairIdController())
-	}
-
-	void isProperCorrelationId(Integer correlationId) {
-		assert correlationId == 123456
-	}
-
-	void isEmpty(String value) {
-		assert value == null
-	}
-
-}
[Important]Important

You can’t use both a String and execute to perform concatenation. E.g. calling -header('Authorization', 'Bearer ' + execute('authToken()')) will lead to improper results. -To make this work just call header('Authorization', execute('authToken()')) and ensure that -the authToken() method returns everything that you need.

The type of the object read from the JSON can be one of the followings depending on the -JSON path:

  • String if you point to a String value in a JSON
  • JSONArray if you point to a List in a JSON
  • Map if you point to a Map in a JSON
  • proper Number if you point to Integer, Double etc. in a JSON
  • Boolean if you point to a Boolean in a JSON

In the request part of the contract you can specify that the body should be -taken from a method.

[Important]Important

You have to provide both the consumer and the producer side -and the execute part can be applied for the whole body. Not for parts of it!

Example:

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		url '/something'
-		body(
-				$(c("foo"), p(execute("hashCode()")))
-		)
-	}
-	response {
-		status 200
-	}
-}

This will result in calling the hashCode() method in the request body. -It would more or less like this:

// given:
- MockMvcRequestSpecification request = given()
-   .body(hashCode());
-
-// when:
- ResponseOptions response = given().spec(request)
-   .get("/something");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);

Referencing request from response

The best situation is to provide fixed values but sometimes you need to reference a request in your response. -In order to do this you can profit from the fromRequest() method that allows you to reference a bunch -of elements from the HTTP request. You can use the following options:

  • fromRequest().url() - return the request URL
  • fromRequest().query(String key) - return the first query parameter with a given name
  • fromRequest().query(String key, int index) - return the nth query parameter with a given name
  • fromRequest().header(String key) - return the first header with a given name
  • fromRequest().header(String key, int index) - return the nth header with a given name
  • fromRequest().body() - return the full request body
  • fromRequest().body(String jsonPath) - return the element from the request that matches the JSON Path

Let’s take a look at the following contract

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		url('/api/v1/xxxx') {
-			queryParameters {
-				parameter("foo", "bar")
-				parameter("foo", "bar2")
-			}
-		}
-		headers {
-			header(authorization(), "secret")
-			header(authorization(), "secret2")
-		}
-		body(foo: "bar", baz: 5)
-	}
-	response {
-		status 200
-		headers {
-			header(authorization(), "foo ${fromRequest().header(authorization())} bar")
-		}
-		body(
-				url: fromRequest().url(),
-				param: fromRequest().query("foo"),
-				paramIndex: fromRequest().query("foo", 1),
-				authorization: fromRequest().header("Authorization"),
-				authorization2: fromRequest().header("Authorization", 1),
-				fullBody: fromRequest().body(),
-				responseFoo: fromRequest().body('$.foo'),
-				responseBaz: fromRequest().body('$.baz'),
-				responseBaz2: "Bla bla ${fromRequest().body('$.foo')} bla bla"
-		)
-	}
-}

Running a JUnit test generation will lead in creation of a test looking more or less like this

// given:
- MockMvcRequestSpecification request = given()
-   .header("Authorization", "secret")
-   .header("Authorization", "secret2")
-   .body("{\"foo\":\"bar\",\"baz\":5}");
-
-// when:
- ResponseOptions response = given().spec(request)
-   .queryParam("foo","bar")
-   .queryParam("foo","bar2")
-   .get("/api/v1/xxxx");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Authorization")).isEqualTo("foo secret bar");
-// and:
- DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
- assertThatJson(parsedJson).field("url").isEqualTo("/api/v1/xxxx");
- assertThatJson(parsedJson).field("fullBody").isEqualTo("{\"foo\":\"bar\",\"baz\":5}");
- assertThatJson(parsedJson).field("paramIndex").isEqualTo("bar2");
- assertThatJson(parsedJson).field("responseFoo").isEqualTo("bar");
- assertThatJson(parsedJson).field("authorization2").isEqualTo("secret2");
- assertThatJson(parsedJson).field("responseBaz").isEqualTo(5);
- assertThatJson(parsedJson).field("responseBaz2").isEqualTo("Bla bla bar bla bla");
- assertThatJson(parsedJson).field("param").isEqualTo("bar");
- assertThatJson(parsedJson).field("authorization").isEqualTo("secret");

As you can see elements from the request have been properly referenced in the response.

The generated WireMock stub will look more or less like this:

{
-  "request" : {
-    "urlPath" : "/api/v1/xxxx",
-    "method" : "POST",
-    "headers" : {
-      "Authorization" : {
-        "equalTo" : "secret2"
-      }
-    },
-    "queryParameters" : {
-      "foo" : {
-        "equalTo" : "bar2"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.baz == 5)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.foo == 'bar')]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\"url\":\"{{{request.url}}}\",\"param\":\"{{{request.query.foo.[0]}}}\",\"paramIndex\":\"{{{request.query.foo.[1]}}}\",\"authorization\":\"{{{request.headers.Authorization.[0]}}}\",\"authorization2\":\"{{{request.headers.Authorization.[1]}}}\",\"fullBody\":\"{{{escapejsonbody}}}\",\"responseFoo\":\"{{{jsonpath this '$.foo'}}}\",\"responseBaz\":{{{jsonpath this '$.baz'}}} ,\"responseBaz2\":\"Bla bla {{{jsonpath this '$.foo'}}} bla bla\"}",
-    "headers" : {
-      "Authorization" : "{{{request.headers.Authorization.[0]}}}"
-    },
-    "transformers" : [ "response-template" ]
-  }
-}

So sending a request as the one presented in the request part of the contract will lead in sending the following -response body

{
-  "url" : "/api/v1/xxxx?foo=bar&foo=bar2",
-  "param" : "bar",
-  "paramIndex" : "bar2",
-  "authorization" : "secret",
-  "authorization2" : "secret2",
-  "fullBody" : "{\"foo\":\"bar\",\"baz\":5}",
-  "responseFoo" : "bar",
-  "responseBaz" : 5,
-  "responseBaz2" : "Bla bla bar bla bla"
-}
[Important]Important

This feature will work only with WireMock having version greater or equal to 2.5.1. We’re using WireMock’s -response-template response transformer. It’s using Handlebars to convert the Mustache {{{ }}} templates into -proper values. Additionally we’re registering 2 helper functions. escapejsonbody - that escapes the request -body in a format that can be embedded in a JSON. Another is jsonpath that for a given parameter knows how to -find an object in the request body.

Dynamic properties in matchers sections

If you’ve been working with Pact this might seem familiar. Quite a few users -are used to having a separation between the body and setting dynamic parts of your contract.

That’s why you can profit from two separate sections. One is called stubMatchers where you can -define the dynamic values that should end up in a stub. You can set it in the request or inputMessage -part of your contract. The other is called testMatchers which is present in the response or -outputMessage side of the contract.

Currently we support only JSON Path based matchers with the following matching possibilities. -For stubMatchers:

  • byEquality() - the value taken from the response via the provided JSON Path needs -to be equal to the provided value in the contract
  • byRegex(…​) - the value taken from the response via the provided JSON Path needs -to match the regex
  • byDate() - the value taken from the response via the provided JSON Path needs to -match the regex for ISO Date
  • byTimestamp() - the value taken from the response via the provided JSON Path needs -to match the regex for ISO DateTime
  • byTime() - the value taken from the response via the provided JSON Path needs to -match the regex for ISO Time

For testMatchers:

  • byEquality() - the value taken from the response via the provided JSON Path needs -to be equal to the provided value in the contract
  • byRegex(…​) - the value taken from the response via the provided JSON Path needs -to match the regex
  • byDate() - the value taken from the response via the provided JSON Path needs to -match the regex for ISO Date
  • byTimestamp() - the value taken from the response via the provided JSON Path needs -to match the regex for ISO DateTime
  • byTime() - the value taken from the response via the provided JSON Path needs to -match the regex for ISO Time
  • byType() - the value taken from the response via the provided JSON Path needs to -be of the same type as the type defined in the body of the response in the contract. -byType can take a closure where you can set minOccurrence and maxOccurrence. -That way you can assert on the size of the flattened collection. To check the size -of an unflattened collection, use a custom method via byCommand(…​) testMatcher.
  • byCommand(…​) - the value taken from the response via the provided JSON Path will be -passed as an input to the custom method that you’re providing. E.g. byCommand('foo($it)') -will result in calling a foo method to which the value matching the JSON Path will get - passed.

    • The type of the object read from the JSON can be one of the followings depending on the -JSON path:

      • String if you point to a String value in a JSON
      • JSONArray if you point to a List in a JSON
      • Map if you point to a Map in a JSON
      • proper Number if you point to Integer, Double etc. in a JSON
      • Boolean if you point to a Boolean in a JSON

Let’s take a look at the following example:

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		urlPath '/get'
-		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",
-				key: [
-						'complex.key' : 'foo'
-				]
-		])
-		stubMatchers {
-			jsonPath('$.duck', byRegex("[0-9]{3}"))
-			jsonPath('$.duck', byEquality())
-			jsonPath('$.alpha', byRegex(onlyAlphaUnicode()))
-			jsonPath('$.alpha', byEquality())
-			jsonPath('$.number', byRegex(number()))
-			jsonPath('$.aBoolean', byRegex(anyBoolean()))
-			jsonPath('$.date', byDate())
-			jsonPath('$.dateTime', byTimestamp())
-			jsonPath('$.time', byTime())
-			jsonPath("\$.['key'].['complex.key']", byEquality())
-		}
-		headers {
-			contentType(applicationJson())
-		}
-	}
-	response {
-		status 200
-		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",
-				valueWithMin: [
-					1,2,3
-				],
-				valueWithMax: [
-					1,2,3
-				],
-				valueWithMinMax: [
-					1,2,3
-				],
-				valueWithMinEmpty: [],
-				valueWithMaxEmpty: [],
-				key: [
-				        'complex.key' : 'foo'
-				]
-		])
-		testMatchers {
-			// asserts the jsonpath value against manual regex
-			jsonPath('$.duck', byRegex("[0-9]{3}"))
-			// asserts the jsonpath value against the provided value
-			jsonPath('$.duck', byEquality())
-			// asserts the jsonpath value against some default regex
-			jsonPath('$.alpha', byRegex(onlyAlphaUnicode()))
-			jsonPath('$.alpha', byEquality())
-			jsonPath('$.number', byRegex(number()))
-			jsonPath('$.aBoolean', byRegex(anyBoolean()))
-			// asserts vs inbuilt time related regex
-			jsonPath('$.date', byDate())
-			jsonPath('$.dateTime', byTimestamp())
-			jsonPath('$.time', byTime())
-			// asserts that the resulting type is the same as in response body
-			jsonPath('$.valueWithTypeMatch', byType())
-			jsonPath('$.valueWithMin', byType {
-				// results in verification of size of array (min 1)
-				minOccurrence(1)
-			})
-			jsonPath('$.valueWithMax', byType {
-				// results in verification of size of array (max 3)
-				maxOccurrence(3)
-			})
-			jsonPath('$.valueWithMinMax', byType {
-				// results in verification of size of array (min 1 & max 3)
-				minOccurrence(1)
-				maxOccurrence(3)
-			})
-			jsonPath('$.valueWithMinEmpty', byType {
-				// results in verification of size of array (min 0)
-				minOccurrence(0)
-			})
-			jsonPath('$.valueWithMaxEmpty', byType {
-				// results in verification of size of array (max 0)
-				maxOccurrence(0)
-			})
-			// will execute a method `assertThatValueIsANumber`
-			jsonPath('$.duck', byCommand('assertThatValueIsANumber($it)'))
-			jsonPath("\$.['key'].['complex.key']", byEquality())
-		}
-		headers {
-			contentType(applicationJson())
-		}
-	}
-}

In this example we’re providing the dynamic portions of the contract in the matchers sections. - For the request part you can see that for all fields but valueWithoutAMatcher we’re setting - explicitly the values of regular expressions we’d like the stub to contain. For the valueWithoutAMatcher - the verification will take place in the same way as without the usage of matchers - the test - will perform an equality check in this case.

For the response side in the testMatchers section we’re defining all the dynamic parts - in a similar manner. The only difference is that we have the byType matchers too. In that - case we’re checking 4 fields in the way that we’re verifying whether the response from the test - has a value whose JSON path matching the given field is of the same type as the one defined in the response body and:

  • for $.valueWithTypeMatch - we’re just checking the whether the type is the same
  • for $.valueWithMin - we’re checking the type and assert if the size is greater or equal to the min occurrence
  • for $.valueWithMax - we’re checking the type and assert if the size is smaller or equal to the max occurrence
  • for $.valueWithMinMax - we’re checking the type and assert if the size is between the min and max occurrence

The resulting test would look more or less like this (note that we’re separating the autogenerated -assertions and the one from matchers with an and section):

// 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\"}");
-
-// when:
- ResponseOptions response = given().spec(request)
-   .get("/get");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Content-Type")).matches("application/json.*");
-// and:
- DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
- assertThatJson(parsedJson).field("valueWithoutAMatcher").isEqualTo("foo");
-// and:
- assertThat(parsedJson.read("$.duck", String.class)).matches("[0-9]{3}");
- assertThat(parsedJson.read("$.duck", Integer.class)).isEqualTo(123);
- assertThat(parsedJson.read("$.alpha", String.class)).matches("[\\p{L}]*");
- assertThat(parsedJson.read("$.alpha", String.class)).isEqualTo("abc");
- assertThat(parsedJson.read("$.number", String.class)).matches("-?\\d*(\\.\\d+)?");
- assertThat(parsedJson.read("$.aBoolean", String.class)).matches("(true|false)");
- assertThat(parsedJson.read("$.date", String.class)).matches("(\\d\\d\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])");
- assertThat(parsedJson.read("$.dateTime", String.class)).matches("([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])");
- assertThat(parsedJson.read("$.time", String.class)).matches("(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])");
- assertThat((Object) parsedJson.read("$.valueWithTypeMatch")).isInstanceOf(java.lang.String.class);
- assertThat((Object) parsedJson.read("$.valueWithMin")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMin", java.util.Collection.class)).hasSizeGreaterThanOrEqualTo(1);
- assertThat((Object) parsedJson.read("$.valueWithMax")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMax", java.util.Collection.class)).hasSizeLessThanOrEqualTo(3);
- assertThat((Object) parsedJson.read("$.valueWithMinMax")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMinMax", java.util.Collection.class)).hasSizeBetween(1, 3);
- assertThat((Object) parsedJson.read("$.valueWithMinEmpty")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMinEmpty", java.util.Collection.class)).hasSizeGreaterThanOrEqualTo(0);
- assertThat((Object) parsedJson.read("$.valueWithMaxEmpty")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMaxEmpty", java.util.Collection.class)).hasSizeLessThanOrEqualTo(0);
- assertThatValueIsANumber(parsedJson.read("$.duck"));
[Important]Important

Notice that for the byCommand method we are calling the assertThatValueIsANumber. This method needs -to be defined in the test base class or should be statically imported to your tests. -Notice that the byCommand call was converted to assertThatValueIsANumber(parsedJson.read("$.duck"));. That means -that we took the method name and passed the proper JSON path as a parameter to it.

and the WireMock stub like this:

				'''
-{
-  "request" : {
-    "urlPath" : "/get",
-    "method" : "POST",
-    "headers" : {
-      "Content-Type" : {
-        "matches" : "application/json.*"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.['valueWithoutAMatcher'] == 'foo')]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['valueWithTypeMatch'] == 'string')]"
-    }, {
-      "matchesJsonPath" : "$.['list'].['some'].['nested'][?(@.['anothervalue'] == 4)]"
-    }, {
-      "matchesJsonPath" : "$.['list'].['someother'].['nested'][?(@.['anothervalue'] == 4)]"
-    }, {
-      "matchesJsonPath" : "$.['list'].['someother'].['nested'][?(@.['json'] == 'with value')]"
-    }, {
-      "matchesJsonPath" : "$[?(@.duck =~ /([0-9]{3})/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.duck == 123)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.alpha =~ /([\\\\p{L}]*)/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.alpha == 'abc')]"
-    }, {
-      "matchesJsonPath" : "$[?(@.number =~ /(-?\\\\d*(\\\\.\\\\d+)?)/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.aBoolean =~ /((true|false))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.date =~ /((\\\\d\\\\d\\\\d\\\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.dateTime =~ /(([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.time =~ /((2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]))/)]"
-    }, {
-      "matchesJsonPath" : "$.list.some.nested[?(@.json =~ /(.*)/)]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "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\\",\\"valueWithMin\\":[1,2,3],\\"valueWithMax\\":[1,2,3],\\"valueWithMinMax\\":[1,2,3]}",
-    "headers" : {
-      "Content-Type" : "application/json"
-    }
-  }
-}
-'''
[Important]Important

If you use a matcher then the part of the request / response that the matcher is addressing -via the JSON Path will get removed from assertion. In case of verifying a collection you have to create -matchers for all elements of the collection.

Let’s look at the following example:

Contract.make {
-    request {
-        method 'GET'
-        url("/foo")
-    }
-    response {
-        status 200
-        body(events: [[
-                                 operation          : 'EXPORT',
-                                 eventId            : '16f1ed75-0bcc-4f0d-a04d-3121798faf99',
-                                 status             : 'OK'
-                         ], [
-                                 operation          : 'INPUT_PROCESSING',
-                                 eventId            : '3bb4ac82-6652-462f-b6d1-75e424a0024a',
-                                 status             : 'OK'
-                         ]
-                ]
-        )
-        testMatchers {
-            jsonPath('$.events[0].operation', byRegex('.+'))
-            jsonPath('$.events[0].eventId', byRegex('^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})$'))
-            jsonPath('$.events[0].status', byRegex('.+'))
-        }
-    }
-}

This will lead in creating the following test (showing just the assertion section)

and:
-	DocumentContext parsedJson = JsonPath.parse(response.body.asString())
-	assertThatJson(parsedJson).array("['events']").contains("['eventId']").isEqualTo("16f1ed75-0bcc-4f0d-a04d-3121798faf99")
-	assertThatJson(parsedJson).array("['events']").contains("['operation']").isEqualTo("EXPORT")
-	assertThatJson(parsedJson).array("['events']").contains("['operation']").isEqualTo("INPUT_PROCESSING")
-	assertThatJson(parsedJson).array("['events']").contains("['eventId']").isEqualTo("3bb4ac82-6652-462f-b6d1-75e424a0024a")
-	assertThatJson(parsedJson).array("['events']").contains("['status']").isEqualTo("OK")
-and:
-	assertThat(parsedJson.read("\$.events[0].operation", String.class)).matches(".+")
-	assertThat(parsedJson.read("\$.events[0].eventId", String.class)).matches("^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})\$")
-	assertThat(parsedJson.read("\$.events[0].status", String.class)).matches(".+")

As you can see the assertion is malformed. That’s because only the first element of the array got asserted. -In order to fix this it’s best to apply the assertion to the whole $.events collection and assert it -via the byCommand(…​) method.

2.17.7 JAX-RS support

We support JAX-RS 2 Client API. Base class needs to define protected WebTarget webTarget and server initialization, right now the only option how to test JAX-RS API is to start a web server.

Request with a body needs to have a content type set otherwise application/octet-stream is going to be used.

In order to use JAX-RS mode, use the following settings:

testMode === 'JAXRSCLIENT'

Example of a test API generated:

'''
- // when:
-  Response response = webTarget
-    .path("/users")
-    .queryParam("limit", "10")
-    .queryParam("offset", "20")
-    .queryParam("filter", "email")
-    .queryParam("sort", "name")
-    .queryParam("search", "55")
-    .queryParam("age", "99")
-    .queryParam("name", "Denis.Stepanov")
-    .queryParam("email", "bob@email.com")
-    .request()
-    .method("GET");
-
-  String responseAsString = response.readEntity(String.class);
-
- // then:
-  assertThat(response.getStatus()).isEqualTo(200);
- // and:
-  DocumentContext parsedJson = JsonPath.parse(responseAsString);
-  assertThatJson(parsedJson).field("['property1']").isEqualTo("a");
-'''

2.17.8 Async support

If you’re using asynchronous communication on the server side (your controllers are returning -Callable, DeferredResult etc. then inside your contract you have to provide in the response -section a async() method. Example:

org.springframework.cloud.contract.spec.Contract.make {
-    request {
-        method GET()
-        url '/get'
-    }
-    response {
-        status 200
-        body 'Passed'
-        async()
-    }
-}

2.17.9 Working with Context Paths

Spring Cloud Contract supports context paths.

[Important]Important

The only thing that changes in order to fully support context paths is the switch -on the PRODUCER side. The autogenerated tests need to be using the EXPLICIT mode.

The consumer side remains untouched, in order for the generated test to pass you have to switch the EXPLICIT mode.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <testMode>EXPLICIT</testMode>
-    </configuration>
-</plugin>

-

Gradle.  -

contracts {
-		testMode = 'EXPLICIT'
-}

-

That way you’ll generate a test that DOES NOT use MockMvc. It means that you’re generating -real requests and you need to setup your generated test’s base class to work on a real socket.

Let’s imagine the following contract:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'GET'
-		url '/my-context-path/url'
-	}
-	response {
-		status 200
-	}
-}

Here is an example of how to set up a base class and Rest Assured for everything to work correctly.

import io.restassured.RestAssured;
-import org.junit.Before;
-import org.springframework.boot.context.embedded.LocalServerPort;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest(classes = ContextPathTestingBaseClass.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-class ContextPathTestingBaseClass {
-
-	@LocalServerPort int port;
-
-	@Before
-	public void setup() {
-		RestAssured.baseURI = "http://localhost";
-		RestAssured.port = this.port;
-	}
-}

That way all:

  • all your requests in the autogenerated tests will be sent to the real endpoint with your context path included (e.g. /my-context-path/url)
  • your contracts reflect that you have a context path, thus your generated stubs will also -have that information (e.g. in the stubs you’ll see that you have too call /my-context-path/url)

2.17.10 Messaging Top-Level Elements

The DSL for messaging looks a little bit different than the one that focuses on HTTP.

Output triggered by a method

The output message can be triggered by calling a method (e.g. a Scheduler was started and a message was sent)

def dsl = Contract.make {
-	// Human readable description
-	description 'Some description'
-	// Label by means of which the output message can be triggered
-	label 'some_label'
-	// input to the contract
-	input {
-		// the contract will be triggered by a method
-		triggeredBy('bookReturnedTriggered()')
-	}
-	// output message of the contract
-	outputMessage {
-		// destination to which the output message will be sent
-		sentTo('output')
-		// the body of the output message
-		body('''{ "bookName" : "foo" }''')
-		// the headers of the output message
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

In this case the output message will be sent to output if a method called bookReturnedTriggered will be executed. In the message publisher’s side -we will generate a test that will call that method to trigger the message. On the consumer side you can use the some_label to trigger the message.

Output triggered by a message

The output message can be triggered by receiving a message.

def dsl = Contract.make {
-	description 'Some Description'
-	label 'some_label'
-	// input is a message
-	input {
-		// the message was received from this destination
-		messageFrom('input')
-		// has the following body
-		messageBody([
-		        bookName: 'foo'
-		])
-		// and the following headers
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('output')
-		body([
-		        bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

In this case the output message will be sent to output if a proper message will be received on the input destination. In the message publisher’s side -we will generate a test that will send the input message to the defined destination. On the consumer side you can either send a message to the input -destination or use the some_label to trigger the message.

Consumer / Producer

In HTTP you have a notion of client/stub and `server/test notation. You can use them also in messaging but we’re providing also the consumer and produer methods -as presented below (note you can use either $ or value methods to provide consumer and producer parts)

Contract.make {
-	label 'some_label'
-	input {
-		messageFrom value(consumer('jms:output'), producer('jms:input'))
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo $(consumer('jms:input'), producer('jms:output'))
-		body([
-				bookName: 'foo'
-		])
-	}
-}

2.17.11 Multiple contracts in one file

It’s possible to define multiple contracts in one file. An example of such a contract can look like this

import org.springframework.cloud.contract.spec.Contract
-
-[
-        Contract.make {
-            name("should post a user")
-            request {
-                method 'POST'
-                url('/users/1')
-            }
-            response {
-                status 200
-            }
-        },
-        Contract.make {
-            request {
-                method 'POST'
-                url('/users/2')
-            }
-            response {
-                status 200
-            }
-        }
-]

In this example one contract has the name field and the other doesn’t. This will lead to generation of -two tests that will look more or less like this:

package org.springframework.cloud.contract.verifier.tests.com.hello;
-
-import com.example.TestBase;
-import com.jayway.jsonpath.DocumentContext;
-import com.jayway.jsonpath.JsonPath;
-import com.jayway.restassured.module.mockmvc.specification.MockMvcRequestSpecification;
-import com.jayway.restassured.response.ResponseOptions;
-import org.junit.Test;
-
-import static com.jayway.restassured.module.mockmvc.RestAssuredMockMvc.*;
-import static com.toomuchcoding.jsonassert.JsonAssertion.assertThatJson;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class V1Test extends TestBase {
-
-	@Test
-	public void validate_should_post_a_user() throws Exception {
-		// given:
-			MockMvcRequestSpecification request = given();
-
-		// when:
-			ResponseOptions response = given().spec(request)
-					.post("/users/1");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-	}
-
-	@Test
-	public void validate_withList_1() throws Exception {
-		// given:
-			MockMvcRequestSpecification request = given();
-
-		// when:
-			ResponseOptions response = given().spec(request)
-					.post("/users/2");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-	}
-
-}

Notice that for the contract that has the name field the generated test method is named -validate_should_post_a_user. For the one that doesn’t have the name it’s called -validate_withList_1. It corresponds to the name of the file WithList.groovy and the -index of the contract in the list.

The generated stubs will look like this

should post a user.json
-1_WithList.json

As you can see the first file got the name parameter from the contract. The second -got the name of the contract file WithList.groovy prefixed with the index (in this case -contract had index 1 in the list of contracts in the file).

[Tip]Tip

As you can see it’s much better if you name your contracts since then your tests - are far more meaningful.

2.18 Customization

2.18.1 Extending the DSL

It is possible to provide your own functions to the DSL. The key requirement for this -feature was to maintain the static compatibility. Below you will be able to see an example -of:

  • creation of a JAR with reusable classes
  • referencing of these classes in the DSLs

The full example can be found here.

Common JAR

Below you can find three classes that we will reuse in the DSLs.

PatternUtils contains functions used by both the consumer and the producer.

package com.example;
-
-import java.util.regex.Pattern;
-
-/**
- * If you want to use {@link Pattern} directly in your tests
- * then you can create a class resembling this one. It can
- * contain all the {@link Pattern} you want to use in the DSL.
- *
- * <pre>
- * {@code
- * request {
- *     body(
- *         [ age: $(c(PatternUtils.oldEnough()))]
- *     )
- * }
- * </pre>
- *
- * Notice that we're using both {@code $()} for dynamic values
- * and {@code c()} for the consumer side.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class PatternUtils {
-
-	public static String tooYoung() {
-		//remove::start[]
-		return "[0-1][0-9]";
-		//remove::end[return]
-	}
-
-	public static Pattern oldEnough() {
-		//remove::start[]
-		return Pattern.compile("[2-9][0-9]");
-		//remove::end[return]
-	}
-
-	/**
-	 * Makes little sense but it's just an example ;)
-	 */
-	public static Pattern ok() {
-		//remove::start[]
-		return Pattern.compile("OK");
-		//remove::end[return]
-	}
-}
-//end::impl[]

ConsumerUtils contains functions used by the consumer.

package com.example;
-
-import org.springframework.cloud.contract.spec.internal.ClientDslProperty;
-
-/**
- * DSL Properties passed to the DSL from the consumer's perspective.
- * That means that on the input side {@code Request} for HTTP
- * or {@code Input} for messaging you can have a regular expression.
- * On the {@code Response} for HTTP or {@code Output} for messaging
- * you have to have a concrete value.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class ConsumerUtils {
-	/**
-	 * Consumer side property. By using the {@link ClientDslProperty}
-	 * you can omit most of boilerplate code from the perspective
-	 * of dynamic values. Example
-	 *
-	 * <pre>
-	 * {@code
-	 * request {
-	 *     body(
-	 *         [ age: $(ConsumerUtils.oldEnough())]
-	 *     )
-	 * }
-	 * </pre>
-	 *
-	 * That way it's in the implementation that we decide what value we will pass to the consumer
-	 * and which one to the producer.
-	 *
-	 * @author Marcin Grzejszczak
-	 */
-	public static ClientDslProperty oldEnough() {
-		//remove::start[]
-		// this example is not the best one and
-		// theoretically you could just pass the regex instead of `ServerDslProperty` but
-		// it's just to show some new tricks :)
-		return new ClientDslProperty(PatternUtils.oldEnough(), 40);
-		//remove::end[return]
-	}
-
-}
-//end::impl[]

ProducerUtils contains functions used by the producer.

package com.example;
-
-import org.springframework.cloud.contract.spec.internal.ServerDslProperty;
-
-/**
- * DSL Properties passed to the DSL from the producer's perspective.
- * That means that on the input side {@code Request} for HTTP
- * or {@code Input} for messaging you have to have a concrete value.
- * On the {@code Response} for HTTP or {@code Output} for messaging
- * you can have a regular expression.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class ProducerUtils {
-
-	/**
-	 * Producer side property. By using the {@link ProducerUtils}
-	 * you can omit most of boilerplate code from the perspective
-	 * of dynamic values. Example
-	 *
-	 * <pre>
-	 * {@code
-	 * response {
-	 *     body(
-	 *         [ status: $(ProducerUtils.ok())]
-	 *     )
-	 * }
-	 * </pre>
-	 *
-	 * That way it's in the implementation that we decide what value we will pass to the consumer
-	 * and which one to the producer.
-	 */
-	public static ServerDslProperty ok() {
-		// this example is not the best one and
-		// theoretically you could just pass the regex instead of `ServerDslProperty` but
-		// it's just to show some new tricks :)
-		return new ServerDslProperty( PatternUtils.ok(), "OK");
-	}
-}
-//end::impl[]

Adding the dependency to project

In order for the plugins and IDE to be able to reference the common JAR classes you need -to pass the dependency to your project.

Test dependency in project’s dependencies

First add the common jar dependency as a test dependency. That way since your -contracts files are available at test resources path, automatically the -common jar classes will be visible in your Groovy files.

Maven.  -

<dependency>
-	<groupId>com.example</groupId>
-	<artifactId>beer-common</artifactId>
-	<version>${project.version}</version>
-	<scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile("com.example:beer-common:0.0.1-SNAPSHOT")

-

Test dependency in plugin’s dependencies

Now you have to add the dependency for the plugin to reuse at runtime.

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example</packageWithBaseClasses>
-		<baseClassMappings>
-			<baseClassMapping>
-				<contractPackageRegex>.*intoxication.*</contractPackageRegex>
-				<baseClassFQN>com.example.intoxication.BeerIntoxicationBase</baseClassFQN>
-			</baseClassMapping>
-		</baseClassMappings>
-	</configuration>
-	<dependencies>
-		<dependency>
-			<groupId>com.example</groupId>
-			<artifactId>beer-common</artifactId>
-			<version>${project.version}</version>
-			<scope>compile</scope>
-		</dependency>
-	</dependencies>
-</plugin>

-

Gradle.  -

classpath "com.example:beer-common:0.0.1-SNAPSHOT"

-

Referencing classes in DSLs

Now you can reference your classes in your DSL. Example:

package contracts.beer.rest
-
-import com.example.ConsumerUtils
-import com.example.ProducerUtils
-import org.springframework.cloud.contract.spec.Contract
-
-Contract.make {
-	description("""
-Represents a successful scenario of getting a beer
-
-```
-given:
-	client is old enough
-when:
-	he applies for a beer
-then:
-	we'll grant him the beer
-```
-
-""")
-	request {
-		method 'POST'
-		url '/check'
-		body(
-				age: $(ConsumerUtils.oldEnough())
-		)
-		headers {
-			contentType(applicationJson())
-		}
-	}
-	response {
-		status 200
-		body("""
-			{
-				"status": "${value(ProducerUtils.ok())}"
-			}
-			""")
-		headers {
-			contentType(applicationJson())
-		}
-	}
-}

2.19 Pluggable architecture

There are cases where you have your contracts defined in other formats -like YAML, RAML or PACT. On the other hand you’d like to profit from -the test and stubs generation. It’s really easy to add your own implementation -of either of those. Also you can customize the way tests are generated (for example you can generate -tests for other languages) and you can do the same for stubs generation (you can generate -stubs for other stub http server implementations).

2.19.1 Custom contract converter

Let’s assume that your contract is written in a YAML file like this:

request:
-  url: /foo
-  method: PUT
-  headers:
-    foo: bar
-  body:
-    foo: bar
-response:
-  status: 200
-  headers:
-    foo2: bar
-  body:
-    foo2: bar

Thanks to the interface

package org.springframework.cloud.contract.spec
-
-/**
- * Converter to be used to convert FROM {@link File} TO {@link Contract}
- * and from {@link Contract} to {@code T}
- *
- * @param <T> - type to which we want to convert the contract
- *
- * @author Marcin Grzejszczak
- * @since 1.1.0
- */
-interface ContractConverter<T> {
-
-	/**
-	 * Should this file be accepted by the converter. Can use the file extension
-	 * to check if the conversion is possible.
-	 *
-	 * @param file - file to be considered for conversion
-	 * @return - {@code true} if the given implementation can convert the file
-	 */
-	boolean isAccepted(File file)
-
-	/**
-	 * Converts the given {@link File} to its {@link Contract} representation
-	 *
-	 * @param file - file to convert
-	 * @return - {@link Contract} representation of the file
-	 */
-	Collection<Contract> convertFrom(File file)
-
-	/**
-	 * Converts the given {@link Contract} to a {@link T} representation
-	 *
-	 * @param contract - the parsed contract
-	 * @return - {@link T} the type to which we do the conversion
-	 */
-	T convertTo(Collection<Contract> contract)
-}

you can register your own implementation of a contract structure converter. -Your implementation needs to state the condition on which it should start the -conversion. Also you have to define how to perform that conversion in both ways.

[Important]Important

Once you create your implementation you have to create a /META-INF/spring.factories -file in which you provide the fully qualified name of your implementation.

Example of a spring.factories file

# Converters
-org.springframework.cloud.contract.spec.ContractConverter=\
-org.springframework.cloud.contract.verifier.converter.YamlContractConverter

and the YAML implementation

package org.springframework.cloud.contract.verifier.converter
-
-import java.nio.file.Files
-
-import groovy.transform.CompileStatic
-import org.springframework.cloud.contract.spec.Contract
-import org.springframework.cloud.contract.spec.ContractConverter
-import org.springframework.cloud.contract.spec.internal.Headers
-import org.yaml.snakeyaml.Yaml
-
-/**
- * Simple converter from and to a {@link YamlContract} to a collection of {@link Contract}
- */
-@CompileStatic
-class YamlContractConverter implements ContractConverter<List<YamlContract>> {
-
-	@Override
-	public boolean isAccepted(File file) {
-		String name = file.getName()
-		return name.endsWith(".yml") || name.endsWith(".yaml")
-	}
-
-	@Override
-	public Collection<Contract> convertFrom(File file) {
-		try {
-			YamlContract yamlContract = new Yaml().loadAs(
-					Files.newInputStream(file.toPath()), YamlContract.class)
-			return [Contract.make {
-				request {
-					method(yamlContract?.request?.method)
-					url(yamlContract?.request?.url)
-					headers {
-						yamlContract?.request?.headers?.each { String key, Object value ->
-							header(key, value)
-						}
-					}
-					body(yamlContract?.request?.body)
-				}
-				response {
-					status(yamlContract?.response?.status)
-					headers {
-						yamlContract?.response?.headers?.each { String key, Object value ->
-							header(key, value)
-						}
-					}
-					body(yamlContract?.response?.body)
-				}
-			}]
-		}
-		catch (FileNotFoundException e) {
-			throw new IllegalStateException(e)
-		}
-	}
-
-	@Override
-	public List<YamlContract> convertTo(Collection<Contract> contracts) {
-		return contracts.collect { Contract contract ->
-			YamlContract yamlContract = new YamlContract()
-			yamlContract.request.with {
-				method = contract?.request?.method?.clientValue
-				url = contract?.request?.url?.clientValue
-				headers = (contract?.request?.headers as Headers)?.asStubSideMap()
-				body = contract?.request?.body?.clientValue as Map
-			}
-			yamlContract.response.with {
-				status = contract?.response?.status?.clientValue as Integer
-				headers = (contract?.response?.headers as Headers)?.asStubSideMap()
-				body = contract?.response?.body?.clientValue as Map
-			}
-			return yamlContract
-		}
-	}
-}

Pact converter

Spring Cloud Contract comes with an out of the box support for Pact representation of contracts. -In other words instead of using the Groovy DSL you can use Pact files. In this section -we will present how to add such a support for your project.

Pact contract

We will be working on the following example of a Pact contract. We’ve placed this file under -the src/test/resources/contracts folder.

{
-  "provider": {
-    "name": "Provider"
-  },
-  "consumer": {
-    "name": "Consumer"
-  },
-  "interactions": [
-    {
-      "description": "",
-      "request": {
-        "method": "PUT",
-        "path": "/fraudcheck",
-        "headers": {
-          "Content-Type": "application/vnd.fraud.v1+json"
-        },
-        "body": {
-          "clientId": "1234567890",
-          "loanAmount": 99999
-        },
-        "matchingRules": {
-          "$.body.clientId": {
-            "match": "regex",
-            "regex": "[0-9]{10}"
-          }
-        }
-      },
-      "response": {
-        "status": 200,
-        "headers": {
-          "Content-Type": "application/vnd.fraud.v1+json;charset=UTF-8"
-        },
-        "body": {
-          "fraudCheckStatus": "FRAUD",
-          "rejectionReason": "Amount too high"
-        },
-        "matchingRules": {
-          "$.body.fraudCheckStatus": {
-            "match": "regex",
-            "regex": "FRAUD"
-          }
-        }
-      }
-    }
-  ],
-  "metadata": {
-    "pact-specification": {
-      "version": "2.0.0"
-    },
-    "pact-jvm": {
-      "version": "2.4.18"
-    }
-  }
-}
Pact for producers

On the producer side you have add to your plugin configuration two additional dependencies. -One is the Spring Cloud Contract Pact support and the other represents the current -Pact version that you’re using.

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-contract-spec-pact</artifactId>
-			<version>${spring-cloud-contract.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>au.com.dius</groupId>
-			<artifactId>pact-jvm-model</artifactId>
-			<version>2.4.18</version>
-		</dependency>
-	</dependencies>
-</plugin>

-

Gradle.  -

classpath "org.springframework.cloud:spring-cloud-contract-spec-pact:${findProperty('verifierVersion') ?: verifierVersion}"
-classpath 'au.com.dius:pact-jvm-model:2.4.18'

-

When you execute the build of your application a test, looking more or less like this, will be generated

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-	// given:
-		MockMvcRequestSpecification request = given()
-				.header("Content-Type", "application/vnd.fraud.v1+json")
-				.body("{\"clientId\":\"1234567890\",\"loanAmount\":99999}");
-
-	// when:
-		ResponseOptions response = given().spec(request)
-				.put("/fraudcheck");
-
-	// then:
-		assertThat(response.statusCode()).isEqualTo(200);
-		assertThat(response.header("Content-Type")).isEqualTo("application/vnd.fraud.v1+json;charset=UTF-8");
-	// and:
-		DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-		assertThatJson(parsedJson).field("rejectionReason").isEqualTo("Amount too high");
-	// and:
-		assertThat(parsedJson.read("$.fraudCheckStatus", String.class)).matches("FRAUD");
-}

and the stub looking like this

{
-  "uuid" : "996ae5ae-6834-4db6-8fac-358ca187ab62",
-  "request" : {
-    "url" : "/fraudcheck",
-    "method" : "PUT",
-    "headers" : {
-      "Content-Type" : {
-        "equalTo" : "application/vnd.fraud.v1+json"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.loanAmount == 99999)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.clientId =~ /([0-9]{10})/)]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\"fraudCheckStatus\":\"FRAUD\",\"rejectionReason\":\"Amount too high\"}",
-    "headers" : {
-      "Content-Type" : "application/vnd.fraud.v1+json;charset=UTF-8"
-    }
-  }
-}
Pact for consumers

On the producer side you have add to your project dependencies two additional dependencies. -One is the Spring Cloud Contract Pact support and the other represents the current -Pact version that you’re using.

Maven.  -

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-spec-pact</artifactId>
-	<scope>test</scope>
-</dependency>
-<dependency>
-	<groupId>au.com.dius</groupId>
-	<artifactId>pact-jvm-model</artifactId>
-	<version>2.4.18</version>
-	<scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-contract-spec-pact"
-testCompile 'au.com.dius:pact-jvm-model:2.4.18'

-

2.19.2 Custom test generator

If you want to generate tests for different languages than Java or you’re -not happy with the way we’re building Java tests for you then you can register -your own implementation to do that.

Thanks to the interface

package org.springframework.cloud.contract.verifier.builder
-
-import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties
-import org.springframework.cloud.contract.verifier.file.ContractMetadata
-/**
- * Builds a single test.
- *
- * @since 1.1.0
- */
-interface SingleTestGenerator {
-
-	/**
-	 * Creates contents of a single test class in which all test scenarios from
-	 * the contract metadata should be placed.
-	 *
-	 * @param properties - properties passed to the plugin
-	 * @param listOfFiles - list of parsed contracts with additional metadata
-	 * @param className - the name of the generated test class
-	 * @param classPackage - the name of the package in which the test class should be stored
-	 * @param includedDirectoryRelativePath - relative path to the included directory
-	 * @return contents of a single test class
-	 */
-	String buildClass(ContractVerifierConfigProperties properties, Collection<ContractMetadata> listOfFiles,
-					  String className, String classPackage, String includedDirectoryRelativePath)
-
-	/**
-	 * Extension that should be appended to the generated test class. E.g. {@code .java} or {@code .php}
-	 *
-	 * @param properties - properties passed to the plugin
-	 */
-	String fileExtension(ContractVerifierConfigProperties properties)
-}

you can register your own implementation that generates a test. Again, it’s enough to provide -a proper spring.factories file. Example:

org.springframework.cloud.contract.verifier.builder.SingleTestGenerator=/
-com.example.MyGenerator

2.19.3 Custom stub generator

If you want to generate stubs for other stub server than WireMock it’s enough to - plug in your own implementation of this interface:

package org.springframework.cloud.contract.verifier.converter
-
-import groovy.transform.CompileStatic
-import org.springframework.cloud.contract.spec.Contract
-import org.springframework.cloud.contract.verifier.file.ContractMetadata
-
-/**
- * Converts contracts into their stub representation.
- *
- * @since 1.1.0
- */
-@CompileStatic
-interface StubGenerator {
-
-	/**
-	 * Returns {@code true} if the converter can handle the file to convert it into a stub.
-	 */
-	boolean canHandleFileName(String fileName)
-
-	/**
-	 * Returns the collection of converted contracts into stubs. One contract can
-	 * result in multiple stubs.
-	 */
-	Map<Contract, String> convertContents(String rootName, ContractMetadata content)
-
-	/**
-	 * Returns the name of the converted stub file. If you have multiple contracts
-	 * in a single file then a prefix will be added to the generated file. If you
-	 * provide the {@link Contract#name} field then that field will override the
-	 * generated file name.
-	 *
-	 * Example: name of file with 2 contracts is {@code foo.groovy}, it will be
-	 * converted by the implementation to {@code foo.json}. The recursive file
-	 * converter will create two files {@code 0_foo.json} and {@code 1_foo.json}
-	 */
-	String generateOutputFileNameForInput(String inputFileName)
-}

you can register your own implementation that generate Stubs. Again, it’s enough to provide -a proper spring.factories file. Example:

# Stub converters
-org.springframework.cloud.contract.verifier.converter.StubGenerator=\
-org.springframework.cloud.contract.verifier.wiremock.DslToWireMockClientConverter

The default implementation is the WireMock stub generation.

[Tip]Tip

You can provide multiple stub generator implementations. That way for example from a single -DSL as input you can e.g. produce WireMock stubs and Pact files too!

2.19.4 Custom Stub Runner

If you decide to have a custom stub generation you also need a custom way of running -stubs with your different stub provider.

Let us assume that you’re using Moco to build your stubs. -You wrote a proper stub generator and your stubs got placed in a JAR file.

In order for Stub Runner to know how to run your stubs you have to define a custom - HTTP Stub server implementation. It can look like this:

package org.springframework.cloud.contract.stubrunner.provider.moco
-
-import com.github.dreamhead.moco.bootstrap.arg.HttpArgs
-import com.github.dreamhead.moco.runner.JsonRunner
-import com.github.dreamhead.moco.runner.RunnerSetting
-import groovy.util.logging.Slf4j
-import org.springframework.cloud.contract.stubrunner.HttpServerStub
-import org.springframework.util.SocketUtils
-
-@Slf4j
-class MocoHttpServerStub implements HttpServerStub {
-
-	private boolean started
-	private JsonRunner runner
-	private int port
-
-	@Override
-	int port() {
-		if (!isRunning()) {
-			return -1
-		}
-		return port
-	}
-
-	@Override
-	boolean isRunning() {
-		return started
-	}
-
-	@Override
-	HttpServerStub start() {
-		return start(SocketUtils.findAvailableTcpPort())
-	}
-
-	@Override
-	HttpServerStub start(int port) {
-		this.port = port
-		return this
-	}
-
-	@Override
-	HttpServerStub stop() {
-		if (!isRunning()) {
-			return this
-		}
-		this.runner.stop()
-		return this
-	}
-
-	@Override
-	HttpServerStub registerMappings(Collection<File> stubFiles) {
-		List<RunnerSetting> settings = stubFiles.findAll { it.name.endsWith("json") }
-				.collect {
-			log.info("Trying to parse [{}]", it.name)
-			try {
-				return RunnerSetting.aRunnerSetting().withStream(it.newInputStream()).build()
-			} catch (Exception e) {
-				log.warn("Exception occurred while trying to parse file [{}]", it.name, e)
-				return null
-			}
-		}.findAll { it }
-		this.runner = JsonRunner.newJsonRunnerWithSetting(settings,
-				HttpArgs.httpArgs().withPort(this.port).build())
-		this.runner.run()
-		this.started = true
-		return this
-	}
-
-	@Override
-	String registeredMappings() {
-		return ""
-	}
-
-	@Override
-	boolean isAccepted(File file) {
-		return file.name.endsWith(".json")
-	}
-}

and just register it in your spring.factories file

org.springframework.cloud.contract.stubrunner.HttpServerStub=\
-org.springframework.cloud.contract.stubrunner.provider.moco.MocoHttpServerStub

that way you’ll be able to run stubs using Moco.

[Important]Important

If you don’t provide any implementation then the default one - WireMock based -will be picked. If you provide more than one then the first one on the list will be picked.

2.19.5 Custom Stub Downloader

You can customize the way your stubs are downloaded. It’s enough to create an -implementation of the StubDownloaderBuilder

package com.example;
-
-class CustomStubDownloaderBuilder implements StubDownloaderBuilder {
-
-	@Override
-	public StubDownloader build(final StubRunnerOptions stubRunnerOptions) {
-		return new StubDownloader() {
-			@Override
-			public Map.Entry<StubConfiguration, File> downloadAndUnpackStubJar(
-					StubConfiguration config) {
-				File unpackedStubs = retrieveStubs();
-				return new AbstractMap.SimpleEntry<>(
-						new StubConfiguration(config.getGroupId(), config.getArtifactId(), version,
-								config.getClassifier()), unpackedStubs);
-			}
-
-			File retrieveStubs() {
-			    // here goes your custom logic to provide a folder where all the stubs reside
-			}
-}

and just register it in your spring.factories file

# Example of a custom Stub Downloader Provider
-org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder=\
-com.example.CustomStubDownloaderBuilder

that way you’ll be able to pick a folder with the source of your stubs.

[Important]Important

If you don’t provide any implementation then the default one will be picked. - If you provide repositoryRoot property or workOffline flag then Aether based - that will download stubs from a remote repo will be picked. If you don’t provide these - values then the ClasspathStubProvider will be picked that will scan the classpath. - If you provide more than one, then the first one on the list will be picked.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__spring_cloud_contract_verifier_introduction.html b/multi/multi__spring_cloud_contract_verifier_introduction.html index 263549d427..a5ffb82f50 100644 --- a/multi/multi__spring_cloud_contract_verifier_introduction.html +++ b/multi/multi__spring_cloud_contract_verifier_introduction.html @@ -1,843 +1,13 @@ - - - 2. Spring Cloud Contract Verifier Introduction

2. Spring Cloud Contract Verifier Introduction

Spring Cloud Contract Verifier enables Consumer Driven Contract (CDC) development of -JVM-based applications. It moves TDD to the level of software architecture.

Spring Cloud Contract Verifier ships with Contract Definition Language (CDL). Contract -definitions are used to produce the following resources:

  • JSON stub definitions to be used by WireMock when doing integration testing on the -client code (client tests). Test code must still be written by hand, and test data is -produced by Spring Cloud Contract Verifier.
  • Messaging routes, if you’re using a messaging service. We integrate with Spring -Integration, Spring Cloud Stream, Spring AMQP, and Apache Camel. You can also set your -own integrations.
  • Acceptance tests (in JUnit 4, JUnit 5 or Spock) are used to verify if server-side implementation -of the API is compliant with the contract (server tests). A full test is generated by -Spring Cloud Contract Verifier.

2.1 History

Before becoming Spring Cloud Contract, this project was called Accurest. -It was created by Marcin Grzejszczak and Jakub Kubrynski -from (codearte.io.

The 0.1.0 release took place on 26 Jan 2015 and it became stable with 1.0.0 release on 29 Feb 2016.

2.2 Why a Contract Verifier?

Assume that we have a system consisting of multiple microservices:

Microservices Architecture

2.2.1 Testing issues

If we wanted to test the application in top left corner to determine whether it can -communicate with other services, we could do one of two things:

  • Deploy all microservices and perform end-to-end tests.
  • Mock other microservices in unit/integration tests.

Both have their advantages but also a lot of disadvantages.

Deploy all microservices and perform end to end tests

Advantages:

  • Simulates production.
  • Tests real communication between services.

Disadvantages:

  • To test one microservice, we have to deploy 6 microservices, a couple of databases, -etc.
  • The environment where the tests run is locked for a single suite of tests (nobody else -would be able to run the tests in the meantime).
  • They take a long time to run.
  • The feedback comes very late in the process.
  • They are extremely hard to debug.

Mock other microservices in unit/integration tests

Advantages:

  • They provide very fast feedback.
  • They have no infrastructure requirements.

Disadvantages:

  • The implementor of the service creates stubs that might have nothing to do with -reality.
  • You can go to production with passing tests and failing production.

To solve the aforementioned issues, Spring Cloud Contract Verifier with Stub Runner was -created. The main idea is to give you very fast feedback, without the need to set up the -whole world of microservices. If you work on stubs, then the only applications you need -are those that your application directly uses.

Stubbed Services

Spring Cloud Contract Verifier gives you the certainty that the stubs that you use were -created by the service that you’re calling. Also, if you can use them, it means that they -were tested against the producer’s side. In short, you can trust those stubs.

2.3 Purposes

The main purposes of Spring Cloud Contract Verifier with Stub Runner are:

  • To ensure that WireMock/Messaging stubs (used when developing the client) do exactly -what the actual server-side implementation does.
  • To promote ATDD method and Microservices architectural style.
  • To provide a way to publish changes in contracts that are immediately visible on both -sides.
  • To generate boilerplate test code to be used on the server side.
[Important]Important

Spring Cloud Contract Verifier’s purpose is NOT to start writing business -features in the contracts. Assume that we have a business use case of fraud check. If a -user can be a fraud for 100 different reasons, we would assume that you would create 2 -contracts, one for the positive case and one for the negative case. Contract tests are -used to test contracts between applications and not to simulate full behavior.

2.4 How It Works

This section explores how Spring Cloud Contract Verifier with Stub Runner works.

2.4.1 A Three-second Tour

This very brief tour walks through using Spring Cloud Contract:

You can find a somewhat longer tour -here.

On the Producer Side

To start working with Spring Cloud Contract, add files with REST/ messaging contracts -expressed in either Groovy DSL or YAML to the contracts directory, which is set by the -contractsDslDir property. By default, it is $rootDir/src/test/resources/contracts.

Then add the Spring Cloud Contract Verifier dependency and plugin to your build file, as -shown in the following example:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>

The following listing shows how to add the plugin, which should go in the build/plugins -portion of the file:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-</plugin>

Running ./mvnw clean install automatically generates tests that verify the application -compliance with the added contracts. By default, the tests get generated under -org.springframework.cloud.contract.verifier.tests..

As the implementation of the functionalities described by the contracts is not yet -present, the tests fail.

To make them pass, you must add the correct implementation of either handling HTTP -requests or messages. Also, you must add a correct base test class for auto-generated -tests to the project. This class is extended by all the auto-generated tests, and it -should contain all the setup necessary to run them (for example RestAssuredMockMvc -controller setup or messaging test setup).

Once the implementation and the test base class are in place, the tests pass, and both the -application and the stub artifacts are built and installed in the local Maven repository. -The changes can now be merged, and both the application and the stub artifacts may be -published in an online repository.

On the Consumer Side

Spring Cloud Contract Stub Runner can be used in the integration tests to get a running -WireMock instance or messaging route that simulates the actual service.

To do so, add the dependency to Spring Cloud Contract Stub Runner, as shown in the -following example:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-	<scope>test</scope>
-</dependency>

You can get the Producer-side stubs installed in your Maven repository in either of two -ways:

  • By checking out the Producer side repository and adding contracts and generating the stubs -by running the following commands:

    $ cd local-http-server-repo
    -$ ./mvnw clean install -DskipTests
    [Tip]Tip

    The tests are being skipped because the Producer-side contract implementation is not -in place yet, so the automatically-generated contract tests fail.

  • By getting already-existing producer service stubs from a remote repository. To do so, -pass the stub artifact IDs and artifact repository URL as Spring Cloud Contract -Stub Runner properties, as shown in the following example:

    stubrunner:
    -  ids: 'com.example:http-server-dsl:+:stubs:8080'
    -  repositoryRoot: https://repo.spring.io/libs-snapshot

Now you can annotate your test class with @AutoConfigureStubRunner. In the annotation, -provide the group-id and artifact-id values for Spring Cloud Contract Stub Runner to -run the collaborators' stubs for you, as shown in the following example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment=WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
-		stubsMode = StubRunnerProperties.StubsMode.LOCAL)
-public class LoanApplicationServiceTests {
[Tip]Tip

Use the REMOTE stubsMode when downloading stubs from an online repository and -LOCAL for offline work.

Now, in your integration test, you can receive stubbed versions of HTTP responses or -messages that are expected to be emitted by the collaborator service.

2.4.2 A Three-minute Tour

This brief tour walks through using Spring Cloud Contract:

You can find an even more brief tour -here.

On the Producer Side

To start working with Spring Cloud Contract, add files with REST/ messaging contracts -expressed in either Groovy DSL or YAML to the contracts directory, which is set by the -contractsDslDir property. By default, it is $rootDir/src/test/resources/contracts.

For the HTTP stubs, a contract defines what kind of response should be returned for a -given request (taking into account the HTTP methods, URLs, headers, status codes, and so -on). The following example shows how an HTTP stub contract in Groovy DSL:

package contracts
+
 
-org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url '/fraudcheck'
-		body([
-			   "client.id": $(regex('[0-9]{10}')),
-			   loanAmount: 99999
-		])
-		headers {
-			contentType('application/json')
-		}
-	}
-	response {
-		status OK()
-		body([
-			   fraudCheckStatus: "FRAUD",
-			   "rejection.reason": "Amount too high"
-		])
-		headers {
-			contentType('application/json')
-		}
-	}
-}

The same contract expressed in YAML would look like the following example:

request:
-  method: PUT
-  url: /fraudcheck
-  body:
-    "client.id": 1234567890
-    loanAmount: 99999
-  headers:
-    Content-Type: application/json
-  matchers:
-    body:
-      - path: $.['client.id']
-        type: by_regex
-        value: "[0-9]{10}"
-response:
-  status: 200
-  body:
-    fraudCheckStatus: "FRAUD"
-    "rejection.reason": "Amount too high"
-  headers:
-    Content-Type: application/json;charset=UTF-8

In the case of messaging, you can define:

  • The input and the output messages can be defined (taking into account from and where it -was sent, the message body, and the header).
  • The methods that should be called after the message is received.
  • The methods that, when called, should trigger a message.

The following example shows a Camel messaging contract expressed in Groovy DSL:

			def contractDsl = Contract.make {
-				label 'some_label'
-				input {
-					messageFrom('jms:delete')
-					messageBody([
-							bookName: 'foo'
-					])
-					messageHeaders {
-						header('sample', 'header')
-					}
-					assertThat('bookWasDeleted()')
-				}
-			}

The following example shows the same contract expressed in YAML:

label: some_label
-input:
-  messageFrom: jms:delete
-  messageBody:
-    bookName: 'foo'
-  messageHeaders:
-    sample: header
-  assertThat: bookWasDeleted()

Then you can add Spring Cloud Contract Verifier dependency and plugin to your build file, -as shown in the following example:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>

The following listing shows how to add the plugin, which should go in the build/plugins -portion of the file:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-</plugin>

Running ./mvnw clean install automatically generates tests that verify the application -compliance with the added contracts. By default, the generated tests are under -org.springframework.cloud.contract.verifier.tests..

The following example shows a sample auto-generated test for an HTTP contract:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-    // given:
-        MockMvcRequestSpecification request = given()
-                .header("Content-Type", "application/vnd.fraud.v1+json")
-                .body("{\"client.id\":\"1234567890\",\"loanAmount\":99999}");
+
+
 
-    // when:
-        ResponseOptions response = given().spec(request)
-                .put("/fraudcheck");
+
 
-    // then:
-        assertThat(response.statusCode()).isEqualTo(200);
-        assertThat(response.header("Content-Type")).matches("application/vnd.fraud.v1.json.*");
-    // and:
-        DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-        assertThatJson(parsedJson).field("['fraudCheckStatus']").matches("[A-Z]{5}");
-        assertThatJson(parsedJson).field("['rejection.reason']").isEqualTo("Amount too high");
-}

The preceding example uses Spring’s MockMvc to run the tests. This is the default test -mode for HTTP contracts. However, JAX-RS client and explicit HTTP invocations can also be -used. (To do so, change the testMode property of the plugin to JAX-RS or EXPLICIT, -respectively.)

Since 2.1.0, it is also possible to use RestAssuredWebTestClient`with Spring’s reactive `WebTestClient -run under the hood. This is particularly recommended while working with Reactive, Web-Flux-based applications. -In order to use WebTestClient set testMode to WEBTESTCLIENT.

Here is an example of a test generated in WEBTESTCLIENT test mode:

[source,java,indent=0]
@Test
-	public void validate_shouldRejectABeerIfTooYoung() throws Exception {
-		// given:
-			WebTestClientRequestSpecification request = given()
-					.header("Content-Type", "application/json")
-					.body("{\"age\":10}");
+Page Redirection
 
-		// when:
-			WebTestClientResponse response = given().spec(request)
-					.post("/check");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-			assertThat(response.header("Content-Type")).matches("application/json.*");
-		// and:
-			DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-			assertThatJson(parsedJson).field("['status']").isEqualTo("NOT_OK");
-	}

Apart from the default JUnit 4, you can instead use JUnit 5 or Spock tests, by setting the plugin -testFramework property to either JUNIT5 or Spock.

[Tip]Tip

You can now also generate WireMock scenarios based on the contracts, by including an -order number followed by an underscore at the beginning of the contract file names.

The following example shows an auto-generated test in Spock for a messaging stub contract:

[source,groovy,indent=0]
given:
-	 ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-		\'\'\'{"bookName":"foo"}\'\'\',
-		['sample': 'header']
-	)
-
-when:
-	 contractVerifierMessaging.send(inputMessage, 'jms:delete')
-
-then:
-	 noExceptionThrown()
-	 bookWasDeleted()

As the implementation of the functionalities described by the contracts is not yet -present, the tests fail.

To make them pass, you must add the correct implementation of handling either HTTP -requests or messages. Also, you must add a correct base test class for auto-generated -tests to the project. This class is extended by all the auto-generated tests and should -contain all the setup necessary to run them (for example, RestAssuredMockMvc controller -setup or messaging test setup).

Once the implementation and the test base class are in place, the tests pass, and both the -application and the stub artifacts are built and installed in the local Maven repository. -Information about installing the stubs jar to the local repository appears in the logs, as -shown in the following example:

[INFO] --- spring-cloud-contract-maven-plugin:1.0.0.BUILD-SNAPSHOT:generateStubs (default-generateStubs) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar
-[INFO]
-[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar
-[INFO]
-[INFO] --- spring-boot-maven-plugin:1.5.5.BUILD-SNAPSHOT:repackage (default) @ http-server ---
-[INFO]
-[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ http-server ---
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.jar
-[INFO] Installing /some/path/http-server/pom.xml to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.pom
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar

You can now merge the changes and publish both the application and the stub artifacts -in an online repository.

Docker Project

In order to enable working with contracts while creating applications in non-JVM -technologies, the springcloud/spring-cloud-contract Docker image has been created. It -contains a project that automatically generates tests for HTTP contracts and executes them -in EXPLICIT test mode. Then, if the tests pass, it generates Wiremock stubs and, -optionally, publishes them to an artifact manager. In order to use the image, you can -mount the contracts into the /contracts directory and set a few environment variables.

On the Consumer Side

Spring Cloud Contract Stub Runner can be used in the integration tests to get a running -WireMock instance or messaging route that simulates the actual service.

To get started, add the dependency to Spring Cloud Contract Stub Runner:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-	<scope>test</scope>
-</dependency>

You can get the Producer-side stubs installed in your Maven repository in either of two -ways:

  • By checking out the Producer side repository and adding contracts and generating the -stubs by running the following commands:

    $ cd local-http-server-repo
    -$ ./mvnw clean install -DskipTests
    [Note]Note

    The tests are skipped because the Producer-side contract implementation is not yet -in place, so the automatically-generated contract tests fail.

  • Getting already existing producer service stubs from a remote repository. To do so, -pass the stub artifact IDs and artifact repository URl as Spring Cloud Contract Stub -Runner properties, as shown in the following example:

    stubrunner:
    -  ids: 'com.example:http-server-dsl:+:stubs:8080'
    -  repositoryRoot: https://repo.spring.io/libs-snapshot

Now you can annotate your test class with @AutoConfigureStubRunner. In the annotation, -provide the group-id and artifact-id for Spring Cloud Contract Stub Runner to run -the collaborators' stubs for you, as shown in the following example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment=WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
-		stubsMode = StubRunnerProperties.StubsMode.LOCAL)
-public class LoanApplicationServiceTests {
[Tip]Tip

Use the REMOTE stubsMode when downloading stubs from an online repository and -LOCAL for offline work.

In your integration test, you can receive stubbed versions of HTTP responses or messages -that are expected to be emitted by the collaborator service. You can see entries similar -to the following in the build logs:

2016-07-19 14:22:25.403  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Desired version is + - will try to resolve the latest version
-2016-07-19 14:22:25.438  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved version is 0.0.1-SNAPSHOT
-2016-07-19 14:22:25.439  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolving artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT using remote repositories []
-2016-07-19 14:22:25.451  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar
-2016-07-19 14:22:25.465  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacking stub from JAR [URI: file:/path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar]
-2016-07-19 14:22:25.475  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacked file to [/var/folders/0p/xwq47sq106x1_g3dtv6qfm940000gq/T/contracts100276532569594265]
-2016-07-19 14:22:27.737  INFO 41050 --- [           main] o.s.c.c.stubrunner.StubRunnerExecutor    : All stubs are now running RunningStubs [namesAndPorts={com.example:http-server:0.0.1-SNAPSHOT:stubs=8080}]

2.4.3 Defining the Contract

As consumers of services, we need to define what exactly we want to achieve. We need to -formulate our expectations. That is why we write contracts.

Assume that you want to send a request containing the ID of a client company and the -amount it wants to borrow from us. You also want to send it to the /fraudcheck url via -the PUT method.

Groovy DSL.  -

/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package contracts
-
-org.springframework.cloud.contract.spec.Contract.make {
-	request { // (1)
-		method 'PUT' // (2)
-		url '/fraudcheck' // (3)
-		body([ // (4)
-			   "client.id": $(regex('[0-9]{10}')),
-			   loanAmount : 99999
-		])
-		headers { // (5)
-			contentType('application/json')
-		}
-	}
-	response { // (6)
-		status OK() // (7)
-		body([ // (8)
-			   fraudCheckStatus  : "FRAUD",
-			   "rejection.reason": "Amount too high"
-		])
-		headers { // (9)
-			contentType('application/json')
-		}
-	}
-}
-
-/*
-From the Consumer perspective, when shooting a request in the integration test:
-
-(1) - If the consumer sends a request
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `client.id` that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the response will be sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` equal to `application/json`
-
-From the Producer perspective, in the autogenerated producer-side test:
-
-(1) - A request will be sent to the producer
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `client.id` that will have a generated value that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the test will assert if the response has been sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` matching `application/json.*`
- */

-

YAML.  -

request: # (1)
-  method: PUT # (2)
-  url: /fraudcheck # (3)
-  body: # (4)
-    "client.id": 1234567890
-    loanAmount: 99999
-  headers: # (5)
-    Content-Type: application/json
-  matchers:
-    body:
-      - path: $.['client.id'] # (6)
-        type: by_regex
-        value: "[0-9]{10}"
-response: # (7)
-  status: 200 # (8)
-  body:  # (9)
-    fraudCheckStatus: "FRAUD"
-    "rejection.reason": "Amount too high"
-  headers: # (10)
-    Content-Type: application/json;charset=UTF-8
-
-
-#From the Consumer perspective, when shooting a request in the integration test:
-#
-#(1) - If the consumer sends a request
-#(2) - With the "PUT" method
-#(3) - to the URL "/fraudcheck"
-#(4) - with the JSON body that
-# * has a field `client.id`
-# * has a field `loanAmount` that is equal to `99999`
-#(5) - with header `Content-Type` equal to `application/json`
-#(6) - and a `client.id` json entry matches the regular expression `[0-9]{10}`
-#(7) - then the response will be sent with
-#(8) - status equal `200`
-#(9) - and JSON body equal to
-# { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-#(10) - with header `Content-Type` equal to `application/json`
-#
-#From the Producer perspective, in the autogenerated producer-side test:
-#
-#(1) - A request will be sent to the producer
-#(2) - With the "PUT" method
-#(3) - to the URL "/fraudcheck"
-#(4) - with the JSON body that
-# * has a field `client.id` `1234567890`
-# * has a field `loanAmount` that is equal to `99999`
-#(5) - with header `Content-Type` equal to `application/json`
-#(7) - then the test will assert if the response has been sent with
-#(8) - status equal `200`
-#(9) - and JSON body equal to
-# { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-#(10) - with header `Content-Type` equal to `application/json;charset=UTF-8`

-

2.4.4 Client Side

Spring Cloud Contract generates stubs, which you can use during client-side testing. -You get a running WireMock instance/Messaging route that simulates the service. -You would like to feed that instance with a proper stub definition.

At some point in time, you need to send a request to the Fraud Detection service.

ResponseEntity<FraudServiceResponse> response = restTemplate.exchange(
-		"http://localhost:" + port + "/fraudcheck", HttpMethod.PUT,
-		new HttpEntity<>(request, httpHeaders), FraudServiceResponse.class);

Annotate your test class with @AutoConfigureStubRunner. In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators.

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {
-		"com.example:http-server-dsl:+:stubs:6565" }, stubsMode = StubRunnerProperties.StubsMode.LOCAL)
-public class LoanApplicationServiceTests {

After that, during the tests, Spring Cloud Contract automatically finds the stubs -(simulating the real service) in the Maven repository and exposes them on a configured -(or random) port.

2.4.5 Server Side

Since you are developing your stub, you need to be sure that it actually resembles your -concrete implementation. You cannot have a situation where your stub acts in one way and -your application behaves in a different way, especially in production.

To ensure that your application behaves the way you define in your stub, tests are -generated from the stub you provide.

The autogenerated test looks, more or less, like this:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-    // given:
-        MockMvcRequestSpecification request = given()
-                .header("Content-Type", "application/vnd.fraud.v1+json")
-                .body("{\"client.id\":\"1234567890\",\"loanAmount\":99999}");
-
-    // when:
-        ResponseOptions response = given().spec(request)
-                .put("/fraudcheck");
-
-    // then:
-        assertThat(response.statusCode()).isEqualTo(200);
-        assertThat(response.header("Content-Type")).matches("application/vnd.fraud.v1.json.*");
-    // and:
-        DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-        assertThatJson(parsedJson).field("['fraudCheckStatus']").matches("[A-Z]{5}");
-        assertThatJson(parsedJson).field("['rejection.reason']").isEqualTo("Amount too high");
-}

2.5 Step-by-step Guide to Consumer Driven Contracts (CDC)

Consider an example of Fraud Detection and the Loan Issuance process. The business -scenario is such that we want to issue loans to people but do not want them to steal from -us. The current implementation of our system grants loans to everybody.

Assume that Loan Issuance is a client to the Fraud Detection server. In the current -sprint, we must develop a new feature: if a client wants to borrow too much money, then -we mark the client as a fraud.

Technical remark - Fraud Detection has an artifact-id of http-server, while Loan -Issuance has an artifact-id of http-client, and both have a group-id of com.example.

Social remark - both client and server development teams need to communicate directly and -discuss changes while going through the process. CDC is all about communication.

The server -side code is available here and the -client code here.

[Tip]Tip

In this case, the producer owns the contracts. Physically, all the contract are -in the producer’s repository.

2.5.1 Technical note

If using the SNAPSHOT / Milestone / Release Candidate versions please add the -following section to your build:

Maven.  -

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

-

Gradle.  -

repositories {
-	mavenCentral()
-	mavenLocal()
-	maven { url "https://repo.spring.io/snapshot" }
-	maven { url "https://repo.spring.io/milestone" }
-	maven { url "https://repo.spring.io/release" }
-}

-

2.5.2 Consumer side (Loan Issuance)

As a developer of the Loan Issuance service (a consumer of the Fraud Detection server), you might do the following steps:

  1. Start doing TDD by writing a test for your feature.
  2. Write the missing implementation.
  3. Clone the Fraud Detection service repository locally.
  4. Define the contract locally in the repo of Fraud Detection service.
  5. Add the Spring Cloud Contract Verifier plugin.
  6. Run the integration tests.
  7. File a pull request.
  8. Create an initial implementation.
  9. Take over the pull request.
  10. Write the missing implementation.
  11. Deploy your app.
  12. Work online.

Start doing TDD by writing a test for your feature.

@Test
-public void shouldBeRejectedDueToAbnormalLoanAmount() {
-	// given:
-	LoanApplication application = new LoanApplication(new Client("1234567890"),
-			99999);
-	// when:
-	LoanApplicationResult loanApplication = service.loanApplication(application);
-	// then:
-	assertThat(loanApplication.getLoanApplicationStatus())
-			.isEqualTo(LoanApplicationStatus.LOAN_APPLICATION_REJECTED);
-	assertThat(loanApplication.getRejectionReason()).isEqualTo("Amount too high");
-}

Assume that you have written a test of your new feature. If a loan application for a big -amount is received, the system should reject that loan application with some description.

Write the missing implementation.

At some point in time, you need to send a request to the Fraud Detection service. Assume -that you need to send the request containing the ID of the client and the amount the -client wants to borrow. You want to send it to the /fraudcheck url via the PUT method.

ResponseEntity<FraudServiceResponse> response = restTemplate.exchange(
-		"http://localhost:" + port + "/fraudcheck", HttpMethod.PUT,
-		new HttpEntity<>(request, httpHeaders), FraudServiceResponse.class);

For simplicity, the port of the Fraud Detection service is set to 8080, and the -application runs on 8090.

If you start the test at this point, it breaks, because no service currently runs on port -8080.

Clone the Fraud Detection service repository locally.

You can start by playing around with the server side contract. To do so, you must first -clone it.

$ git clone https://your-git-server.com/server-side.git local-http-server-repo

Define the contract locally in the repo of Fraud Detection service.

As a consumer, you need to define what exactly you want to achieve. You need to formulate -your expectations. To do so, write the following contract:

[Important]Important

Place the contract under src/test/resources/contracts/fraud folder. The fraud folder -is important because the producer’s test base class name references that folder.

Groovy DSL.  -

/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package contracts
-
-org.springframework.cloud.contract.spec.Contract.make {
-	request { // (1)
-		method 'PUT' // (2)
-		url '/fraudcheck' // (3)
-		body([ // (4)
-			   "client.id": $(regex('[0-9]{10}')),
-			   loanAmount : 99999
-		])
-		headers { // (5)
-			contentType('application/json')
-		}
-	}
-	response { // (6)
-		status OK() // (7)
-		body([ // (8)
-			   fraudCheckStatus  : "FRAUD",
-			   "rejection.reason": "Amount too high"
-		])
-		headers { // (9)
-			contentType('application/json')
-		}
-	}
-}
-
-/*
-From the Consumer perspective, when shooting a request in the integration test:
-
-(1) - If the consumer sends a request
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `client.id` that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the response will be sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` equal to `application/json`
-
-From the Producer perspective, in the autogenerated producer-side test:
-
-(1) - A request will be sent to the producer
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `client.id` that will have a generated value that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the test will assert if the response has been sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` matching `application/json.*`
- */

-

YAML.  -

request: # (1)
-  method: PUT # (2)
-  url: /fraudcheck # (3)
-  body: # (4)
-    "client.id": 1234567890
-    loanAmount: 99999
-  headers: # (5)
-    Content-Type: application/json
-  matchers:
-    body:
-      - path: $.['client.id'] # (6)
-        type: by_regex
-        value: "[0-9]{10}"
-response: # (7)
-  status: 200 # (8)
-  body:  # (9)
-    fraudCheckStatus: "FRAUD"
-    "rejection.reason": "Amount too high"
-  headers: # (10)
-    Content-Type: application/json;charset=UTF-8
-
-
-#From the Consumer perspective, when shooting a request in the integration test:
-#
-#(1) - If the consumer sends a request
-#(2) - With the "PUT" method
-#(3) - to the URL "/fraudcheck"
-#(4) - with the JSON body that
-# * has a field `client.id`
-# * has a field `loanAmount` that is equal to `99999`
-#(5) - with header `Content-Type` equal to `application/json`
-#(6) - and a `client.id` json entry matches the regular expression `[0-9]{10}`
-#(7) - then the response will be sent with
-#(8) - status equal `200`
-#(9) - and JSON body equal to
-# { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-#(10) - with header `Content-Type` equal to `application/json`
-#
-#From the Producer perspective, in the autogenerated producer-side test:
-#
-#(1) - A request will be sent to the producer
-#(2) - With the "PUT" method
-#(3) - to the URL "/fraudcheck"
-#(4) - with the JSON body that
-# * has a field `client.id` `1234567890`
-# * has a field `loanAmount` that is equal to `99999`
-#(5) - with header `Content-Type` equal to `application/json`
-#(7) - then the test will assert if the response has been sent with
-#(8) - status equal `200`
-#(9) - and JSON body equal to
-# { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-#(10) - with header `Content-Type` equal to `application/json;charset=UTF-8`

-

The YML contract is quite straight-forward. However when you take a look at the Contract -written using a statically typed Groovy DSL - you might wonder what the -value(client(…​), server(…​)) parts are. By using this notation, Spring Cloud -Contract lets you define parts of a JSON block, a URL, etc., which are dynamic. In case -of an identifier or a timestamp, you need not hardcode a value. You want to allow some -different ranges of values. To enable ranges of values, you can set regular expressions -matching those values for the consumer side. You can provide the body by means of either -a map notation or String with interpolations. -Consult the Chapter 8, Contract DSL section for more information. We highly recommend using the map notation!

[Tip]Tip

You must understand the map notation in order to set up contracts. Please read the -Groovy docs regarding JSON.

The previously shown contract is an agreement between two sides that:

  • if an HTTP request is sent with all of

    • a PUT method on the /fraudcheck endpoint,
    • a JSON body with a client.id that matches the regular expression [0-9]{10} and -loanAmount equal to 99999,
    • and a Content-Type header with a value of application/vnd.fraud.v1+json,
  • then an HTTP response is sent to the consumer that

    • has status 200,
    • contains a JSON body with the fraudCheckStatus field containing a value FRAUD and -the rejectionReason field having value Amount too high,
    • and a Content-Type header with a value of application/vnd.fraud.v1+json.

Once you are ready to check the API in practice in the integration tests, you need to -install the stubs locally.

Add the Spring Cloud Contract Verifier plugin.

We can add either a Maven or a Gradle plugin. In this example, you see how to add Maven. -First, add the Spring Cloud Contract BOM.

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-release.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Next, add the Spring Cloud Contract Verifier Maven plugin

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-		<convertToYaml>true</convertToYaml>
-	</configuration>
-</plugin>

Since the plugin was added, you get the Spring Cloud Contract Verifier features which, -from the provided contracts:

  • generate and run tests
  • produce and install stubs

You do not want to generate tests since you, as the consumer, want only to play with the -stubs. You need to skip the test generation and execution. When you execute:

$ cd local-http-server-repo
-$ ./mvnw clean install -DskipTests

In the logs, you see something like this:

[INFO] --- spring-cloud-contract-maven-plugin:1.0.0.BUILD-SNAPSHOT:generateStubs (default-generateStubs) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar
-[INFO]
-[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar
-[INFO]
-[INFO] --- spring-boot-maven-plugin:1.5.5.BUILD-SNAPSHOT:repackage (default) @ http-server ---
-[INFO]
-[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ http-server ---
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.jar
-[INFO] Installing /some/path/http-server/pom.xml to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.pom
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar

The following line is extremely important:

[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar

It confirms that the stubs of the http-server have been installed in the local -repository.

Run the integration tests.

In order to profit from the Spring Cloud Contract Stub Runner functionality of automatic -stub downloading, you must do the following in your consumer side project (Loan -Application service):

Add the Spring Cloud Contract BOM:

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-release-train.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Add the dependency to Spring Cloud Contract Stub Runner:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-	<scope>test</scope>
-</dependency>

Annotate your test class with @AutoConfigureStubRunner. In the annotation, provide the -group-id and artifact-id for the Stub Runner to download the stubs of your -collaborators. (Optional step) Because you’re playing with the collaborators offline, you -can also provide the offline work switch (StubRunnerProperties.StubsMode.LOCAL).

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {
-		"com.example:http-server-dsl:+:stubs:6565" }, stubsMode = StubRunnerProperties.StubsMode.LOCAL)
-public class LoanApplicationServiceTests {

Now, when you run your tests, you see something like this:

2016-07-19 14:22:25.403  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Desired version is + - will try to resolve the latest version
-2016-07-19 14:22:25.438  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved version is 0.0.1-SNAPSHOT
-2016-07-19 14:22:25.439  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolving artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT using remote repositories []
-2016-07-19 14:22:25.451  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar
-2016-07-19 14:22:25.465  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacking stub from JAR [URI: file:/path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar]
-2016-07-19 14:22:25.475  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacked file to [/var/folders/0p/xwq47sq106x1_g3dtv6qfm940000gq/T/contracts100276532569594265]
-2016-07-19 14:22:27.737  INFO 41050 --- [           main] o.s.c.c.stubrunner.StubRunnerExecutor    : All stubs are now running RunningStubs [namesAndPorts={com.example:http-server:0.0.1-SNAPSHOT:stubs=8080}]

This output means that Stub Runner has found your stubs and started a server for your app -with group id com.example, artifact id http-server with version 0.0.1-SNAPSHOT of -the stubs and with stubs classifier on port 8080.

File a pull request.

What you have done until now is an iterative process. You can play around with the -contract, install it locally, and work on the consumer side until the contract works as -you wish.

Once you are satisfied with the results and the test passes, publish a pull request to -the server side. Currently, the consumer side work is done.

2.5.3 Producer side (Fraud Detection server)

As a developer of the Fraud Detection server (a server to the Loan Issuance service):

Create an initial implementation.

As a reminder, you can see the initial implementation here:

@RequestMapping(value = "/fraudcheck", method = PUT)
-public FraudCheckResult fraudCheck(@RequestBody FraudCheck fraudCheck) {
-return new FraudCheckResult(FraudCheckStatus.OK, NO_REASON);
-}

Take over the pull request.

$ git checkout -b contract-change-pr master
-$ git pull https://your-git-server.com/server-side-fork.git contract-change-pr

You must add the dependencies needed by the autogenerated tests:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>

In the configuration of the Maven plugin, pass the packageWithBaseClasses property

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-		<convertToYaml>true</convertToYaml>
-	</configuration>
-</plugin>
[Important]Important

This example uses "convention based" naming by setting the -packageWithBaseClasses property. Doing so means that the two last packages combine to -make the name of the base test class. In our case, the contracts were placed under -src/test/resources/contracts/fraud. Since you do not have two packages starting from -the contracts folder, pick only one, which should be fraud. Add the Base suffix and -capitalize fraud. That gives you the FraudBase test class name.

All the generated tests extend that class. Over there, you can set up your Spring Context -or whatever is necessary. In this case, use Rest Assured MVC to -start the server side FraudDetectionController.

/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.fraud;
-
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-import org.junit.Before;
-
-public class FraudBase {
-
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.standaloneSetup(new FraudDetectionController(),
-				new FraudStatsController(stubbedStatsProvider()));
-	}
-
-	private StatsProvider stubbedStatsProvider() {
-		return fraudType -> {
-			switch (fraudType) {
-			case DRUNKS:
-				return 100;
-			case ALL:
-				return 200;
-			}
-			return 0;
-		};
-	}
-
-	public void assertThatRejectionReasonIsNull(Object rejectionReason) {
-		assert rejectionReason == null;
-	}
-
-}

Now, if you run the ./mvnw clean install, you get something like this:

Results :
-
-Tests in error:
-  ContractVerifierTest.validate_shouldMarkClientAsFraud:32 » IllegalState Parsed...

This error occurs because you have a new contract from which a test was generated and it -failed since you have not implemented the feature. The auto-generated test would look -like this:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-    // given:
-        MockMvcRequestSpecification request = given()
-                .header("Content-Type", "application/vnd.fraud.v1+json")
-                .body("{\"client.id\":\"1234567890\",\"loanAmount\":99999}");
-
-    // when:
-        ResponseOptions response = given().spec(request)
-                .put("/fraudcheck");
-
-    // then:
-        assertThat(response.statusCode()).isEqualTo(200);
-        assertThat(response.header("Content-Type")).matches("application/vnd.fraud.v1.json.*");
-    // and:
-        DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-        assertThatJson(parsedJson).field("['fraudCheckStatus']").matches("[A-Z]{5}");
-        assertThatJson(parsedJson).field("['rejection.reason']").isEqualTo("Amount too high");
-}

If you used the Groovy DSL, you can see, all the producer() parts of the Contract that were present in the -value(consumer(…​), producer(…​)) blocks got injected into the test. -In case of using YAML, the same applied for the matchers sections of the response.

Note that, on the producer side, you are also doing TDD. The expectations are expressed -in the form of a test. This test sends a request to our own application with the URL, -headers, and body defined in the contract. It also is expecting precisely defined values -in the response. In other words, you have the red part of red, green, and -refactor. It is time to convert the red into the green.

Write the missing implementation.

Because you know the expected input and expected output, you can write the missing -implementation:

@RequestMapping(value = "/fraudcheck", method = PUT)
-public FraudCheckResult fraudCheck(@RequestBody FraudCheck fraudCheck) {
-if (amountGreaterThanThreshold(fraudCheck)) {
-	return new FraudCheckResult(FraudCheckStatus.FRAUD, AMOUNT_TOO_HIGH);
-}
-return new FraudCheckResult(FraudCheckStatus.OK, NO_REASON);
-}

When you execute ./mvnw clean install again, the tests pass. Since the Spring Cloud -Contract Verifier plugin adds the tests to the generated-test-sources, you can -actually run those tests from your IDE.

Deploy your app.

Once you finish your work, you can deploy your change. First, merge the branch:

$ git checkout master
-$ git merge --no-ff contract-change-pr
-$ git push origin master

Your CI might run something like ./mvnw clean deploy, which would publish both the -application and the stub artifacts.

2.5.4 Consumer Side (Loan Issuance) Final Step

As a developer of the Loan Issuance service (a consumer of the Fraud Detection server):

Merge branch to master.

$ git checkout master
-$ git merge --no-ff contract-change-pr

Work online.

Now you can disable the offline work for Spring Cloud Contract Stub Runner and indicate -where the repository with your stubs is located. At this moment the stubs of the server -side are automatically downloaded from Nexus/Artifactory. You can set the value of -stubsMode to REMOTE. The following code shows an example of -achieving the same thing by changing the properties.

stubrunner:
-  ids: 'com.example:http-server-dsl:+:stubs:8080'
-  repositoryRoot: https://repo.spring.io/libs-snapshot

That’s it!

2.6 Dependencies

The best way to add dependencies is to use the proper starter dependency.

For stub-runner, use spring-cloud-starter-stub-runner. When you use a plugin, add -spring-cloud-starter-contract-verifier.

2.7 Additional Links

Here are some resources related to Spring Cloud Contract Verifier and Stub Runner. Note -that some may be outdated, because the Spring Cloud Contract Verifier project is under -constant development.

2.7.1 Spring Cloud Contract video

You can check out the video from the Warsaw JUG about Spring Cloud Contract:

2.8 Samples

You can find some samples at -samples.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__spring_cloud_contract_verifier_messaging.html b/multi/multi__spring_cloud_contract_verifier_messaging.html index bc9cf3db58..a5ffb82f50 100644 --- a/multi/multi__spring_cloud_contract_verifier_messaging.html +++ b/multi/multi__spring_cloud_contract_verifier_messaging.html @@ -1,260 +1,13 @@ - - - 5. Spring Cloud Contract Verifier Messaging

5. Spring Cloud Contract Verifier Messaging

Spring Cloud Contract Verifier lets you verify applications that use messaging as a -means of communication. All of the integrations shown in this document work with Spring, -but you can also create one of your own and use that.

5.1 Integrations

You can use one of the following four integration configurations:

  • Apache Camel
  • Spring Integration
  • Spring Cloud Stream
  • Spring AMQP

Since we use Spring Boot, if you have added one of these libraries to the classpath, all -the messaging configuration is automatically set up.

[Important]Important

Remember to put @AutoConfigureMessageVerifier on the base class of your -generated tests. Otherwise, messaging part of Spring Cloud Contract Verifier does not -work.

[Important]Important

If you want to use Spring Cloud Stream, remember to add a dependency on -org.springframework.cloud:spring-cloud-stream-test-support, as shown here:

Maven.  -

<dependency>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-stream-test-support</artifactId>
-    <scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-stream-test-support"

-

5.2 Manual Integration Testing

The main interface used by the tests is -org.springframework.cloud.contract.verifier.messaging.MessageVerifier. -It defines how to send and receive messages. You can create your own implementation to -achieve the same goal.

In a test, you can inject a ContractVerifierMessageExchange to send and receive -messages that follow the contract. Then add @AutoConfigureMessageVerifier to your test. -Here’s an example:

@RunWith(SpringTestRunner.class)
-@SpringBootTest
-@AutoConfigureMessageVerifier
-public static class MessagingContractTests {
+
 
-  @Autowired
-  private MessageVerifier verifier;
-  ...
-}
[Note]Note

If your tests require stubs as well, then @AutoConfigureStubRunner includes the -messaging configuration, so you only need the one annotation.

5.3 Publisher-Side Test Generation

Having the input or outputMessage sections in your DSL results in creation of tests -on the publisher’s side. By default, JUnit 4 tests are created. However, there is also a -possibility to create JUnit 5 or Spock tests.

There are 3 main scenarios that we should take into consideration:

  • Scenario 1: There is no input message that produces an output message. The output -message is triggered by a component inside the application (for example, scheduler).
  • Scenario 2: The input message triggers an output message.
  • Scenario 3: The input message is consumed and there is no output message.
[Important]Important

The destination passed to messageFrom or sentTo can have different -meanings for different messaging implementations. For Stream and Integration it is -first resolved as a destination of a channel. Then, if there is no such destination -it is resolved as a channel name. For Camel, that’s a certain component (for example, -jms).

5.3.1 Scenario 1: No Input Message

For the given contract:

Groovy DSL.  -

			def contractDsl = Contract.make {
-				label 'some_label'
-				input {
-					triggeredBy('bookReturnedTriggered()')
-				}
-				outputMessage {
-					sentTo('activemq:output')
-					body('''{ "bookName" : "foo" }''')
-					headers {
-						header('BOOK-NAME', 'foo')
-						messagingContentType(applicationJson())
-					}
-				}
-			}

-

YAML.  -

label: some_label
-input:
-  triggeredBy: bookReturnedTriggered
-outputMessage:
-  sentTo: activemq:output
-  body:
-    bookName: foo
-  headers:
-    BOOK-NAME: foo
-    contentType: application/json

-

The following JUnit test is created:

					'''
- // when:
-  bookReturnedTriggered();
+
+
 
- // then:
-  ContractVerifierMessage response = contractVerifierMessaging.receive("activemq:output");
-  assertThat(response).isNotNull();
-  assertThat(response.getHeader("BOOK-NAME")).isNotNull();
-  assertThat(response.getHeader("BOOK-NAME").toString()).isEqualTo("foo");
-  assertThat(response.getHeader("contentType")).isNotNull();
-  assertThat(response.getHeader("contentType").toString()).isEqualTo("application/json");
- // and:
-  DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.getPayload()));
-  assertThatJson(parsedJson).field("bookName").isEqualTo("foo");
-'''

And the following Spock test would be created:

					'''
- when:
-  bookReturnedTriggered()
+
 
- then:
-  ContractVerifierMessage response = contractVerifierMessaging.receive('activemq:output')
-  assert response != null
-  response.getHeader('BOOK-NAME')?.toString()  == 'foo'
-  response.getHeader('contentType')?.toString()  == 'application/json'
- and:
-  DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.payload))
-  assertThatJson(parsedJson).field("bookName").isEqualTo("foo")
+Page Redirection
 
-'''

5.3.2 Scenario 2: Output Triggered by Input

For the given contract:

Groovy DSL.  -

			def contractDsl = Contract.make {
-				label 'some_label'
-				input {
-					messageFrom('jms:input')
-					messageBody([
-							bookName: 'foo'
-					])
-					messageHeaders {
-						header('sample', 'header')
-					}
-				}
-				outputMessage {
-					sentTo('jms:output')
-					body([
-							bookName: 'foo'
-					])
-					headers {
-						header('BOOK-NAME', 'foo')
-					}
-				}
-			}

-

YAML.  -

label: some_label
-input:
-  messageFrom: jms:input
-  messageBody:
-    bookName: 'foo'
-  messageHeaders:
-    sample: header
-outputMessage:
-  sentTo: jms:output
-  body:
-    bookName: foo
-  headers:
-    BOOK-NAME: foo

-

The following JUnit test is created:

					'''
-// given:
- ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-  "{\\"bookName\\":\\"foo\\"}"
-, headers()
-  .header("sample", "header"));
-
-// when:
- contractVerifierMessaging.send(inputMessage, "jms:input");
-
-// then:
- ContractVerifierMessage response = contractVerifierMessaging.receive("jms:output");
- assertThat(response).isNotNull();
- assertThat(response.getHeader("BOOK-NAME")).isNotNull();
- assertThat(response.getHeader("BOOK-NAME").toString()).isEqualTo("foo");
-// and:
- DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.getPayload()));
- assertThatJson(parsedJson).field("bookName").isEqualTo("foo");
-'''

And the following Spock test would be created:

					"""\
-given:
-   ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-    '''{"bookName":"foo"}''',
-    ['sample': 'header']
-  )
-
-when:
-   contractVerifierMessaging.send(inputMessage, 'jms:input')
-
-then:
-   ContractVerifierMessage response = contractVerifierMessaging.receive('jms:output')
-   assert response !- null
-   response.getHeader('BOOK-NAME')?.toString()  == 'foo'
-and:
-   DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.payload))
-   assertThatJson(parsedJson).field("bookName").isEqualTo("foo")
-"""

5.3.3 Scenario 3: No Output Message

For the given contract:

Groovy DSL.  -

			def contractDsl = Contract.make {
-				label 'some_label'
-				input {
-					messageFrom('jms:delete')
-					messageBody([
-							bookName: 'foo'
-					])
-					messageHeaders {
-						header('sample', 'header')
-					}
-					assertThat('bookWasDeleted()')
-				}
-			}

-

YAML.  -

label: some_label
-input:
-  messageFrom: jms:delete
-  messageBody:
-    bookName: 'foo'
-  messageHeaders:
-    sample: header
-  assertThat: bookWasDeleted()

-

The following JUnit test is created:

					'''
-// given:
- ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-	"{\\"bookName\\":\\"foo\\"}"
-, headers()
-	.header("sample", "header"));
-
-// when:
- contractVerifierMessaging.send(inputMessage, "jms:delete");
-
-// then:
- bookWasDeleted();
-'''

And the following Spock test would be created:

					'''
-given:
-	 ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-		\'\'\'{"bookName":"foo"}\'\'\',
-		['sample': 'header']
-	)
-
-when:
-	 contractVerifierMessaging.send(inputMessage, 'jms:delete')
-
-then:
-	 noExceptionThrown()
-	 bookWasDeleted()
-'''

5.4 Consumer Stub Generation

Unlike the HTTP part, in messaging, we need to publish the Groovy DSL inside the JAR with -a stub. Then it is parsed on the consumer side and proper stubbed routes are created.

For more information, see Chapter 7, Stub Runner for Messaging section.

Maven.  -

<dependencies>
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
-	</dependency>
-
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-		<scope>test</scope>
-	</dependency>
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-stream-test-support</artifactId>
-		<scope>test</scope>
-	</dependency>
-</dependencies>
-
-<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>Greenwich.BUILD-SNAPSHOT</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

-

Gradle.  -

ext {
-	contractsDir = file("mappings")
-	stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
-}
-
-// Automatically added by plugin:
-// copyContracts - copies contracts to the output folder from which JAR will be created
-// verifierStubsJar - JAR with a provided stub suffix
-// the presented publication is also added by the plugin but you can modify it as you wish
-
-publishing {
-	publications {
-		stubs(MavenPublication) {
-			artifactId "${project.name}-stubs"
-			artifact verifierStubsJar
-		}
-	}
-}

-

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__spring_cloud_contract_verifier_setup.html b/multi/multi__spring_cloud_contract_verifier_setup.html index fe31a18910..a5ffb82f50 100644 --- a/multi/multi__spring_cloud_contract_verifier_setup.html +++ b/multi/multi__spring_cloud_contract_verifier_setup.html @@ -1,694 +1,13 @@ - - - 4. Spring Cloud Contract Verifier Setup

4. Spring Cloud Contract Verifier Setup

You can set up Spring Cloud Contract Verifier in the following ways:

4.1 Gradle Project

To learn how to set up the Gradle project for Spring Cloud Contract Verifier, read the -following sections:

4.1.1 Prerequisites

In order to use Spring Cloud Contract Verifier with WireMock, you muse use either a -Gradle or a Maven plugin.

[Warning]Warning

If you want to use Spock in your projects, you must add separately the -spock-core and spock-spring modules. Check Spock -docs for more information

4.1.2 Add Gradle Plugin with Dependencies

To add a Gradle plugin with dependencies, use code similar to this:

buildscript {
-	repositories {
-		mavenCentral()
-	}
-	dependencies {
-	    classpath "org.springframework.boot:spring-boot-gradle-plugin:${springboot_version}"
-		classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${verifier_version}"
-	}
-}
+
 
-apply plugin: 'groovy'
-apply plugin: 'spring-cloud-contract'
+
+
 
-dependencyManagement {
-	imports {
-		mavenBom "org.springframework.cloud:spring-cloud-contract-dependencies:${verifier_version}"
-	}
-}
+
 
-dependencies {
-	testCompile 'org.codehaus.groovy:groovy-all:2.4.6'
-	// example with adding Spock core and Spock Spring
-	testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
-	testCompile 'org.spockframework:spock-spring:1.0-groovy-2.4'
-	testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
-}

4.1.3 Gradle and Rest Assured 2.0

By default, Rest Assured 3.x is added to the classpath. However, to use Rest Assured 2.x -you can add it to the plugins classpath, as shown here:

buildscript {
-	repositories {
-		mavenCentral()
-	}
-	dependencies {
-	    classpath "org.springframework.boot:spring-boot-gradle-plugin:${springboot_version}"
-		classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${verifier_version}"
-		classpath "com.jayway.restassured:rest-assured:2.5.0"
-		classpath "com.jayway.restassured:spring-mock-mvc:2.5.0"
-	}
-}
+Page Redirection
 
-depenendencies {
-    // all dependencies
-    // you can exclude rest-assured from spring-cloud-contract-verifier
-    testCompile "com.jayway.restassured:rest-assured:2.5.0"
-    testCompile "com.jayway.restassured:spring-mock-mvc:2.5.0"
-}

That way, the plugin automatically sees that Rest Assured 2.x is present on the classpath -and modifies the imports accordingly.

4.1.4 Snapshot Versions for Gradle

Add the additional snapshot repository to your build.gradle to use snapshot versions, -which are automatically uploaded after every successful build, as shown here:

buildscript {
-	repositories {
-		mavenCentral()
-		mavenLocal()
-		maven { url "https://repo.spring.io/snapshot" }
-		maven { url "https://repo.spring.io/milestone" }
-		maven { url "https://repo.spring.io/release" }
-	}
-}

4.1.5 Add stubs

By default, Spring Cloud Contract Verifier is looking for stubs in the -src/test/resources/contracts directory.

The directory containing stub definitions is treated as a class name, and each stub -definition is treated as a single test. Spring Cloud Contract Verifier assumes that it -contains at least one level of directories that are to be used as the test class name. -If more than one level of nested directories is present, all except the last one is used -as the package name. For example, with following structure:

src/test/resources/contracts/myservice/shouldCreateUser.groovy
-src/test/resources/contracts/myservice/shouldReturnUser.groovy

Spring Cloud Contract Verifier creates a test class named defaultBasePackage.MyService -with two methods:

  • shouldCreateUser()
  • shouldReturnUser()

4.1.6 Run the Plugin

The plugin registers itself to be invoked before a check task. If you want it to be -part of your build process, you need to do nothing more. If you just want to generate -tests, invoke the generateContractTests task.

4.1.7 Default Setup

The default Gradle Plugin setup creates the following Gradle part of the build (in -pseudocode):

contracts {
-    testFramework ='JUNIT'
-    testMode = 'MockMvc'
-    generatedTestSourcesDir = project.file("${project.buildDir}/generated-test-sources/contracts")
-    generatedTestResourcesDir = project.file("${project.buildDir}/generated-test-resources/contracts")
-    contractsDslDir = "${project.rootDir}/src/test/resources/contracts"
-    basePackageForTests = 'org.springframework.cloud.verifier.tests'
-    stubsOutputDir = project.file("${project.buildDir}/stubs")
-
-    // the following properties are used when you want to provide where the JAR with contract lays
-    contractDependency {
-        stringNotation = ''
-    }
-    contractsPath = ''
-    contractsWorkOffline = false
-    contractRepository {
-        cacheDownloadedContracts(true)
-    }
-}
-
-tasks.create(type: Jar, name: 'verifierStubsJar', dependsOn: 'generateClientStubs') {
-    baseName = project.name
-    classifier = contracts.stubsSuffix
-    from contractVerifier.stubsOutputDir
-}
-
-project.artifacts {
-    archives task
-}
-
-tasks.create(type: Copy, name: 'copyContracts') {
-    from contracts.contractsDslDir
-    into contracts.stubsOutputDir
-}
-
-verifierStubsJar.dependsOn 'copyContracts'
-
-publishing {
-    publications {
-        stubs(MavenPublication) {
-            artifactId project.name
-            artifact verifierStubsJar
-        }
-    }
-}

4.1.8 Configure Plugin

To change the default configuration, add a contracts snippet to your Gradle config, as -shown here:

contracts {
-	testMode = 'MockMvc'
-	baseClassForTests = 'org.mycompany.tests'
-	generatedTestSourcesDir = project.file('src/generatedContract')
-}

4.1.9 Configuration Options

  • testMode: Defines the mode for acceptance tests. By default, the mode is MockMvc, -which is based on Spring’s MockMvc. It can also be changed to WebTestClient, JaxRsClient or to -Explicit for real HTTP calls.
  • imports: Creates an array with imports that should be included in generated tests -(for example ['org.myorg.Matchers']). By default, it creates an empty array.
  • staticImports: Creates an array with static imports that should be included in -generated tests(for example ['org.myorg.Matchers.*']). By default, it creates an empty -array.
  • basePackageForTests: Specifies the base package for all generated tests. If not set, -the value is picked from baseClassForTests’s package and from `packageWithBaseClasses. -If neither of these values are set, then the value is set to -org.springframework.cloud.contract.verifier.tests.
  • baseClassForTests: Creates a base class for all generated tests. By default, if you -use Spock classes, the class is spock.lang.Specification.
  • packageWithBaseClasses: Defines a package where all the base classes reside. This -setting takes precedence over baseClassForTests.
  • baseClassMappings: Explicitly maps a contract package to a FQN of a base class. This -setting takes precedence over packageWithBaseClasses and baseClassForTests.
  • ruleClassForTests: Specifies a rule that should be added to the generated test -classes.
  • ignoredFiles: Uses an Antmatcher to allow defining stub files for which processing -should be skipped. By default, it is an empty array.
  • contractsDslDir: Specifies the directory containing contracts written using the -GroovyDSL. By default, its value is $rootDir/src/test/resources/contracts.
  • generatedTestSourcesDir: Specifies the test source directory where tests generated -from the Groovy DSL should be placed. By default its value is -$buildDir/generated-test-sources/contracts.
  • generatedTestResourcesDir: Specifies the test resource directory where resources used by the tests generated -from the Groovy DSL should be placed. By default its value is -$buildDir/generated-test-resources/contracts.
  • stubsOutputDir: Specifies the directory where the generated WireMock stubs from -the Groovy DSL should be placed.
  • testFramework: Specifies the target test framework to be used. Currently, Spock, JUnit 4 (TestFramework.JUNIT) and -JUnit 5 are supported with JUnit 4 being the default framework.
  • contractsProperties: a map containing properties to be passed to Spring Cloud Contract -components. Those properties might be used by e.g. inbuilt or custom Stub Downloaders.

The following properties are used when you want to specify the location of the JAR -containing the contracts:

  • contractDependency: Specifies the Dependency that provides -groupid:artifactid:version:classifier coordinates. You can use the contractDependency -closure to set it up.
  • contractsPath: Specifies the path to the jar. If contract dependencies are -downloaded, the path defaults to groupid/artifactid where groupid is slash -separated. Otherwise, it scans contracts under the provided directory.
  • contractsMode: Specifies the mode of downloading contracts (whether the -JAR is available offline, remotely etc.)
  • deleteStubsAfterTest: If set to false will not remove any downloaded -contracts from temporary directories

Below you can find a list of experimental features you can turn on via the plugin:

  • convertToYaml: converts all DSLs to the declarative, YAML format. This can be extremely useful when you’re using external libraries in your Groovy DSLs. By turning this feature on (by setting it to true) you will not need to add the library dependency on the consumer side.
  • assertJsonSize: You can check the size of JSON arrays in the generated tests. This feature is disabled by default.

4.1.10 Single Base Class for All Tests

When using Spring Cloud Contract Verifier in default MockMvc, you need to create a base -specification for all generated acceptance tests. In this class, you need to point to an -endpoint, which should be verified.

abstract class BaseMockMvcSpec extends Specification {
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new PairIdController())
-	}
-
-	void isProperCorrelationId(Integer correlationId) {
-		assert correlationId == 123456
-	}
-
-	void isEmpty(String value) {
-		assert value == null
-	}
-
-}

If you use Explicit mode, you can use a base class to initialize the whole tested app -as you might see in regular integration tests. If you use the JAXRSCLIENT mode, this -base class should also contain a protected WebTarget webTarget field. Right now, the -only option to test the JAX-RS API is to start a web server.

4.1.11 Different Base Classes for Contracts

If your base classes differ between contracts, you can tell the Spring Cloud Contract -plugin which class should get extended by the autogenerated tests. You have two options:

  • Follow a convention by providing the packageWithBaseClasses
  • Provide explicit mapping via baseClassMappings

By Convention

The convention is such that if you have a contract under (for example) -src/test/resources/contract/foo/bar/baz/ and set the value of the -packageWithBaseClasses property to com.example.base, then Spring Cloud Contract -Verifier assumes that there is a BarBazBase class under the com.example.base package. -In other words, the system takes the last two parts of the package, if they exist, and -forms a class with a Base suffix. This rule takes precedence over baseClassForTests. -Here is an example of how it works in the contracts closure:

packageWithBaseClasses = 'com.example.base'

By Mapping

You can manually map a regular expression of the contract’s package to fully qualified -name of the base class for the matched contract. You have to provide a list called -baseClassMappings that consists baseClassMapping objects that takes a -contractPackageRegex to baseClassFQN mapping. Consider the following example:

baseClassForTests = "com.example.FooBase"
-baseClassMappings {
-	baseClassMapping('.*/com/.*', 'com.example.ComBase')
-	baseClassMapping('.*/bar/.*': 'com.example.BarBase')
-}

Let’s assume that you have contracts under - - src/test/resources/contract/com/ - - src/test/resources/contract/foo/

By providing the baseClassForTests, we have a fallback in case mapping did not succeed. -(You could also provide the packageWithBaseClasses as a fallback.) That way, the tests -generated from src/test/resources/contract/com/ contracts extend the -com.example.ComBase, whereas the rest of the tests extend com.example.FooBase.

4.1.12 Invoking Generated Tests

To ensure that the provider side is compliant with defined contracts, you need to invoke:

./gradlew generateContractTests test

4.1.13 Pushing stubs to SCM

If you’re using the SCM repository to keep the contracts and -stubs, you might want to automate the step of pushing stubs to -the repository. To do that, it’s enough to call the pushStubsToScm -task. Example:

$ ./gradlew pushStubsToScm

Under Section 10.6, “Using the SCM Stub Downloader” you can find all possible -configuration options that you can pass either via -the contractsProperties field e.g. contracts { contractsProperties = [foo:"bar"] }, -via contractsProperties method e.g. contracts { contractsProperties([foo:"bar"]) }, -a system property or an environment variable.

4.1.14 Spring Cloud Contract Verifier on the Consumer Side

In a consuming service, you need to configure the Spring Cloud Contract Verifier plugin -in exactly the same way as in case of provider. If you do not want to use Stub Runner -then you need to copy contracts stored in src/test/resources/contracts and generate -WireMock JSON stubs using:

./gradlew generateClientStubs
[Note]Note

The stubsOutputDir option has to be set for stub generation to work.

When present, JSON stubs can be used in automated tests of consuming a service.

@ContextConfiguration(loader == SpringApplicationContextLoader, classes == Application)
-class LoanApplicationServiceSpec extends Specification {
-
- @ClassRule
- @Shared
- WireMockClassRule wireMockRule == new WireMockClassRule()
-
- @Autowired
- LoanApplicationService sut
-
- def 'should successfully apply for loan'() {
-   given:
- 	LoanApplication application =
-			new LoanApplication(client: new Client(clientPesel: '12345678901'), amount: 123.123)
-   when:
-	LoanApplicationResult loanApplication == sut.loanApplication(application)
-   then:
-	loanApplication.loanApplicationStatus == LoanApplicationStatus.LOAN_APPLIED
-	loanApplication.rejectionReason == null
- }
-}

LoanApplication makes a call to FraudDetection service. This request is handled by a -WireMock server configured with stubs generated by Spring Cloud Contract Verifier.

4.2 Maven Project

To learn how to set up the Maven project for Spring Cloud Contract Verifier, read the -following sections:

4.2.1 Add maven plugin

Add the Spring Cloud Contract BOM in a fashion similar to this:

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-release.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Next, add the Spring Cloud Contract Verifier Maven plugin:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-		<convertToYaml>true</convertToYaml>
-	</configuration>
-</plugin>

You can read more in the -Spring -Cloud Contract Maven Plugin Documentation (example for 2.0.0.RELEASE version).

4.2.2 Maven and Rest Assured 2.0

By default, Rest Assured 3.x is added to the classpath. However, you can use Rest -Assured 2.x by adding it to the plugins classpath, as shown here:

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <packageWithBaseClasses>com.example</packageWithBaseClasses>
-    </configuration>
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-contract-verifier</artifactId>
-            <version>${spring-cloud-contract.version}</version>
-        </dependency>
-        <dependency>
-           <groupId>com.jayway.restassured</groupId>
-           <artifactId>rest-assured</artifactId>
-           <version>2.5.0</version>
-           <scope>compile</scope>
-        </dependency>
-        <dependency>
-           <groupId>com.jayway.restassured</groupId>
-           <artifactId>spring-mock-mvc</artifactId>
-           <version>2.5.0</version>
-           <scope>compile</scope>
-        </dependency>
-    </dependencies>
-</plugin>
-
-<dependencies>
-    <!-- all dependencies -->
-    <!-- you can exclude rest-assured from spring-cloud-contract-verifier -->
-    <dependency>
-       <groupId>com.jayway.restassured</groupId>
-       <artifactId>rest-assured</artifactId>
-       <version>2.5.0</version>
-       <scope>test</scope>
-    </dependency>
-    <dependency>
-       <groupId>com.jayway.restassured</groupId>
-       <artifactId>spring-mock-mvc</artifactId>
-       <version>2.5.0</version>
-       <scope>test</scope>
-    </dependency>
-</dependencies>

That way, the plugin automatically sees that Rest Assured 3.x is present on the classpath -and modifies the imports accordingly.

4.2.3 Snapshot versions for Maven

For Snapshot and Milestone versions, you have to add the following section to your -pom.xml, as shown here:

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

4.2.4 Add stubs

By default, Spring Cloud Contract Verifier is looking for stubs in the -src/test/resources/contracts directory. The directory containing stub definitions is -treated as a class name, and each stub definition is treated as a single test. We assume -that it contains at least one directory to be used as test class name. If there is more -than one level of nested directories, all except the last one is used as package name. -For example, with following structure:

src/test/resources/contracts/myservice/shouldCreateUser.groovy
-src/test/resources/contracts/myservice/shouldReturnUser.groovy

Spring Cloud Contract Verifier creates a test class named defaultBasePackage.MyService -with two methods

  • shouldCreateUser()
  • shouldReturnUser()

4.2.5 Run plugin

The plugin goal generateTests is assigned to be invoked in the phase called -generate-test-sources. If you want it to be part of your build process, you need not do -anything. If you just want to generate tests, invoke the generateTests goal.

4.2.6 Configure plugin

To change the default configuration, just add a configuration section to the plugin -definition or the execution definition, as shown here:

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <executions>
-        <execution>
-            <goals>
-                <goal>convert</goal>
-                <goal>generateStubs</goal>
-                <goal>generateTests</goal>
-            </goals>
-        </execution>
-    </executions>
-    <configuration>
-        <basePackageForTests>org.springframework.cloud.verifier.twitter.place</basePackageForTests>
-        <baseClassForTests>org.springframework.cloud.verifier.twitter.place.BaseMockMvcSpec</baseClassForTests>
-    </configuration>
-</plugin>

4.2.7 Configuration Options

  • testMode: Defines the mode for acceptance tests. By default, the mode is MockMvc, -which is based on Spring’s MockMvc. It can also be changed to WebTestClient, JaxRsClient or to -Explicit for real HTTP calls.
  • basePackageForTests: Specifies the base package for all generated tests. If not set, -the value is picked from baseClassForTests’s package and from `packageWithBaseClasses. -If neither of these values are set, then the value is set to -org.springframework.cloud.contract.verifier.tests.
  • ruleClassForTests: Specifies a rule that should be added to the generated test -classes.
  • baseClassForTests: Creates a base class for all generated tests. By default, if you -use Spock classes, the class is spock.lang.Specification.
  • contractsDirectory: Specifies a directory containing contracts written with the -GroovyDSL. The default directory is /src/test/resources/contracts.
  • generatedTestSourcesDir: Specifies the test source directory where tests generated -from the Groovy DSL should be placed. By default its value is -$buildDir/generated-test-sources/contracts.
  • generatedTestResourcesDir: Specifies the test resource directory where resources used by the tests generated
  • testFramework: Specifies the target test framework to be used. Currently, Spock, JUnit 4 (TestFramework.JUNIT) and -JUnit 5 are supported with JUnit 4 being the default framework.
  • packageWithBaseClasses: Defines a package where all the base classes reside. This -setting takes precedence over baseClassForTests. The convention is such that, if you -have a contract under (for example) src/test/resources/contract/foo/bar/baz/ and set -the value of the packageWithBaseClasses property to com.example.base, then Spring -Cloud Contract Verifier assumes that there is a BarBazBase class under the -com.example.base package. In other words, the system takes the last two parts of the -package, if they exist, and forms a class with a Base suffix.
  • baseClassMappings: Specifies a list of base class mappings that provide -contractPackageRegex, which is checked against the package where the contract is -located, and baseClassFQN, which maps to the fully qualified name of the base class for -the matched contract. For example, if you have a contract under -src/test/resources/contract/foo/bar/baz/ and map the property -.* → com.example.base.BaseClass, then the test class generated from these contracts -extends com.example.base.BaseClass. This setting takes precedence over -packageWithBaseClasses and baseClassForTests.
  • contractsProperties: a map containing properties to be passed to Spring Cloud Contract -components. Those properties might be used by e.g. inbuilt or custom Stub Downloaders.

If you want to download your contract definitions from a Maven repository, you can use -the following options:

  • contractDependency: The contract dependency that contains all the packaged contracts.
  • contractsPath: The path to the concrete contracts in the JAR with packaged contracts. -Defaults to groupid/artifactid where gropuid is slash separated.
  • contractsMode: Picks the mode in which stubs will be found and registered
  • deleteStubsAfterTest: If set to false will not remove any downloaded -contracts from temporary directories
  • contractsRepositoryUrl: URL to a repo with the artifacts that have contracts. If it is not provided, -use the current Maven ones.
  • contractsRepositoryUsername: The user name to be used to connect to the repo with contracts.
  • contractsRepositoryPassword: The password to be used to connect to the repo with contracts.
  • contractsRepositoryProxyHost: The proxy host to be used to connect to the repo with contracts.
  • contractsRepositoryProxyPort: The proxy port to be used to connect to the repo with contracts.

We cache only non-snapshot, explicitly provided versions (for example -+ or 1.0.0.BUILD-SNAPSHOT won’t get cached). By default, this feature is turned on.

Below you can find a list of experimental features you can turn on via the plugin:

  • convertToYaml: converts all DSLs to the declarative, YAML format. This can be extremely useful when you’re using external libraries in your Groovy DSLs. By turning this feature on (by setting it to true) you will not need to add the library dependency on the consumer side.
  • assertJsonSize: You can check the size of JSON arrays in the generated tests. This feature is disabled by default.

4.2.8 Single Base Class for All Tests

When using Spring Cloud Contract Verifier in default MockMvc, you need to create a base -specification for all generated acceptance tests. In this class, you need to point to an -endpoint, which should be verified.

package org.mycompany.tests
-
-import org.mycompany.ExampleSpringController
-import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc
-import spock.lang.Specification
-
-class MvcSpec extends Specification {
-  def setup() {
-   RestAssuredMockMvc.standaloneSetup(new ExampleSpringController())
-  }
-}

You can also setup the whole context if necessary.

import io.restassured.module.mockmvc.RestAssuredMockMvc;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.web.context.WebApplicationContext;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = SomeConfig.class, properties="some=property")
-public abstract class BaseTestClass {
-
-	@Autowired
-	WebApplicationContext context;
-
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.webAppContextSetup(this.context);
-	}
-}

If you use EXPLICIT mode, you can use a base class to initialize the whole tested app -similarly, as you might find in regular integration tests.

import io.restassured.RestAssured;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.web.server.LocalServerPort
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.web.context.WebApplicationContext;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = SomeConfig.class, properties="some=property")
-public abstract class BaseTestClass {
-
-	@LocalServerPort
-	int port;
-
-	@Before
-	public void setup() {
-		RestAssured.baseURI = "http://localhost:" + this.port;
-	}
-}

If you use the JAXRSCLIENT mode, this base class should also contain a protected WebTarget webTarget field. Right -now, the only option to test the JAX-RS API is to start a web server.

4.2.9 Different base classes for contracts

If your base classes differ between contracts, you can tell the Spring Cloud Contract -plugin which class should get extended by the autogenerated tests. You have two options:

  • Follow a convention by providing the packageWithBaseClasses
  • provide explicit mapping via baseClassMappings

By Convention

The convention is such that if you have a contract under (for example) -src/test/resources/contract/foo/bar/baz/ and set the value of the -packageWithBaseClasses property to com.example.base, then Spring Cloud Contract -Verifier assumes that there is a BarBazBase class under the com.example.base package. -In other words, the system takes the last two parts of the package, if they exist, and -forms a class with a Base suffix. This rule takes precedence over baseClassForTests. -Here is an example of how it works in the contracts closure:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<packageWithBaseClasses>hello</packageWithBaseClasses>
-	</configuration>
-</plugin>

By Mapping

You can manually map a regular expression of the contract’s package to fully qualified -name of the base class for the matched contract. You have to provide a list called -baseClassMappings that consists baseClassMapping objects that takes a -contractPackageRegex to baseClassFQN mapping. Consider the following example:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<baseClassForTests>com.example.FooBase</baseClassForTests>
-		<baseClassMappings>
-			<baseClassMapping>
-				<contractPackageRegex>.*com.*</contractPackageRegex>
-				<baseClassFQN>com.example.TestBase</baseClassFQN>
-			</baseClassMapping>
-		</baseClassMappings>
-	</configuration>
-</plugin>

Assume that you have contracts under these two locations: -* src/test/resources/contract/com/ -* src/test/resources/contract/foo/

By providing the baseClassForTests, we have a fallback in case mapping did not succeed. -(You can also provide the packageWithBaseClasses as a fallback.) That way, the tests -generated from src/test/resources/contract/com/ contracts extend the -com.example.ComBase, whereas the rest of the tests extend com.example.FooBase.

4.2.10 Invoking generated tests

The Spring Cloud Contract Maven Plugin generates verification code in a directory called -/generated-test-sources/contractVerifier and attaches this directory to testCompile -goal.

For Groovy Spock code, use the following:

<plugin>
-	<groupId>org.codehaus.gmavenplus</groupId>
-	<artifactId>gmavenplus-plugin</artifactId>
-	<version>1.5</version>
-	<executions>
-		<execution>
-			<goals>
-				<goal>testCompile</goal>
-			</goals>
-		</execution>
-	</executions>
-	<configuration>
-		<testSources>
-			<testSource>
-				<directory>${project.basedir}/src/test/groovy</directory>
-				<includes>
-					<include>**/*.groovy</include>
-				</includes>
-			</testSource>
-			<testSource>
-				<directory>${project.build.directory}/generated-test-sources/contractVerifier</directory>
-				<includes>
-					<include>**/*.groovy</include>
-				</includes>
-			</testSource>
-		</testSources>
-	</configuration>
-</plugin>

To ensure that provider side is compliant with defined contracts, you need to invoke -mvn generateTest test.

4.2.11 Pushing stubs to SCM

If you’re using the SCM repository to keep the contracts and -stubs, you might want to automate the step of pushing stubs to -the repository. To do that, it’s enough to add the pushStubsToScm -goal. Example:

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <!-- Base class mappings etc. -->
-
-        <!-- We want to pick contracts from a Git repository -->
-        <contractsRepositoryUrl>git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git</contractsRepositoryUrl>
-
-        <!-- We reuse the contract dependency section to set up the path
-        to the folder that contains the contract definitions. In our case the
-        path will be /groupId/artifactId/version/contracts -->
-        <contractDependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>${project.artifactId}</artifactId>
-            <version>${project.version}</version>
-        </contractDependency>
-
-        <!-- The contracts mode can't be classpath -->
-        <contractsMode>REMOTE</contractsMode>
-    </configuration>
-    <executions>
-        <execution>
-            <phase>package</phase>
-            <goals>
-                <!-- By default we will not push the stubs back to SCM,
-                you have to explicitly add it as a goal -->
-                <goal>pushStubsToScm</goal>
-            </goals>
-        </execution>
-    </executions>
-</plugin>

Under Section 10.6, “Using the SCM Stub Downloader” you can find all possible -configuration options that you can pass either via -the <configuration><contractProperties> map, a system property -or an environment variable.

4.2.12 Maven Plugin and STS

If you see the following exception while using STS:

STS Exception

When you click on the error marker you should see something like this:

 plugin:1.1.0.M1:convert:default-convert:process-test-resources) org.apache.maven.plugin.PluginExecutionException: Execution default-convert of goal org.springframework.cloud:spring-
- cloud-contract-maven-plugin:1.1.0.M1:convert failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at
- org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331) at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362) at
-...
- org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: java.lang.NullPointerException at
- org.eclipse.m2e.core.internal.builder.plexusbuildapi.EclipseIncrementalBuildContext.hasDelta(EclipseIncrementalBuildContext.java:53) at
- org.sonatype.plexus.build.incremental.ThreadBuildContext.hasDelta(ThreadBuildContext.java:59) at

In order to fix this issue, provide the following section in your pom.xml:

<build>
-    <pluginManagement>
-        <plugins>
-            <!--This plugin's configuration is used to store Eclipse m2e settings
-                only. It has no influence on the Maven build itself. -->
-            <plugin>
-                <groupId>org.eclipse.m2e</groupId>
-                <artifactId>lifecycle-mapping</artifactId>
-                <version>1.0.0</version>
-                <configuration>
-                    <lifecycleMappingMetadata>
-                        <pluginExecutions>
-                             <pluginExecution>
-                                <pluginExecutionFilter>
-                                    <groupId>org.springframework.cloud</groupId>
-                                    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-                                    <versionRange>[1.0,)</versionRange>
-                                    <goals>
-                                        <goal>convert</goal>
-                                    </goals>
-                                </pluginExecutionFilter>
-                                <action>
-                                    <execute />
-                                </action>
-                             </pluginExecution>
-                        </pluginExecutions>
-                    </lifecycleMappingMetadata>
-                </configuration>
-            </plugin>
-        </plugins>
-    </pluginManagement>
-</build>

4.2.13 Maven Plugin with Spock Tests

You can select the Spock Framework for creating and executing the auto-generated contract -verification tests with both Maven and Gradle plugin. However, whereas with Gradle its really straightforward, -in Maven you will require some additional setup in order to make the tests compile and execute properly.

First of all, you will have to use a plugin, such as GMavenPlus plugin, -to add Groovy to your project. In GMavenPlus plugin, you will need to explicitly set test sources, including both the -path where your base test classes are defined and the path were the generated contract tests are added. -Please refer to the example below:

If you uphold to the Spock convention of ending the test class names with Spec, you will also need to adjust your Maven -Surefire plugin setup, like in the following example:

4.3 Stubs and Transitive Dependencies

The Maven and Gradle plugin that add the tasks that create the stubs jar for you. One -problem that arises is that, when reusing the stubs, you can mistakenly import all of -that stub’s dependencies. When building a Maven artifact, even though you have a couple -of different jars, all of them share one pom:

├── github-webhook-0.0.1.BUILD-20160903.075506-1-stubs.jar
-├── github-webhook-0.0.1.BUILD-20160903.075506-1-stubs.jar.sha1
-├── github-webhook-0.0.1.BUILD-20160903.075655-2-stubs.jar
-├── github-webhook-0.0.1.BUILD-20160903.075655-2-stubs.jar.sha1
-├── github-webhook-0.0.1.BUILD-SNAPSHOT.jar
-├── github-webhook-0.0.1.BUILD-SNAPSHOT.pom
-├── github-webhook-0.0.1.BUILD-SNAPSHOT-stubs.jar
-├── ...
-└── ...

There are three possibilities of working with those dependencies so as not to have any -issues with transitive dependencies:

  • Mark all application dependencies as optional
  • Create a separate artifactid for the stubs
  • Exclude dependencies on the consumer side

Mark all application dependencies as optional

If, in the github-webhook application, you mark all of your dependencies as optional, -when you include the github-webhook stubs in another application (or when that -dependency gets downloaded by Stub Runner) then, since all of the dependencies are -optional, they will not get downloaded.

Create a separate artifactid for the stubs

If you create a separate artifactid, then you can set it up in whatever way you wish. -For example, you might decide to have no dependencies at all.

Exclude dependencies on the consumer side

As a consumer, if you add the stub dependency to your classpath, you can explicitly -exclude the unwanted dependencies.

4.4 Scenarios

You can handle scenarios with Spring Cloud Contract Verifier. All you need to do is to -stick to the proper naming convention while creating your contracts. The convention -requires including an order number followed by an underscore. This will work regardles - of whether you’re working with YAML or Groovy. Example:

my_contracts_dir\
-  scenario1\
-    1_login.groovy
-    2_showCart.groovy
-    3_logout.groovy

Such a tree causes Spring Cloud Contract Verifier to generate WireMock’s scenario with a -name of scenario1 and the three following steps:

  1. login marked as Started pointing to…​
  2. showCart marked as Step1 pointing to…​
  3. logout marked as Step2 which will close the scenario.

More details about WireMock scenarios can be found at -http://wiremock.org/docs/stateful-behaviour/

Spring Cloud Contract Verifier also generates tests with a guaranteed order of execution.

4.5 Docker Project

We’re publishing a springcloud/spring-cloud-contract Docker image -that contains a project that will generate tests and execute them in EXPLICIT mode -against a running application.

[Tip]Tip

The EXPLICIT mode means that the tests generated from contracts will send -real requests and not the mocked ones.

4.5.1 Short intro to Maven, JARs and Binary storage

Since the Docker image can be used by non JVM projects, it’s good to -explain the basic terms behind Spring Cloud Contract packaging defaults.

Part of the following definitions were taken from the Maven Glossary

  • Project: Maven thinks in terms of projects. Everything that you -will build are projects. Those projects follow a well defined -“Project Object Model”. Projects can depend on other projects, -in which case the latter are called “dependencies”. A project may -consistent of several subprojects, however these subprojects are still -treated equally as projects.
  • Artifact: An artifact is something that is either produced or used -by a project. Examples of artifacts produced by Maven for a project -include: JARs, source and binary distributions. Each artifact -is uniquely identified by a group id and an artifact ID which is -unique within a group.
  • JAR: JAR stands for Java ARchive. It’s a format based on -the ZIP file format. Spring Cloud Contract packages the contracts and generated -stubs in a JAR file.
  • GroupId: A group ID is a universally unique identifier for a project. -While this is often just the project name (eg. commons-collections), -it is helpful to use a fully-qualified package name to distinguish it -from other projects with a similar name (eg. org.apache.maven). -Typically, when published to the Artifact Manager, the GroupId will get -slash separated and form part of the URL. E.g. for group id com.example -and artifact id application would be /com/example/application/.
  • Classifier: The Maven dependency notation looks as follows: -groupId:artifactId:version:classifier. The classifier is additional suffix -passed to the dependency. E.g. stubs, sources. The same dependency -e.g. com.example:application can produce multiple artifacts that -differ from each other with the classifier.
  • Artifact manager: When you generate binaries / sources / packages, you would -like them to be available for others to download / reference or reuse. In case -of the JVM world those artifacts would be JARs, for Ruby these are gems -and for Docker those would be Docker images. You can store those artifacts -in a manager. Examples of such managers can be Artifactory -or Nexus.

4.5.2 How it works

The image searches for contracts under the /contracts folder. -The output from running the tests will be available under -/spring-cloud-contract/build folder (it’s useful for debugging -purposes).

It’s enough for you to mount your contracts, pass the environment variables - and the image will:

  • generate the contract tests
  • execute the tests against the provided URL
  • generate the WireMock stubs
  • (optional - turned on by default) publish the stubs to a Artifact Manager

Environment Variables

The Docker image requires some environment variables to point to -your running application, to the Artifact manager instance etc.

  • PROJECT_GROUP - your project’s group id. Defaults to com.example
  • PROJECT_VERSION - your project’s version. Defaults to 0.0.1-SNAPSHOT
  • PROJECT_NAME - artifact id. Defaults to example
  • REPO_WITH_BINARIES_URL - URL of your Artifact Manager. Defaults to http://localhost:8081/artifactory/libs-release-local -which is the default URL of Artifactory running locally
  • REPO_WITH_BINARIES_USERNAME - (optional) username when the Artifact Manager is secured
  • REPO_WITH_BINARIES_PASSWORD - (optional) password when the Artifact Manager is secured
  • PUBLISH_ARTIFACTS - if set to true then will publish artifact to binary storage. Defaults to true.

These environment variables are used when contracts lay in an external repository. To enable -this feature you must set the EXTERNAL_CONTRACTS_ARTIFACT_ID environment variable.

  • EXTERNAL_CONTRACTS_GROUP_ID - group id of the project with contracts. Defaults to com.example
  • EXTERNAL_CONTRACTS_ARTIFACT_ID- artifact id of the project with contracts.
  • EXTERNAL_CONTRACTS_CLASSIFIER- classifier of the project with contracts. Empty by default
  • EXTERNAL_CONTRACTS_VERSION - version of the project with contracts. Defaults to +, equivalent to picking the latest
  • EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL - URL of your Artifact Manager. Defaults to value of REPO_WITH_BINARIES_URL env var. -If that’s not set, defaults to http://localhost:8081/artifactory/libs-release-local -which is the default URL of Artifactory running locally
  • EXTERNAL_CONTRACTS_PATH - path to contracts for the given project, inside the project with contracts. -Defaults to slash separated EXTERNAL_CONTRACTS_GROUP_ID concatenated with / and EXTERNAL_CONTRACTS_ARTIFACT_ID. E.g. -for group id foo.bar and artifact id baz, would result in foo/bar/baz contracts path.
  • EXTERNAL_CONTRACTS_WORK_OFFLINE - if set to true then will retrieve artifact with contracts -from the container’s .m2. Mount your local .m2 as a volume available at the container’s /root/.m2 path. -You must not set both EXTERNAL_CONTRACTS_WORK_OFFLINE and EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL.

These environment variables are used when tests are executed:

  • APPLICATION_BASE_URL - url against which tests should be executed. -Remember that it has to be accessible from the Docker container (e.g. localhost -will not work)
  • APPLICATION_USERNAME - (optional) username for basic authentication to your application
  • APPLICATION_PASSWORD - (optional) password for basic authentication to your application

4.5.3 Example of usage

Let’s take a look at a simple MVC application

$ git clone https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs
-$ cd bookstore

The contracts are available under /contracts folder.

4.5.4 Server side (nodejs)

Since we want to run tests, we could just execute:

$ npm test

however, for learning purposes, let’s split it into pieces:

# Stop docker infra (nodejs, artifactory)
-$ ./stop_infra.sh
-# Start docker infra (nodejs, artifactory)
-$ ./setup_infra.sh
-
-# Kill & Run app
-$ pkill -f "node app"
-$ nohup node app &
-
-# Prepare environment variables
-$ SC_CONTRACT_DOCKER_VERSION="..."
-$ APP_IP="192.168.0.100"
-$ APP_PORT="3000"
-$ ARTIFACTORY_PORT="8081"
-$ APPLICATION_BASE_URL="http://${APP_IP}:${APP_PORT}"
-$ ARTIFACTORY_URL="http://${APP_IP}:${ARTIFACTORY_PORT}/artifactory/libs-release-local"
-$ CURRENT_DIR="$( pwd )"
-$ CURRENT_FOLDER_NAME=${PWD##*/}
-$ PROJECT_VERSION="0.0.1.RELEASE"
-
-# Execute contract tests
-$ docker run  --rm -e "APPLICATION_BASE_URL=${APPLICATION_BASE_URL}" -e "PUBLISH_ARTIFACTS=true" -e "PROJECT_NAME=${CURRENT_FOLDER_NAME}" -e "REPO_WITH_BINARIES_URL=${ARTIFACTORY_URL}" -e "PROJECT_VERSION=${PROJECT_VERSION}" -v "${CURRENT_DIR}/contracts/:/contracts:ro" -v "${CURRENT_DIR}/node_modules/spring-cloud-contract/output:/spring-cloud-contract-output/" springcloud/spring-cloud-contract:"${SC_CONTRACT_DOCKER_VERSION}"
-
-# Kill app
-$ pkill -f "node app"

What will happen is that via bash scripts:

  • infrastructure will be set up (MongoDb, Artifactory). -In real life scenario you would just run the NodeJS application -with mocked database. In this example we want to show how we can -benefit from Spring Cloud Contract in no time.
  • due to those constraints the contracts also represent the -stateful situation

    • first request is a POST that causes data to get inserted to the database
    • second request is a GET that returns a list of data with 1 previously inserted element
  • the NodeJS application will be started (on port 3000)
  • contract tests will be generated via Docker and tests -will be executed against the running application

    • the contracts will be taken from /contracts folder.
    • the output of the test execution is available under -node_modules/spring-cloud-contract/output.
  • the stubs will be uploaded to Artifactory. You can check them out -under http://localhost:8081/artifactory/libs-release-local/com/example/bookstore/0.0.1.RELEASE/ . -The stubs will be here http://localhost:8081/artifactory/libs-release-local/com/example/bookstore/0.0.1.RELEASE/bookstore-0.0.1.RELEASE-stubs.jar.

To see how the client side looks like check out the Section 6.9, “Stub Runner Docker” section.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__spring_cloud_contract_wiremock.html b/multi/multi__spring_cloud_contract_wiremock.html index 2c0a108feb..a5ffb82f50 100644 --- a/multi/multi__spring_cloud_contract_wiremock.html +++ b/multi/multi__spring_cloud_contract_wiremock.html @@ -1,323 +1,13 @@ - - - 11. Spring Cloud Contract WireMock

11. Spring Cloud Contract WireMock

The Spring Cloud Contract WireMock modules let you use WireMock in a -Spring Boot application. Check out the -samples -for more details.

If you have a Spring Boot application that uses Tomcat as an embedded server (which is -the default with spring-boot-starter-web), you can add -spring-cloud-starter-contract-stub-runner to your classpath and add @AutoConfigureWireMock in -order to be able to use Wiremock in your tests. Wiremock runs as a stub server and you -can register stub behavior using a Java API or via static JSON declarations as part of -your test. The following code shows an example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-@AutoConfigureWireMock(port = 0)
-public class WiremockForDocsTests {
+
 
-	// A service that calls out over HTTP
-	@Autowired
-	private Service service;
+
+
 
-	@Before
-	public void setup() {
-		this.service.setBase("http://localhost:"
-				+ this.environment.getProperty("wiremock.server.port"));
-	}
+
 
-	// Using the WireMock APIs in the normal way:
-	@Test
-	public void contextLoads() throws Exception {
-		// Stubbing WireMock
-		stubFor(get(urlEqualTo("/resource")).willReturn(aResponse()
-				.withHeader("Content-Type", "text/plain").withBody("Hello World!")));
-		// We're asserting if WireMock responded properly
-		assertThat(this.service.go()).isEqualTo("Hello World!");
-	}
+Page Redirection
 
-}

To start the stub server on a different port use (for example), -@AutoConfigureWireMock(port=9999). For a random port, use a value of 0. The stub -server port can be bound in the test application context with the "wiremock.server.port" -property. Using @AutoConfigureWireMock adds a bean of type WiremockConfiguration to -your test application context, where it will be cached in between methods and classes -having the same context, the same as for Spring integration tests. Also you can inject a bean of type WireMockServer into your test.

11.1 Registering Stubs Automatically

If you use @AutoConfigureWireMock, it registers WireMock JSON stubs from the file -system or classpath (by default, from file:src/test/resources/mappings). You can -customize the locations using the stubs attribute in the annotation, which can be an -Ant-style resource pattern or a directory. In the case of a directory, */.json is -appended. The following code shows an example:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureWireMock(stubs="classpath:/stubs")
-public class WiremockImportApplicationTests {
-
-	@Autowired
-	private Service service;
-
-	@Test
-	public void contextLoads() throws Exception {
-		assertThat(this.service.go()).isEqualTo("Hello World!");
-	}
-
-}
[Note]Note

Actually, WireMock always loads mappings from src/test/resources/mappings as -well as the custom locations in the stubs attribute. To change this behavior, you can -also specify a files root as described in the next section of this document.

If you’re using Spring Cloud Contract’s default stub jars, then your -stubs are stored under /META-INF/group-id/artifact-id/versions/mappings/ folder. If you want to register all stubs from that location, from all embedded JARs, then it’s enough to use the following syntax.

@AutoConfigureWireMock(port = 0, stubs = "classpath*:/META-INF/**/mappings/**/*.json")

11.2 Using Files to Specify the Stub Bodies

WireMock can read response bodies from files on the classpath or the file system. In that -case, you can see in the JSON DSL that the response has a bodyFileName instead of a -(literal) body. The files are resolved relative to a root directory (by default, -src/test/resources/__files). To customize this location you can set the files -attribute in the @AutoConfigureWireMock annotation to the location of the parent -directory (in other words, __files is a subdirectory). You can use Spring resource -notation to refer to file:…​ or classpath:…​ locations. Generic URLs are not -supported. A list of values can be given, in which case WireMock resolves the first file -that exists when it needs to find a response body.

[Note]Note

When you configure the files root, it also affects the -automatic loading of stubs, because they come from the root location -in a subdirectory called "mappings". The value of files has no -effect on the stubs loaded explicitly from the stubs attribute.

11.3 Alternative: Using JUnit Rules

For a more conventional WireMock experience, you can use JUnit @Rules to start and stop -the server. To do so, use the WireMockSpring convenience class to obtain an Options -instance, as shown in the following example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-public class WiremockForDocsClassRuleTests {
-
-	// Start WireMock on some dynamic port
-	// for some reason `dynamicPort()` is not working properly
-	@ClassRule
-	public static WireMockClassRule wiremock = new WireMockClassRule(
-			WireMockSpring.options().dynamicPort());
-
-	// A service that calls out over HTTP to wiremock's port
-	@Autowired
-	private Service service;
-
-	@Before
-	public void setup() {
-		this.service.setBase("http://localhost:" + wiremock.port());
-	}
-
-	// Using the WireMock APIs in the normal way:
-	@Test
-	public void contextLoads() throws Exception {
-		// Stubbing WireMock
-		wiremock.stubFor(get(urlEqualTo("/resource")).willReturn(aResponse()
-				.withHeader("Content-Type", "text/plain").withBody("Hello World!")));
-		// We're asserting if WireMock responded properly
-		assertThat(this.service.go()).isEqualTo("Hello World!");
-	}
-
-}

The @ClassRule means that the server shuts down after all the methods in this class -have been run.

11.4 Relaxed SSL Validation for Rest Template

WireMock lets you stub a "secure" server with an "https" URL protocol. If your -application wants to contact that stub server in an integration test, it will find that -the SSL certificates are not valid (the usual problem with self-installed certificates). -The best option is often to re-configure the client to use "http". If that’s not an -option, you can ask Spring to configure an HTTP client that ignores SSL validation errors -(do so only for tests, of course).

To make this work with minimum fuss, you need to be using the Spring Boot -RestTemplateBuilder in your app, as shown in the following example:

@Bean
-public RestTemplate restTemplate(RestTemplateBuilder builder) {
-	return builder.build();
-}

You need RestTemplateBuilder because the builder is passed through callbacks to -initialize it, so the SSL validation can be set up in the client at that point. This -happens automatically in your test if you are using the @AutoConfigureWireMock -annotation or the stub runner. If you use the JUnit @Rule approach, you need to add the -@AutoConfigureHttpClient annotation as well, as shown in the following example:

@RunWith(SpringRunner.class)
-@SpringBootTest("app.baseUrl=https://localhost:6443")
-@AutoConfigureHttpClient
-public class WiremockHttpsServerApplicationTests {
-
-	@ClassRule
-	public static WireMockClassRule wiremock = new WireMockClassRule(
-			WireMockSpring.options().httpsPort(6443));
-...
-}

If you are using spring-boot-starter-test, you have the Apache HTTP client on the -classpath and it is selected by the RestTemplateBuilder and configured to ignore SSL -errors. If you use the default java.net client, you do not need the annotation (but it -won’t do any harm). There is no support currently for other clients, but it may be added -in future releases.

To disable the custom RestTemplateBuilder, set the wiremock.rest-template-ssl-enabled -property to false.

11.5 WireMock and Spring MVC Mocks

Spring Cloud Contract provides a convenience class that can load JSON WireMock stubs into -a Spring MockRestServiceServer. The following code shows an example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.NONE)
-public class WiremockForDocsMockServerApplicationTests {
-
-	@Autowired
-	private RestTemplate restTemplate;
-
-	@Autowired
-	private Service service;
-
-	@Test
-	public void contextLoads() throws Exception {
-		// will read stubs classpath
-		MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate)
-				.baseUrl("https://example.org").stubs("classpath:/stubs/resource.json")
-				.build();
-		// We're asserting if WireMock responded properly
-		assertThat(this.service.go()).isEqualTo("Hello World");
-		server.verify();
-	}
-
-}

The baseUrl value is prepended to all mock calls, and the stubs() method takes a stub -path resource pattern as an argument. In the preceding example, the stub defined at -/stubs/resource.json is loaded into the mock server. If the RestTemplate is asked to -visit https://example.org/, it gets the responses as being declared at that URL. More -than one stub pattern can be specified, and each one can be a directory (for a recursive -list of all ".json"), a fixed filename (as in the example above), or an Ant-style -pattern. The JSON format is the normal WireMock format, which you can read about in the -WireMock website.

Currently, the Spring Cloud Contract Verifier supports Tomcat, Jetty, and Undertow as -Spring Boot embedded servers, and Wiremock itself has "native" support for a particular -version of Jetty (currently 9.2). To use the native Jetty, you need to add the native -Wiremock dependencies and exclude the Spring Boot container (if there is one).

11.6 Customization of WireMock configuration

You can register a bean of org.springframework.cloud.contract.wiremock.WireMockConfigurationCustomizer type -in order to customize the WireMock configuration (e.g. add custom transformers). -Example:

		@Bean
-		WireMockConfigurationCustomizer optionsCustomizer() {
-			return new WireMockConfigurationCustomizer() {
-				@Override
-				public void customize(WireMockConfiguration options) {
-// perform your customization here
-				}
-			};
-		}

11.7 Generating Stubs using REST Docs

Spring REST Docs can be used to generate -documentation (for example in Asciidoctor format) for an HTTP API with Spring MockMvc -or WebTestClient or Rest Assured. At the same time that you generate documentation for your API, you can also -generate WireMock stubs by using Spring Cloud Contract WireMock. To do so, write your -normal REST Docs test cases and use @AutoConfigureRestDocs to have stubs be -automatically generated in the REST Docs output directory. The following code shows an -example using MockMvc:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureRestDocs(outputDir = "target/snippets")
-@AutoConfigureMockMvc
-public class ApplicationTests {
-
-	@Autowired
-	private MockMvc mockMvc;
-
-	@Test
-	public void contextLoads() throws Exception {
-		mockMvc.perform(get("/resource"))
-				.andExpect(content().string("Hello World"))
-				.andDo(document("resource"));
-	}
-}

This test generates a WireMock stub at "target/snippets/stubs/resource.json". It matches -all GET requests to the "/resource" path. The same example with WebTestClient (used -for testing Spring WebFlux applications) would look like this:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureRestDocs(outputDir = "target/snippets")
-@AutoConfigureWebTestClient
-public class ApplicationTests {
-
-	@Autowired
-	private WebTestClient client;
-
-	@Test
-	public void contextLoads() throws Exception {
-		client.get().uri("/resource").exchange()
-				.expectBody(String.class).isEqualTo("Hello World")
- 				.consumeWith(document("resource"));
-	}
-}

Without any additional configuration, these tests create a stub with a request matcher -for the HTTP method and all headers except "host" and "content-length". To match the -request more precisely (for example, to match the body of a POST or PUT), we need to -explicitly create a request matcher. Doing so has two effects:

  • Creating a stub that matches only in the way you specify.
  • Asserting that the request in the test case also matches the same conditions.

The main entry point for this feature is WireMockRestDocs.verify(), which can be used -as a substitute for the document() convenience method, as shown in the following -example:

import static org.springframework.cloud.contract.wiremock.restdocs.WireMockRestDocs.verify;
@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureRestDocs(outputDir = "target/snippets")
-@AutoConfigureMockMvc
-public class ApplicationTests {
-
-	@Autowired
-	private MockMvc mockMvc;
-
-	@Test
-	public void contextLoads() throws Exception {
-		mockMvc.perform(post("/resource")
-                .content("{\"id\":\"123456\",\"message\":\"Hello World\"}"))
-				.andExpect(status().isOk())
-				.andDo(verify().jsonPath("$.id")
-                        .stub("resource"));
-	}
-}

This contract specifies that any valid POST with an "id" field receives the response -defined in this test. You can chain together calls to .jsonPath() to add additional -matchers. If JSON Path is unfamiliar, The JayWay -documentation can help you get up to speed. The WebTestClient version of this test -has a similar verify() static helper that you insert in the same place.

Instead of the jsonPath and contentType convenience methods, you can also use the -WireMock APIs to verify that the request matches the created stub, as shown in the -following example:

@Test
-public void contextLoads() throws Exception {
-	mockMvc.perform(post("/resource")
-               .content("{\"id\":\"123456\",\"message\":\"Hello World\"}"))
-			.andExpect(status().isOk())
-			.andDo(verify()
-					.wiremock(WireMock.post(
-						urlPathEquals("/resource"))
-						.withRequestBody(matchingJsonPath("$.id"))
-                       .stub("post-resource"));
-}

The WireMock API is rich. You can match headers, query parameters, and request body by -regex as well as by JSON path. These features can be used to create stubs with a wider -range of parameters. The above example generates a stub resembling the following example:

post-resource.json.  -

{
-  "request" : {
-    "url" : "/resource",
-    "method" : "POST",
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$.id"
-    }]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "Hello World",
-    "headers" : {
-      "X-Application-Context" : "application:-1",
-      "Content-Type" : "text/plain"
-    }
-  }
-}

-

[Note]Note

You can use either the wiremock() method or the jsonPath() and contentType() -methods to create request matchers, but you can’t use both approaches.

On the consumer side, you can make the resource.json generated earlier in this section -available on the classpath (by -<<publishing-stubs-as-jars], for example). After that, you can create a stub using WireMock in a -number of different ways, including by using -@AutoConfigureWireMock(stubs="classpath:resource.json"), as described earlier in this -document.

11.8 Generating Contracts by Using REST Docs

You can also generate Spring Cloud Contract DSL files and documentation with Spring REST -Docs. If you do so in combination with Spring Cloud WireMock, you get both the contracts -and the stubs.

Why would you want to use this feature? Some people in the community asked questions -about a situation in which they would like to move to DSL-based contract definition, -but they already have a lot of Spring MVC tests. Using this feature lets you generate -the contract files that you can later modify and move to folders (defined in your -configuration) so that the plugin finds them.

[Tip]Tip

You might wonder why this functionality is in the WireMock module. The functionality -is there because it makes sense to generate both the contracts and the stubs.

Consider the following test:

		this.mockMvc
-				.perform(post("/foo").accept(MediaType.APPLICATION_PDF)
-						.accept(MediaType.APPLICATION_JSON)
-						.contentType(MediaType.APPLICATION_JSON)
-						.content("{\"foo\": 23, \"bar\" : \"baz\" }"))
-				.andExpect(status().isOk()).andExpect(content().string("bar"))
-				// first WireMock
-				.andDo(WireMockRestDocs.verify().jsonPath("$[?(@.foo >= 20)]")
-						.jsonPath("$[?(@.bar in ['baz','bazz','bazzz'])]")
-						.contentType(MediaType.valueOf("application/json"))
-						.stub("shouldGrantABeerIfOldEnough"))
-				// then Contract DSL documentation
-				.andDo(document("index", SpringCloudContractRestDocs.dslContract()));

The preceding test creates the stub presented in the previous section, generating both -the contract and a documentation file.

The contract is called index.groovy and might look like the following example:

import org.springframework.cloud.contract.spec.Contract
-
-Contract.make {
-    request {
-        method 'POST'
-        url '/foo'
-        body('''
-            {"foo": 23 }
-        ''')
-        headers {
-            header('''Accept''', '''application/json''')
-            header('''Content-Type''', '''application/json''')
-        }
-    }
-    response {
-        status OK()
-        body('''
-        bar
-        ''')
-        headers {
-            header('''Content-Type''', '''application/json;charset=UTF-8''')
-            header('''Content-Length''', '''3''')
-        }
-        testMatchers {
-            jsonPath('$[?(@.foo >= 20)]', byType())
-        }
-    }
-}

The generated document (formatted in Asciidoc in this case) contains a formatted -contract. The location of this file would be index/dsl-contract.adoc.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__stub_runner_for_messaging.html b/multi/multi__stub_runner_for_messaging.html index ea7e6ce6d9..a5ffb82f50 100644 --- a/multi/multi__stub_runner_for_messaging.html +++ b/multi/multi__stub_runner_for_messaging.html @@ -1,294 +1,13 @@ - - - 7. Stub Runner for Messaging

7. Stub Runner for Messaging

Stub Runner can run the published stubs in memory. It can integrate with the following -frameworks:

  • Spring Integration
  • Spring Cloud Stream
  • Spring AMQP

It also provides entry points to integrate with any other solution on the market.

[Important]Important

If you have multiple frameworks on the classpath Stub Runner will need to -define which one should be used. Let’s assume that you have both AMQP, Spring Cloud Stream and Spring Integration -on the classpath. Then you need to set stubrunner.stream.enabled=false and stubrunner.integration.enabled=false. -That way the only remaining framework is Spring AMQP.

7.1 Stub triggering

To trigger a message, use the StubTrigger interface:

package org.springframework.cloud.contract.stubrunner;
+
 
-import java.util.Collection;
-import java.util.Map;
+
+
 
-public interface StubTrigger {
+
 
-	/**
-	 * Triggers an event by a given label for a given {@code groupid:artifactid} notation. You can use only {@code artifactId} too.
-	 *
-	 * Feature related to messaging.
-	 *
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger(String ivyNotation, String labelName);
+Page Redirection
 
-	/**
-	 * Triggers an event by a given label.
-	 *
-	 * Feature related to messaging.
-	 *
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger(String labelName);
-
-	/**
-	 * Triggers all possible events.
-	 *
-	 * Feature related to messaging.
-	 *
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger();
-
-	/**
-	 * Returns a mapping of ivy notation of a dependency to all the labels it has.
-	 *
-	 * Feature related to messaging.
-	 */
-	Map<String, Collection<String>> labels();
-}

For convenience, the StubFinder interface extends StubTrigger, so you only need one -or the other in your tests.

StubTrigger gives you the following options to trigger a message:

7.1.1 Trigger by Label

stubFinder.trigger('return_book_1')

7.1.2 Trigger by Group and Artifact Ids

stubFinder.trigger('org.springframework.cloud.contract.verifier.stubs:streamService', 'return_book_1')

7.1.3 Trigger by Artifact Ids

stubFinder.trigger('streamService', 'return_book_1')

7.1.4 Trigger All Messages

stubFinder.trigger()

7.2 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.2.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.2.2 Disabling the functionality

If you need to disable this functionality, set the -stubrunner.integration.enabled=false property.

Assume that you have the following Maven repository with deployed stubs for the -integrationService application:

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── integrationService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── integrationService-0.0.1-SNAPSHOT.pom
-                            │   ├── integrationService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

Further assume the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Consider the following contracts (numbered 1):

Contract.make {
-	label 'return_book_1'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

Now consider 2:

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and the following Spring Integration Route:

<?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"
-			 xsi:schemaLocation="http://www.springframework.org/schema/beans
-			https://www.springframework.org/schema/beans/spring-beans.xsd
-			http://www.springframework.org/schema/integration
-			https://www.springframework.org/schema/integration/spring-integration.xsd">
-
-
-	<!-- REQUIRED FOR TESTING -->
-	<bridge input-channel="output"
-			output-channel="outputTest"/>
-
-	<channel id="outputTest">
-		<queue/>
-	</channel>
-
-</beans:beans>

These examples lend themselves to three scenarios:

Scenario 1 (no input message)

To trigger a message via the return_book_1 label, use the StubTigger interface, as -follows:

stubFinder.trigger('return_book_1')

To listen to the output of the message sent to output:

Message<?> receivedMessage = messaging.receive('outputTest')

The received message would pass the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input)

Since the route is set for you, you can send a message to the output -destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'input')

To listen to the output of the message sent to output:

Message<?> receivedMessage = messaging.receive('outputTest')

The received message passes the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 3 (input with no output)

Since the route is set for you, you can send a message to the input destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')

7.3 Stub Runner Stream

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

[Warning]Warning

If Stub Runner’s integration with Stream the messageFrom or sentTo Strings -are resolved first as a destination of a channel and no such destination exists, the -destination is resolved as a channel name.

[Important]Important

If you want to use Spring Cloud Stream remember, to add a dependency on -org.springframework.cloud:spring-cloud-stream-test-support.

Maven.  -

<dependency>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-stream-test-support</artifactId>
-    <scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-stream-test-support"

-

7.3.1 Adding the Runner to the Project

You can have both Spring Cloud Stream 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 stubrunner.stream.enabled=false -property.

Assume that you have the following Maven repository with a deployed stubs for the -streamService application:

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── streamService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── streamService-0.0.1-SNAPSHOT.pom
-                            │   ├── streamService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

Further assume the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Consider the following contracts (numbered 1):

Contract.make {
-	label 'return_book_1'
-	input { triggeredBy('bookReturnedTriggered()') }
-	outputMessage {
-		sentTo('returnBook')
-		body('''{ "bookName" : "foo" }''')
-		headers { header('BOOK-NAME', 'foo') }
-	}
-}

Now consider 2:

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('bookStorage')
-		messageBody([
-			bookName: 'foo'
-		])
-		messageHeaders { header('sample', 'header') }
-	}
-	outputMessage {
-		sentTo('returnBook')
-		body([
-			bookName: 'foo'
-		])
-		headers { header('BOOK-NAME', 'foo') }
-	}
-}

Now consider the following Spring configuration:

stubrunner.repositoryRoot: classpath:m2repo/repository/
-stubrunner.ids: org.springframework.cloud.contract.verifier.stubs:streamService:0.0.1-SNAPSHOT:stubs
-stubrunner.stubs-mode: remote
-spring:
-  cloud:
-    stream:
-      bindings:
-        output:
-          destination: returnBook
-        input:
-          destination: bookStorage
-
-server:
-  port: 0
-
-debug: true

These examples lend themselves to three scenarios:

Scenario 1 (no input message)

To trigger a message via the return_book_1 label, use the StubTrigger interface as -follows:

stubFinder.trigger('return_book_1')

To listen to the output of the message sent to a channel whose destination is -returnBook:

Message<?> receivedMessage = messaging.receive('returnBook')

The received message passes the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input)

Since the route is set for you, you can send a message to the bookStorage -destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'bookStorage')

To listen to the output of the message sent to returnBook:

Message<?> receivedMessage = messaging.receive('returnBook')

The received message passes the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 3 (input with no output)

Since the route is set for you, you can send a message to the output -destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')

7.4 Stub Runner Spring AMQP

Spring Cloud Contract Verifier Stub Runner’s messaging module provides an easy way to -integrate with Spring AMQP’s Rabbit Template. For the provided artifacts, it -automatically downloads the stubs and registers the required routes.

The integration tries to work standalone (that is, without interaction with a running -RabbitMQ message broker). It expects a RabbitTemplate on the application context and -uses it as a spring boot test named @SpyBean. As a result, it can use the mockito spy -functionality to verify and inspect messages sent by the application.

On the message consumer side, the stub runner considers all @RabbitListener annotated -endpoints and all SimpleMessageListenerContainer objects on the application context.

As messages are usually sent to exchanges in AMQP, the message contract contains the -exchange name as the destination. Message listeners on the other side are bound to -queues. Bindings connect an exchange to a queue. If message contracts are triggered, the -Spring AMQP stub runner integration looks for bindings on the application context that -match this exchange. Then it collects the queues from the Spring exchanges and tries to -find message listeners bound to these queues. The message is triggered for all matching -message listeners.

If you need to work with routing keys, it’s enough to pass them via the amqp_receivedRoutingKey -messaging header.

7.4.1 Adding the Runner to the Project

You can have both Spring AMQP and Spring Cloud Contract Stub Runner on the classpath and -set the property stubrunner.amqp.enabled=true. Remember to annotate your test class -with @AutoConfigureStubRunner.

[Important]Important

If you already have Stream and Integration on the classpath, you need -to disable them explicitly by setting the stubrunner.stream.enabled=false and -stubrunner.integration.enabled=false properties.

Assume that you have the following Maven repository with a deployed stubs for the -spring-cloud-contract-amqp-test application.

└── .m2
-    └── repository
-        └── com
-            └── example
-                └── spring-cloud-contract-amqp-test
-                    ├── 0.4.0-SNAPSHOT
-                    │   ├── spring-cloud-contract-amqp-test-0.4.0-SNAPSHOT.pom
-                    │   ├── spring-cloud-contract-amqp-test-0.4.0-SNAPSHOT-stubs.jar
-                    │   └── maven-metadata-local.xml
-                    └── maven-metadata-local.xml

Further assume that the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── contracts
-    └── shouldProduceValidPersonData.groovy

Consider the following contract:

Contract.make {
-    // Human readable description
-    description 'Should produce valid person data'
-    // Label by means of which the output message can be triggered
-    label 'contract-test.person.created.event'
-    // input to the contract
-    input {
-        // the contract will be triggered by a method
-        triggeredBy('createPerson()')
-    }
-    // output message of the contract
-    outputMessage {
-        // destination to which the output message will be sent
-        sentTo 'contract-test.exchange'
-        headers {
-            header('contentType': 'application/json')
-            header('__TypeId__': 'org.springframework.cloud.contract.stubrunner.messaging.amqp.Person')
-        }
-        // the body of the output message
-        body ([
-                id: $(consumer(9), producer(regex("[0-9]+"))),
-                name: "me"
-        ])
-    }
-}

Now consider the following Spring configuration:

stubrunner:
-  repositoryRoot: classpath:m2repo/repository/
-  ids: org.springframework.cloud.contract.verifier.stubs.amqp:spring-cloud-contract-amqp-test:0.4.0-SNAPSHOT:stubs
-  stubs-mode: remote
-  amqp:
-    enabled: true
-server:
-  port: 0

Triggering the message

To trigger a message using the contract above, use the StubTrigger interface as -follows:

stubTrigger.trigger("contract-test.person.created.event")

The message has a destination of contract-test.exchange, so the Spring AMQP stub runner -integration looks for bindings related to this exchange.

@Bean
-public Binding binding() {
-	return BindingBuilder.bind(new Queue("test.queue")).to(new DirectExchange("contract-test.exchange")).with("#");
-}

The binding definition binds the queue test.queue. As a result, the following listener -definition is matched and invoked with the contract message.

@Bean
-public SimpleMessageListenerContainer simpleMessageListenerContainer(ConnectionFactory connectionFactory,
-																		MessageListenerAdapter listenerAdapter) {
-	SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
-	container.setConnectionFactory(connectionFactory);
-	container.setQueueNames("test.queue");
-	container.setMessageListener(listenerAdapter);
-
-	return container;
-}

Also, the following annotated listener matches and is invoked:

@RabbitListener(bindings = @QueueBinding(
-		value = @Queue(value = "test.queue"),
-		exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true")))
-public void handlePerson(Person person) {
-	this.person = person;
-}
[Note]Note

The message is directly handed over to the onMessage method of the -MessageListener associated with the matching SimpleMessageListenerContainer.

Spring AMQP Test Configuration

In order to avoid Spring AMQP trying to connect to a running broker during our tests -configure a mock ConnectionFactory.

To disable the mocked ConnectionFactory, set the following property: -stubrunner.amqp.mockConnection=false

stubrunner:
-  amqp:
-    mockConnection: false
\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__using_the_pluggable_architecture.html b/multi/multi__using_the_pluggable_architecture.html index aaeb73feeb..a5ffb82f50 100644 --- a/multi/multi__using_the_pluggable_architecture.html +++ b/multi/multi__using_the_pluggable_architecture.html @@ -1,471 +1,13 @@ - - - 10. Using the Pluggable Architecture

10. Using the Pluggable Architecture

You may encounter cases where you have your contracts have been defined in other formats, -such as YAML, RAML or PACT. In those cases, you still want to benefit from the automatic -generation of tests and stubs. You can add your own implementation for generating both -tests and stubs. Also, you can customize the way tests are generated (for example, you -can generate tests for other languages) and the way stubs are generated (for example, you -can generate stubs for other HTTP server implementations).

10.1 Custom Contract Converter

The ContractConverter interface lets you register your own implementation of a contract -structure converter. The following code listing shows the ContractConverter interface:

package org.springframework.cloud.contract.spec
+
 
-/**
- * Converter to be used to convert FROM {@link File} TO {@link Contract}
- * and from {@link Contract} to {@code T}
- *
- * @param <T >     - type to which we want to convert the contract
- *
- * @author Marcin Grzejszczak
- * @since 1.1.0
- */
-interface ContractConverter<T> extends ContractStorer<T> {
+
+
 
-	/**
-	 * Should this file be accepted by the converter. Can use the file extension
-	 * to check if the conversion is possible.
-	 *
-	 * @param file - file to be considered for conversion
-	 * @return - {@code true} if the given implementation can convert the file
-	 */
-	boolean isAccepted(File file)
+
 
-	/**
-	 * Converts the given {@link File} to its {@link Contract} representation
-	 *
-	 * @param file - file to convert
-	 * @return - {@link Contract} representation of the file
-	 */
-	Collection<Contract> convertFrom(File file)
+Page Redirection
 
-	/**
-	 * Converts the given {@link Contract} to a {@link T} representation
-	 *
-	 * @param contract - the parsed contract
-	 * @return - {@link T} the type to which we do the conversion
-	 */
-	T convertTo(Collection<Contract> contract)
-}

Your implementation must define the condition on which it should start the -conversion. Also, you must define how to perform that conversion in both directions.

[Important]Important

Once you create your implementation, you must create a -/META-INF/spring.factories file in which you provide the fully qualified name of your -implementation.

The following example shows a typical spring.factories file:

org.springframework.cloud.contract.spec.ContractConverter=\
-org.springframework.cloud.contract.verifier.converter.YamlContractConverter

10.1.1 Pact Converter

Spring Cloud Contract includes support for Pact representation of -contracts up until v4. Instead of using the Groovy DSL, you can use Pact files. In this section, we -present how to add Pact support for your project. Note however that not all functionality is supported. -Starting with v3 you can combine multiple matcher for the same element; -you can use matchers for the body, headers, request and path; and you can use value generators. -Spring Cloud Contract currently only supports multiple matchers that are combined using the AND rule logic. -Next to that the request and path matchers are skipped during the conversion. -When using a date, time or datetime value generator with a given format, -the given format will be skipped and the ISO format will be used.

In order to properly support the Spring Cloud Contract way of doing messaging -with Pact you’ll have to provide some additional meta data entries. Below you can find a list of such entries:

  • to define the destination to which a message gets sent, you have to -set a metaData entry in the Pact file, with key sentTo equal to the destination to which a message is to be sent. E.g. "metaData": { "sentTo": "activemq:output" }

10.1.2 Pact Contract

Consider following example of a Pact contract, which is a file under the -src/test/resources/contracts folder.

{
-  "provider": {
-    "name": "Provider"
-  },
-  "consumer": {
-    "name": "Consumer"
-  },
-  "interactions": [
-    {
-      "description": "",
-      "request": {
-        "method": "PUT",
-        "path": "/fraudcheck",
-        "headers": {
-          "Content-Type": "application/vnd.fraud.v1+json"
-        },
-        "body": {
-          "clientId": "1234567890",
-          "loanAmount": 99999
-        },
-        "generators": {
-          "body": {
-            "$.clientId": {
-              "type": "Regex",
-              "regex": "[0-9]{10}"
-            }
-          }
-        },
-        "matchingRules": {
-          "header": {
-            "Content-Type": {
-              "matchers": [
-                {
-                  "match": "regex",
-                  "regex": "application/vnd\\.fraud\\.v1\\+json.*"
-                }
-              ],
-              "combine": "AND"
-            }
-          },
-          "body": {
-            "$.clientId": {
-              "matchers": [
-                {
-                  "match": "regex",
-                  "regex": "[0-9]{10}"
-                }
-              ],
-              "combine": "AND"
-            }
-          }
-        }
-      },
-      "response": {
-        "status": 200,
-        "headers": {
-          "Content-Type": "application/vnd.fraud.v1+json;charset=UTF-8"
-        },
-        "body": {
-          "fraudCheckStatus": "FRAUD",
-          "rejectionReason": "Amount too high"
-        },
-        "matchingRules": {
-          "header": {
-            "Content-Type": {
-              "matchers": [
-                {
-                  "match": "regex",
-                  "regex": "application/vnd\\.fraud\\.v1\\+json.*"
-                }
-              ],
-              "combine": "AND"
-            }
-          },
-          "body": {
-            "$.fraudCheckStatus": {
-              "matchers": [
-                {
-                  "match": "regex",
-                  "regex": "FRAUD"
-                }
-              ],
-              "combine": "AND"
-            }
-          }
-        }
-      }
-    }
-  ],
-  "metadata": {
-    "pact-specification": {
-      "version": "3.0.0"
-    },
-    "pact-jvm": {
-      "version": "3.5.13"
-    }
-  }
-}

The remainder of this section about using Pact refers to the preceding file.

10.1.3 Pact for Producers

On the producer side, you must add two additional dependencies to your plugin -configuration. One is the Spring Cloud Contract Pact support, and the other represents -the current Pact version that you use.

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-contract-pact</artifactId>
-			<version>${spring-cloud-contract.version}</version>
-		</dependency>
-	</dependencies>
-</plugin>

-

Gradle.  -

classpath "org.springframework.cloud:spring-cloud-contract-pact:${findProperty('verifierVersion') ?: verifierVersion}"

-

When you execute the build of your application, a test will be generated. The generated -test might be as follows:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-	// given:
-		MockMvcRequestSpecification request = given()
-				.header("Content-Type", "application/vnd.fraud.v1+json")
-				.body("{\"clientId\":\"1234567890\",\"loanAmount\":99999}");
-
-	// when:
-		ResponseOptions response = given().spec(request)
-				.put("/fraudcheck");
-
-	// then:
-		assertThat(response.statusCode()).isEqualTo(200);
-		assertThat(response.header("Content-Type")).matches("application/vnd\\.fraud\\.v1\\+json.*");
-	// and:
-		DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-		assertThatJson(parsedJson).field("['rejectionReason']").isEqualTo("Amount too high");
-	// and:
-		assertThat(parsedJson.read("$.fraudCheckStatus", String.class)).matches("FRAUD");
-}

The corresponding generated stub might be as follows:

{
-  "id" : "996ae5ae-6834-4db6-8fac-358ca187ab62",
-  "uuid" : "996ae5ae-6834-4db6-8fac-358ca187ab62",
-  "request" : {
-    "url" : "/fraudcheck",
-    "method" : "PUT",
-    "headers" : {
-      "Content-Type" : {
-        "matches" : "application/vnd\\.fraud\\.v1\\+json.*"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.['loanAmount'] == 99999)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.clientId =~ /([0-9]{10})/)]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\"fraudCheckStatus\":\"FRAUD\",\"rejectionReason\":\"Amount too high\"}",
-    "headers" : {
-      "Content-Type" : "application/vnd.fraud.v1+json;charset=UTF-8"
-    },
-    "transformers" : [ "response-template" ]
-  },
-}

10.1.4 Pact for Consumers

On the producer side, you must add two additional dependencies to your project -dependencies. One is the Spring Cloud Contract Pact support, and the other represents the -current Pact version that you use.

Maven.  -

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-pact</artifactId>
-	<scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-contract-pact"

-

10.2 Using the Custom Test Generator

If you want to generate tests for languages other than Java or you are not happy with the -way the verifier builds Java tests, you can register your own implementation.

The SingleTestGenerator interface lets you register your own implementation. The -following code listing shows the SingleTestGenerator interface:

package org.springframework.cloud.contract.verifier.builder
-
-
-import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties
-import org.springframework.cloud.contract.verifier.file.ContractMetadata
-
-/**
- * Builds a single test.
- *
- * @since 1.1.0
- */
-trait SingleTestGenerator {
-
-	/**
-	 * Creates contents of a single test class in which all test scenarios from
-	 * the contract metadata should be placed.
-	 *
-	 * @param properties - properties passed to the plugin
-	 * @param listOfFiles - list of parsed contracts with additional metadata
-	 * @param className - the name of the generated test class
-	 * @param classPackage - the name of the package in which the test class should be stored
-	 * @param includedDirectoryRelativePath - relative path to the included directory
-	 * @return contents of a single test class
-	 * @deprecated use{@link SingleTestGenerator#buildClass(ContractVerifierConfigProperties, Collection, String, GeneratedClassData)}
-	 */
-	@Deprecated
-	abstract String buildClass(ContractVerifierConfigProperties properties,
-			Collection<ContractMetadata> listOfFiles, String className, String classPackage, String includedDirectoryRelativePath)
-
-	/**
-	 * Creates contents of a single test class in which all test scenarios from
-	 * the contract metadata should be placed.
-	 *
-	 * @param properties - properties passed to the plugin
-	 * @param listOfFiles - list of parsed contracts with additional metadata
-	 * @param generatedClassData - information about the generated class
-	 * @param includedDirectoryRelativePath - relative path to the included directory
-	 * @return contents of a single test class
-	 */
-	String buildClass(ContractVerifierConfigProperties properties,
-			Collection<ContractMetadata> listOfFiles, String includedDirectoryRelativePath, GeneratedClassData generatedClassData) {
-		String className = generatedClassData.className
-		String classPackage = generatedClassData.classPackage
-		String path = includedDirectoryRelativePath
-		return buildClass(properties, listOfFiles, className, classPackage, path)
-	}
-
-	/**
-	 * Extension that should be appended to the generated test class. E.g. {@code .java} or {@code .php}
-	 *
-	 * @param properties - properties passed to the plugin
-	 */
-	abstract String fileExtension(ContractVerifierConfigProperties properties)
-
-	static class GeneratedClassData {
-		public final String className
-		public final String classPackage
-		public final java.nio.file.Path testClassPath
-
-		GeneratedClassData(String className, String classPackage,
-				java.nio.file.Path testClassPath) {
-			this.className = className
-			this.classPackage = classPackage
-			this.testClassPath = testClassPath
-		}
-	}
-}

Again, you must provide a spring.factories file, such as the one shown in the following -example:

org.springframework.cloud.contract.verifier.builder.SingleTestGenerator=/
-com.example.MyGenerator

10.3 Using the Custom Stub Generator

If you want to generate stubs for stub servers other than WireMock, you can plug in your -own implementation of the StubGenerator interface. The following code listing shows the -StubGenerator interface:

package org.springframework.cloud.contract.verifier.converter
-
-import groovy.transform.CompileStatic
-
-import org.springframework.cloud.contract.spec.Contract
-import org.springframework.cloud.contract.verifier.file.ContractMetadata
-
-/**
- * Converts contracts into their stub representation.
- *
- * @since 1.1.0
- */
-@CompileStatic
-interface StubGenerator {
-
-	/**
-	 * @return {@code true} if the converter can handle the file to convert it into a stub.
-	 */
-	boolean canHandleFileName(String fileName)
-
-	/**
-	 * @return the collection of converted contracts into stubs. One contract can
-	 * result in multiple stubs.
-	 */
-	Map<Contract, String> convertContents(String rootName, ContractMetadata content)
-
-	/**
-	 * @return the name of the converted stub file. If you have multiple contracts
-	 * in a single file then a prefix will be added to the generated file. If you
-	 * provide the {@link Contract#name} field then that field will override the
-	 * generated file name.
-	 *
-	 * Example: name of file with 2 contracts is {@code foo.groovy}, it will be
-	 * converted by the implementation to {@code foo.json}. The recursive file
-	 * converter will create two files {@code 0_foo.json} and {@code 1_foo.json}
-	 */
-	String generateOutputFileNameForInput(String inputFileName)
-}

Again, you must provide a spring.factories file, such as the one shown in the following -example:

# Stub converters
-org.springframework.cloud.contract.verifier.converter.StubGenerator=\
-org.springframework.cloud.contract.verifier.wiremock.DslToWireMockClientConverter

The default implementation is the WireMock stub generation.

[Tip]Tip

You can provide multiple stub generator implementations. For example, from a single -DSL, you can produce both WireMock stubs and Pact files.

10.4 Using the Custom Stub Runner

If you decide to use a custom stub generation, you also need a custom way of running -stubs with your different stub provider.

Assume that you use Moco to build your stubs and that -you have written a stub generator and placed your stubs in a JAR file.

In order for Stub Runner to know how to run your stubs, you have to define a custom -HTTP Stub server implementation, which might resemble the following example:

package org.springframework.cloud.contract.stubrunner.provider.moco
-
-import com.github.dreamhead.moco.bootstrap.arg.HttpArgs
-import com.github.dreamhead.moco.runner.JsonRunner
-import com.github.dreamhead.moco.runner.RunnerSetting
-import groovy.util.logging.Commons
-
-import org.springframework.cloud.contract.stubrunner.HttpServerStub
-import org.springframework.util.SocketUtils
-
-@Commons
-class MocoHttpServerStub implements HttpServerStub {
-
-	private boolean started
-	private JsonRunner runner
-	private int port
-
-	@Override
-	int port() {
-		if (!isRunning()) {
-			return -1
-		}
-		return port
-	}
-
-	@Override
-	boolean isRunning() {
-		return started
-	}
-
-	@Override
-	HttpServerStub start() {
-		return start(SocketUtils.findAvailableTcpPort())
-	}
-
-	@Override
-	HttpServerStub start(int port) {
-		this.port = port
-		return this
-	}
-
-	@Override
-	HttpServerStub stop() {
-		if (!isRunning()) {
-			return this
-		}
-		this.runner.stop()
-		return this
-	}
-
-	@Override
-	HttpServerStub registerMappings(Collection<File> stubFiles) {
-		List<RunnerSetting> settings = stubFiles.findAll { it.name.endsWith("json") }
-			.collect {
-			log.info("Trying to parse [${it.name}]")
-			try {
-				return RunnerSetting.aRunnerSetting().withStream(it.newInputStream()).
-					build()
-			}
-			catch (Exception e) {
-				log.warn("Exception occurred while trying to parse file [${it.name}]", e)
-				return null
-			}
-		}.findAll { it }
-		this.runner = JsonRunner.newJsonRunnerWithSetting(settings,
-			HttpArgs.httpArgs().withPort(this.port).build())
-		this.runner.run()
-		this.started = true
-		return this
-	}
-
-	@Override
-	String registeredMappings() {
-		return ""
-	}
-
-	@Override
-	boolean isAccepted(File file) {
-		return file.name.endsWith(".json")
-	}
-}

Then, you can register it in your spring.factories file, as shown in the following -example:

org.springframework.cloud.contract.stubrunner.HttpServerStub=\
-org.springframework.cloud.contract.stubrunner.provider.moco.MocoHttpServerStub

Now you can run stubs with Moco.

[Important]Important

If you do not provide any implementation, then the default (WireMock) -implementation is used. If you provide more than one, the first one on the list is used.

10.5 Using the Custom Stub Downloader

You can customize the way your stubs are downloaded by creating an implementation of the -StubDownloaderBuilder interface, as shown in the following example:

package com.example;
-
-class CustomStubDownloaderBuilder implements StubDownloaderBuilder {
-
-	@Override
-	public StubDownloader build(final StubRunnerOptions stubRunnerOptions) {
-		return new StubDownloader() {
-			@Override
-			public Map.Entry<StubConfiguration, File> downloadAndUnpackStubJar(
-					StubConfiguration config) {
-				File unpackedStubs = retrieveStubs();
-				return new AbstractMap.SimpleEntry<>(
-						new StubConfiguration(config.getGroupId(), config.getArtifactId(), version,
-								config.getClassifier()), unpackedStubs);
-			}
-
-			File retrieveStubs() {
-			    // here goes your custom logic to provide a folder where all the stubs reside
-			}
-}

Then you can register it in your spring.factories file, as shown in the following -example:

# Example of a custom Stub Downloader Provider
-org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder=\
-com.example.CustomStubDownloaderBuilder

Now you can pick a folder with the source of your stubs.

[Important]Important

If you do not provide any implementation, then the default is used (scan classpath). -If you provide the stubsMode = StubRunnerProperties.StubsMode.LOCAL or -, stubsMode = StubRunnerProperties.StubsMode.REMOTE then the Aether implementation will be used -If you provide more than one, then the first one on the list is used.

10.6 Using the SCM Stub Downloader

Whenever the repositoryRoot starts with a SCM protocol -(currently we support only git://), the stub downloader will try -to clone the repository and use it as a source of contracts -to generate tests or stubs.

Either via environment variables, system properties, properties set -inside the plugin or contracts repository configuration you can -tweak the downloader’s behaviour. Below you can find the list of -properties

Table 10.1. SCM Stub Downloader properties

Type of a property

Name of the property

Description

* git.branch (plugin prop)

* stubrunner.properties.git.branch (system prop)

* STUBRUNNER_PROPERTIES_GIT_BRANCH (env prop)

master

Which branch to checkout

* git.username (plugin prop)

* stubrunner.properties.git.username (system prop)

* STUBRUNNER_PROPERTIES_GIT_USERNAME (env prop)

 

Git clone username

* git.password (plugin prop)

* stubrunner.properties.git.password (system prop)

* STUBRUNNER_PROPERTIES_GIT_PASSWORD (env prop)

 

Git clone password

* git.no-of-attempts (plugin prop)

* stubrunner.properties.git.no-of-attempts (system prop)

* STUBRUNNER_PROPERTIES_GIT_NO_OF_ATTEMPTS (env prop)

10

Number of attempts to push the commits to origin

* git.wait-between-attempts (Plugin prop)

* stubrunner.properties.git.wait-between-attempts (system prop)

* STUBRUNNER_PROPERTIES_GIT_WAIT_BETWEEN_ATTEMPTS (env prop)

1000

Number of millis to wait between attempts to push the commits to origin


10.7 Using the Pact Stub Downloader

Whenever the repositoryRoot starts with a Pact protocol -(starts with pact://), the stub downloader will try -to fetch the Pact contract definitions from the Pact Broker. -Whatever is set after pact:// will be parsed as the Pact Broker URL.

Either via environment variables, system properties, properties set -inside the plugin or contracts repository configuration you can -tweak the downloader’s behaviour. Below you can find the list of -properties

Table 10.2. SCM Stub Downloader properties

Name of a property

Default

Description

* pactbroker.host (plugin prop)

* stubrunner.properties.pactbroker.host (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_HOST (env prop)

Host from URL passed to repositoryRoot

What is the URL of Pact Broker

* pactbroker.port (plugin prop)

* stubrunner.properties.pactbroker.port (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PORT (env prop)

Port from URL passed to repositoryRoot

What is the port of Pact Broker

* pactbroker.protocol (plugin prop)

* stubrunner.properties.pactbroker.protocol (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROTOCOL (env prop)

Protocol from URL passed to repositoryRoot

What is the protocol of Pact Broker

* pactbroker.tags (plugin prop)

* stubrunner.properties.pactbroker.tags (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_TAGS (env prop)

Version of the stub, or latest if version is +

What tags should be used to fetch the stub

* pactbroker.auth.scheme (plugin prop)

* stubrunner.properties.pactbroker.auth.scheme (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_SCHEME (env prop)

Basic

What kind of authentication should be used to connect to the Pact Broker

* pactbroker.auth.username (plugin prop)

* stubrunner.properties.pactbroker.auth.username (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_USERNAME (env prop)

The username passed to contractsRepositoryUsername (maven) or contractRepository.username (gradle)

Username used to connect to the Pact Broker

* pactbroker.auth.password (plugin prop)

* stubrunner.properties.pactbroker.auth.password (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_PASSWORD (env prop)

The password passed to contractsRepositoryPassword (maven) or contractRepository.password (gradle)

Password used to connect to the Pact Broker

* pactbroker.provider-name-with-group-id (plugin prop)

* stubrunner.properties.pactbroker.provider-name-with-group-id (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROVIDER_NAME_WITH_GROUP_ID (env prop)

false

When true, the provider name will be a combination of groupId:artifactId. If false, just artifactId is used


\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi__wiremock_and_spring_mvc_mocks.html b/multi/multi__wiremock_and_spring_mvc_mocks.html index 79b762fa36..a5ffb82f50 100644 --- a/multi/multi__wiremock_and_spring_mvc_mocks.html +++ b/multi/multi__wiremock_and_spring_mvc_mocks.html @@ -1,37 +1,13 @@ - - - 5. WireMock and Spring MVC Mocks

5. WireMock and Spring MVC Mocks

Spring Cloud Contract provides a convenience class that can load JSON WireMock stubs into a -Spring MockRestServiceServer. Here’s an example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.NONE)
-public class WiremockForDocsMockServerApplicationTests {
+
 
-	@Autowired
-	private RestTemplate restTemplate;
+
+
 
-	@Autowired
-	private Service service;
+
 
-	@Test
-	public void contextLoads() throws Exception {
-		// will read stubs classpath
-		MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate)
-				.baseUrl("https://example.org").stubs("classpath:/stubs/resource.json")
-				.build();
-		// We're asserting if WireMock responded properly
-		assertThat(this.service.go()).isEqualTo("Hello World");
-		server.verify();
-	}
-}

The baseUrl is prepended to all mock calls, and the stubs() -method takes a stub path resource pattern as an argument. So in this -example the stub defined at /stubs/resource.json is loaded into the -mock server, so if the RestTemplate is asked to visit -https://example.org/ it will get the responses as declared -there. More than one stub pattern can be specified, and each one can -be a directory (for a recursive list of all ".json"), or a fixed -filename (like in the example above) or an ant-style pattern. The JSON -format is the normal WireMock format which you can read about in the -WireMock website.

Currently we support Tomcat, Jetty and Undertow as Spring Boot -embedded servers, and Wiremock itself has "native" support for a -particular version of Jetty (currently 9.2). To use the native Jetty -you need to add the native wiremock dependencies and exclude the -Spring Boot container if there is one.

\ No newline at end of file +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi_contract-dsl.html b/multi/multi_contract-dsl.html index fc66f2c2a0..a5ffb82f50 100644 --- a/multi/multi_contract-dsl.html +++ b/multi/multi_contract-dsl.html @@ -1,2208 +1,13 @@ - - - 8. Contract DSL

8. Contract DSL

Spring Cloud Contract supports out of the box 2 types of DSL. One written in -Groovy and one written in YAML.

If you decide to write the contract in Groovy, do not be alarmed if you have not used Groovy -before. Knowledge of the language is not really needed, as the Contract DSL uses only a -tiny subset of it (only literals, method calls and closures). Also, the DSL is statically -typed, to make it programmer-readable without any knowledge of the DSL itself.

[Important]Important

Remember that, inside the Groovy contract file, you have to provide the fully -qualified name to the Contract class and make static imports, such as -org.springframework.cloud.spec.Contract.make { …​ }. You can also provide an import to -the Contract class: import org.springframework.cloud.spec.Contract and then call -Contract.make { …​ }.

[Tip]Tip

Spring Cloud Contract supports defining multiple contracts in a single file.

The following is a complete example of a Groovy contract definition:

The following is a complete example of a YAML contract definition:

description: Some description
-name: some name
-priority: 8
-ignored: true
-request:
-  url: /foo
-  queryParameters:
-    a: b
-    b: c
-  method: PUT
-  headers:
-    foo: bar
-    fooReq: baz
-  body:
-    foo: bar
-  matchers:
-    body:
-      - path: $.foo
-        type: by_regex
-        value: bar
-    headers:
-      - key: foo
-        regex: bar
-response:
-  status: 200
-  headers:
-    foo2: bar
-    foo3: foo33
-    fooRes: baz
-  body:
-    foo2: bar
-    foo3: baz
-    nullValue: null
-  matchers:
-    body:
-      - path: $.foo2
-        type: by_regex
-        value: bar
-      - path: $.foo3
-        type: by_command
-        value: executeMe($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-    headers:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        command: andMeToo($it)
[Tip]Tip

You can compile contracts to stubs mapping using standalone maven command: -mvn org.springframework.cloud:spring-cloud-contract-maven-plugin:convert

8.1 Limitations

[Warning]Warning

Spring Cloud Contract Verifier does not properly support XML. Please use JSON or -help us implement this feature.

[Warning]Warning

The support for verifying the size of JSON arrays is experimental. If you want -to turn it on, please set the value of the following system property to true: -spring.cloud.contract.verifier.assert.size. By default, this feature is set to false. -You can also provide the assertJsonSize property in the plugin configuration.

[Warning]Warning

Because JSON structure can have any form, it can be impossible to parse it -properly when using the Groovy DSL and the value(consumer(…​), producer(…​)) notation in GString. That -is why you should use the Groovy Map notation.

8.2 Common Top-Level elements

The following sections describe the most common top-level elements:

8.2.1 Description

You can add a description to your contract. The description is arbitrary text. The -following code shows an example:

Groovy DSL.  -

			org.springframework.cloud.contract.spec.Contract.make {
-				description('''
-given:
-	An input
-when:
-	Sth happens
-then:
-	Output
-''')
-			}

-

YAML.  -

description: Some description
-name: some name
-priority: 8
-ignored: true
-request:
-  url: /foo
-  queryParameters:
-    a: b
-    b: c
-  method: PUT
-  headers:
-    foo: bar
-    fooReq: baz
-  body:
-    foo: bar
-  matchers:
-    body:
-      - path: $.foo
-        type: by_regex
-        value: bar
-    headers:
-      - key: foo
-        regex: bar
-response:
-  status: 200
-  headers:
-    foo2: bar
-    foo3: foo33
-    fooRes: baz
-  body:
-    foo2: bar
-    foo3: baz
-    nullValue: null
-  matchers:
-    body:
-      - path: $.foo2
-        type: by_regex
-        value: bar
-      - path: $.foo3
-        type: by_command
-        value: executeMe($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-    headers:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        command: andMeToo($it)

-

8.2.2 Name

You can provide a name for your contract. Assume that you provided the following name: -should register a user. If you do so, the name of the autogenerated test is -validate_should_register_a_user. Also, the name of the stub in a WireMock stub is -should_register_a_user.json.

[Important]Important

You must ensure that the name does not contain any characters that make the -generated test not compile. Also, remember that, if you provide the same name for -multiple contracts, your autogenerated tests fail to compile and your generated stubs -override each other.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	name("some_special_name")
-}

-

YAML.  -

name: some name

-

8.2.3 Ignoring Contracts

If you want to ignore a contract, you can either set a value of ignored contracts in the -plugin configuration or set the ignored property on the contract itself:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	ignored()
-}

-

YAML.  -

ignored: true

-

8.2.4 Passing Values from Files

Starting with version 1.2.0, you can pass values from files. Assume that you have the -following resources in our project.

└── src
-    └── test
-        └── resources
-            └── contracts
-                ├── readFromFile.groovy
-                ├── request.json
-                └── response.json

Further assume that your contract is as follows:

Groovy DSL.  -

/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+
 
-import org.springframework.cloud.contract.spec.Contract
+
+
 
-Contract.make {
-	request {
-		method('PUT')
-		headers {
-			contentType(applicationJson())
-		}
-		body(file("request.json"))
-		url("/1")
-	}
-	response {
-		status OK()
-		body(file("response.json"))
-		headers {
-			contentType(applicationJson())
-		}
-	}
-}

-

YAML.  -

request:
-  method: GET
-  url: /foo
-  bodyFromFile: request.json
-response:
-  status: 200
-  bodyFromFile: response.json

-

Further assume that the JSON files is as follows:

request.json

{
-  "status": "REQUEST"
-}

response.json

{
-  "status": "RESPONSE"
-}

When test or stub generation takes place, the contents of the file is passed to the body -of a request or a response. The name of the file needs to be a file with location -relative to the folder in which the contract lays.

If you need to pass the contents of a file in a binary form -it’s enough for you to use the fileAsBytes method in Groovy DSL or bodyFromFileAsBytes field in YAML.

Groovy DSL.  -

import org.springframework.cloud.contract.spec.Contract
+
 
-Contract.make {
-	request {
-		url("/1")
-		method(PUT())
-		headers {
-			contentType(applicationOctetStream())
-		}
-		body(fileAsBytes("request.pdf"))
-	}
-	response {
-		status 200
-		body(fileAsBytes("response.pdf"))
-		headers {
-			contentType(applicationOctetStream())
-		}
-	}
-}

-

YAML.  -

request:
-  url: /1
-  method: PUT
-  headers:
-    Content-Type: application/octet-stream
-  bodyFromFileAsBytes: request.pdf
-response:
-  status: 200
-  bodyFromFileAsBytes: response.pdf
-  headers:
-    Content-Type: application/octet-stream

-

[Important]Important

You should use this approach whenever you want to work with binary payloads both for HTTP and messaging.

8.2.5 HTTP Top-Level Elements

The following methods can be called in the top-level closure of a contract definition. -request and response are mandatory. priority is optional.

Groovy DSL.  -

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).
-	request {
-		method GET()
-		url "/foo"
-		//...
-	}
+Page Redirection
 
-	// Definition of HTTP response part of the contract
-	// (a service implementing this contract should respond
-	// with following response after receiving request
-	// specified in "request" part above).
-	response {
-		status 200
-		//...
-	}
-
-	// Contract priority, which can be used for overriding
-	// contracts (1 is highest). Priority is optional.
-	priority 1
-}

-

YAML.  -

priority: 8
-request:
-...
-response:
-...

-

[Important]Important

If you want to make your contract have a higher value of priority -you need to pass a lower number to the priority tag / method. E.g. priority with -value 5 has higher priority than priority with value 10.

8.3 Request

The HTTP protocol requires only method and url to be specified in a request. The -same information is mandatory in request definition of the Contract.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		// HTTP request method (GET/POST/PUT/DELETE).
-		method 'GET'
-
-		// Path component of request URL is specified as follows.
-		urlPath('/users')
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

method: PUT
-url: /foo

-

It is possible to specify an absolute rather than relative url, but using urlPath is -the recommended way, as doing so makes the tests host-independent.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'GET'
-
-		// Specifying `url` and `urlPath` in one contract is illegal.
-		url('http://localhost:8888/users')
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

request:
-  method: PUT
-  urlPath: /foo

-

request may contain query parameters.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-		method GET()
-
-		urlPath('/users') {
-
-			// Each parameter is specified in form
-			// `'paramName' : paramValue` where parameter value
-			// may be a simple literal or one of matcher functions,
-			// all of which are used in this example.
-			queryParameters {
-
-				// If a simple literal is used as value
-				// default matcher function is used (equalTo)
-				parameter 'limit': 100
-
-				// `equalTo` function simply compares passed value
-				// using identity operator (==).
-				parameter 'filter': equalTo("email")
-
-				// `containing` function matches strings
-				// that contains passed substring.
-				parameter 'gender': value(consumer(containing("[mf]")), producer('mf'))
-
-				// `matching` function tests parameter
-				// against passed regular expression.
-				parameter 'offset': value(consumer(matching("[0-9]+")), producer(123))
-
-				// `notMatching` functions tests if parameter
-				// does not match passed regular expression.
-				parameter 'loginStartsWith': value(consumer(notMatching(".{0,2}")), producer(3))
-			}
-		}
-
-		//...
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

request:
-...
-  queryParameters:
-    a: b
-    b: c
-  headers:
-    foo: bar
-    fooReq: baz
-  cookies:
-    foo: bar
-    fooReq: baz
-  body:
-    foo: bar
-  matchers:
-    body:
-      - path: $.foo
-        type: by_regex
-        value: bar
-    headers:
-      - key: foo
-        regex: bar
-response:
-  status: 200
-  fixedDelayMilliseconds: 1000
-  headers:
-    foo2: bar
-    foo3: foo33
-    fooRes: baz
-  body:
-    foo2: bar
-    foo3: baz
-    nullValue: null
-  matchers:
-    body:
-      - path: $.foo2
-        type: by_regex
-        value: bar
-      - path: $.foo3
-        type: by_command
-        value: executeMe($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-    headers:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        command: andMeToo($it)
-    cookies:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        predefined:

-

request may contain additional request headers, as shown in the following example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-		method GET()
-		url "/foo"
-
-		// Each header is added in form `'Header-Name' : 'Header-Value'`.
-		// there are also some helper methods
-		headers {
-			header 'key': 'value'
-			contentType(applicationJson())
-		}
-
-		//...
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

request:
-...
-headers:
-  foo: bar
-  fooReq: baz

-

request may contain additional request cookies, as shown in the following example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-		method GET()
-		url "/foo"
-
-		// Each Cookies is added in form `'Cookie-Key' : 'Cookie-Value'`.
-		// there are also some helper methods
-		cookies {
-			cookie 'key': 'value'
-			cookie('another_key', 'another_value')
-		}
-
-		//...
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

request:
-...
-cookies:
-  foo: bar
-  fooReq: baz

-

request may contain a request body:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-		method GET()
-		url "/foo"
-
-		// Currently only JSON format of request body is supported.
-		// Format will be determined from a header or body's content.
-		body '''{ "login" : "john", "name": "John The Contract" }'''
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

request:
-...
-body:
-  foo: bar

-

request may contain multipart elements. To include multipart elements, use the -multipart method/section, as shown in the following examples

Groovy DSL.  -

-

YAML.  -

request:
-  method: PUT
-  url: /multipart
-  headers:
-    Content-Type: multipart/form-data;boundary=AaB03x
-  multipart:
-    params:
-      # key (parameter name), value (parameter value) pair
-      formParameter: '"formParameterValue"'
-      someBooleanParameter: true
-    named:
-      - paramName: file
-        fileName: filename.csv
-        fileContent: file content
-  matchers:
-    multipart:
-      params:
-        - key: formParameter
-          regex: ".+"
-        - key: someBooleanParameter
-          predefined: any_boolean
-      named:
-        - paramName: file
-          fileName:
-            predefined: non_empty
-          fileContent:
-            predefined: non_empty
-response:
-  status: 200

-

In the preceding example, we define parameters in either of two ways:

Groovy DSL

  • Directly, by using the map notation, where the value can be a dynamic property (such as -formParameter: $(consumer(…​), producer(…​))).
  • By using the named(…​) method that lets you set a named parameter. A named parameter -can set a name and content. You can call it either via a method with two arguments, -such as named("fileName", "fileContent"), or via a map notation, such as -named(name: "fileName", content: "fileContent").

YAML

  • The multipart parameters are set via multipart.params section
  • The named parameters (the fileName and fileContent for a given parameter name) -can be set via the multipart.named section. That section contains -the paramName (name of the parameter), fileName (name of the file), -fileContent (content of the file) fields
  • The dynamic bits can be set via the matchers.multipart section

    • for parameters use the params section that can accept -regex or a predefined regular expression
    • for named params use the named section where first you -define the parameter name via paramName and then you can pass the -parametrization of either fileName or fileContent via -regex or a predefined regular expression

From this contract, the generated test is as follows:

// given:
- MockMvcRequestSpecification request = given()
-   .header("Content-Type", "multipart/form-data;boundary=AaB03x")
-   .param("formParameter", "\"formParameterValue\"")
-   .param("someBooleanParameter", "true")
-   .multiPart("file", "filename.csv", "file content".getBytes());
-
-// when:
- ResponseOptions response = given().spec(request)
-   .put("/multipart");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);

The WireMock stub is as follows:

			'''
-{
-  "request" : {
-	"url" : "/multipart",
-	"method" : "PUT",
-	"headers" : {
-	  "Content-Type" : {
-		"matches" : "multipart/form-data;boundary=AaB03x.*"
-	  }
-	},
-	"bodyPatterns" : [ {
-		"matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"formParameter\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Transfer-Encoding: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n\\".+\\"\\r\\n--\\\\1.*"
-  		}, {
-    			"matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"someBooleanParameter\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Transfer-Encoding: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n(true|false)\\r\\n--\\\\1.*"
-  		}, {
-	  "matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"file\\"; filename=\\"[\\\\S\\\\s]+\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Transfer-Encoding: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n[\\\\S\\\\s]+\\r\\n--\\\\1.*"
-	} ]
-  },
-  "response" : {
-	"status" : 200,
-	"transformers" : [ "response-template", "foo-transformer" ]
-  }
-}
-	'''

8.4 Response

The response must contain an HTTP status code and may contain other information. The -following code shows an example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-		method GET()
-		url "/foo"
-	}
-	response {
-		// Status code sent by the server
-		// in response to request specified above.
-		status OK()
-	}
-}

-

YAML.  -

response:
-...
-status: 200

-

Besides status, the response may contain headers, cookies and a body, both of which are -specified the same way as in the request (see the previous paragraph).

[Tip]Tip

Via the Groovy DSL you can reference the org.springframework.cloud.contract.spec.internal.HttpStatus -methods to provide a meaningful status instead of a digit. E.g. you can call -OK() for a status 200 or BAD_REQUEST() for 400.

8.5 Dynamic properties

The contract can contain some dynamic properties: timestamps, IDs, and so on. You do not -want to force the consumers to stub their clocks to always return the same value of time -so that it gets matched by the stub.

For Groovy DSL you can provide the dynamic parts in your contracts -in two ways: pass them directly in the body or set them in a separate section called -bodyMatchers.

[Note]Note

Before 2.0.0 these were set using testMatchers and stubMatchers, -check out the migration guide for more information.

For YAML you can only use the matchers section.

8.5.1 Dynamic properties inside the body

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

You can set the properties inside the body either with the value method or, if you use -the Groovy map notation, with $(). The following example shows how to set dynamic -properties with the value method:

value(consumer(...), producer(...))
-value(c(...), p(...))
-value(stub(...), test(...))
-value(client(...), server(...))

The following example shows how to set dynamic properties with $():

$(consumer(...), producer(...))
-$(c(...), p(...))
-$(stub(...), test(...))
-$(client(...), server(...))

Both approaches work equally well. stub and client methods are aliases over the consumer -method. Subsequent sections take a closer look at what you can do with those values.

8.5.2 Regular expressions

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

You can use regular expressions to write your requests in Contract DSL. Doing so is -particularly useful when you want to indicate that a given response should be provided -for requests that follow a given pattern. Also, you can use regular expressions when you -need to use patterns and not exact values both for your test and your server side tests.

The following example shows how to use regular expressions to write a request:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method('GET')
-		url $(consumer(~/\/[0-9]{2}/), producer('/12'))
-	}
-	response {
-		status OK()
-		body(
-				id: $(anyNumber()),
-				surname: $(
-						consumer('Kowalsky'),
-						producer(regex('[a-zA-Z]+'))
-				),
-				name: 'Jan',
-				created: $(consumer('2014-02-02 12:23:43'), producer(execute('currentDate(it)'))),
-				correlationId: value(consumer('5d1f9fef-e0dc-4f3d-a7e4-72d2220dd827'),
-						producer(regex('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}'))
-				)
-		)
-		headers {
-			header 'Content-Type': 'text/plain'
-		}
-	}
-}

You can also provide only one side of the communication with a regular expression. If you -do so, then the contract engine automatically provides the generated string that matches -the provided regular expression. The following code shows an example:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url value(consumer(regex('/foo/[0-9]{5}')))
-		body([
-				requestElement: $(consumer(regex('[0-9]{5}')))
-		])
-		headers {
-			header('header', $(consumer(regex('application\\/vnd\\.fraud\\.v1\\+json;.*'))))
-		}
-	}
-	response {
-		status OK()
-		body([
-				responseElement: $(producer(regex('[0-9]{7}')))
-		])
-		headers {
-			contentType("application/vnd.fraud.v1+json")
-		}
-	}
-}

In the preceding example, the opposite side of the communication has the respective data -generated for request and response.

Spring Cloud Contract comes with a series of predefined regular expressions that you can -use in your contracts, as shown in the following example:

protected static final Pattern TRUE_OR_FALSE = Pattern.compile(/(true|false)/)
-protected static final Pattern ALPHA_NUMERIC = Pattern.compile('[a-zA-Z0-9]+')
-protected static final Pattern ONLY_ALPHA_UNICODE = Pattern.compile(/[\p{L}]*/)
-protected static final Pattern NUMBER = Pattern.compile('-?(\\d*\\.\\d+|\\d+)')
-protected static final Pattern INTEGER = Pattern.compile('-?(\\d+)')
-protected static final Pattern POSITIVE_INT = Pattern.compile('([1-9]\\d*)')
-protected static final Pattern DOUBLE = Pattern.compile('-?(\\d*\\.\\d+)')
-protected static final Pattern HEX = Pattern.compile('[a-fA-F0-9]+')
-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])')
-protected static final Pattern HOSTNAME_PATTERN = Pattern.
-		compile('((http[s]?|ftp):/)/?([^:/\\s]+)(:[0-9]{1,5})?')
-protected static final Pattern EMAIL = Pattern.
-		compile('[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}')
-protected static final Pattern URL = UrlHelper.URL
-protected static final Pattern HTTPS_URL = UrlHelper.HTTPS_URL
-protected static final Pattern UUID = Pattern.
-		compile('[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}')
-protected static final Pattern ANY_DATE = Pattern.
-		compile('(\\d\\d\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])')
-protected static final Pattern ANY_DATE_TIME = Pattern.
-		compile('([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])')
-protected static final Pattern ANY_TIME = Pattern.
-		compile('(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])')
-protected static final Pattern NON_EMPTY = Pattern.compile(/[\S\s]+/)
-protected static final Pattern NON_BLANK = Pattern.compile(/^\s*\S[\S\s]*/)
-protected static final Pattern ISO8601_WITH_OFFSET = Pattern.
-		compile(/([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.\d{3})?(Z|[+-][01]\d:[0-5]\d)/)
-
-protected static Pattern anyOf(String... values) {
-	return Pattern.compile(values.collect({ "^$it\$" }).join("|"))
-}
-
-RegexProperty onlyAlphaUnicode() {
-	return new RegexProperty(ONLY_ALPHA_UNICODE).asString()
-}
-
-RegexProperty alphaNumeric() {
-	return new RegexProperty(ALPHA_NUMERIC).asString()
-}
-
-RegexProperty number() {
-	return new RegexProperty(NUMBER).asDouble()
-}
-
-RegexProperty positiveInt() {
-	return new RegexProperty(POSITIVE_INT).asInteger()
-}
-
-RegexProperty anyBoolean() {
-	return new RegexProperty(TRUE_OR_FALSE).asBooleanType()
-}
-
-RegexProperty anInteger() {
-	return new RegexProperty(INTEGER).asInteger()
-}
-
-RegexProperty aDouble() {
-	return new RegexProperty(DOUBLE).asDouble()
-}
-
-RegexProperty ipAddress() {
-	return new RegexProperty(IP_ADDRESS).asString()
-}
-
-RegexProperty hostname() {
-	return new RegexProperty(HOSTNAME_PATTERN).asString()
-}
-
-RegexProperty email() {
-	return new RegexProperty(EMAIL).asString()
-}
-
-RegexProperty url() {
-	return new RegexProperty(URL).asString()
-}
-
-RegexProperty httpsUrl() {
-	return new RegexProperty(HTTPS_URL).asString()
-}
-
-RegexProperty uuid() {
-	return new RegexProperty(UUID).asString()
-}
-
-RegexProperty isoDate() {
-	return new RegexProperty(ANY_DATE).asString()
-}
-
-RegexProperty isoDateTime() {
-	return new RegexProperty(ANY_DATE_TIME).asString()
-}
-
-RegexProperty isoTime() {
-	return new RegexProperty(ANY_TIME).asString()
-}
-
-RegexProperty iso8601WithOffset() {
-	return new RegexProperty(ISO8601_WITH_OFFSET).asString()
-}
-
-RegexProperty nonEmpty() {
-	return new RegexProperty(NON_EMPTY).asString()
-}
-
-RegexProperty nonBlank() {
-	return new RegexProperty(NON_BLANK).asString()
-}

In your contract, you can use it as shown in the following example:

Contract dslWithOptionalsInString = Contract.make {
-	priority 1
-	request {
-		method POST()
-		url '/users/password'
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
-				callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
-		)
-	}
-	response {
-		status 404
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				code: value(consumer("123123"), producer(optional("123123"))),
-				message: "User not found by email = [${value(producer(regex(email())), consumer('not.existing@user.com'))}]"
-		)
-	}
-}

To make matters even simpler you can use a set of predefined objects that will automatically assume that you want a regular expression to be passed. -All of those methods start with any prefix:

T anyAlphaUnicode()
-
-T anyAlphaNumeric()
-
-T anyNumber()
-
-T anyInteger()
-
-T anyPositiveInt()
-
-T anyDouble()
-
-T anyHex()
-
-T aBoolean()
-
-T anyIpAddress()
-
-T anyHostname()
-
-T anyEmail()
-
-T anyUrl()
-
-T anyHttpsUrl()
-
-T anyUuid()
-
-T anyDate()
-
-T anyDateTime()
-
-T anyTime()
-
-T anyIso8601WithOffset()
-
-T anyNonBlankString()
-
-T anyNonEmptyString()
-
-T anyOf(String... values)

and this is an example of how you can reference those methods:

Contract contractDsl = Contract.make {
-	label 'trigger_event'
-	input {
-		triggeredBy('toString()')
-	}
-	outputMessage {
-		sentTo 'topic.rateablequote'
-		body([
-				alpha            : $(anyAlphaUnicode()),
-				number           : $(anyNumber()),
-				anInteger        : $(anyInteger()),
-				positiveInt      : $(anyPositiveInt()),
-				aDouble          : $(anyDouble()),
-				aBoolean         : $(aBoolean()),
-				ip               : $(anyIpAddress()),
-				hostname         : $(anyHostname()),
-				email            : $(anyEmail()),
-				url              : $(anyUrl()),
-				httpsUrl         : $(anyHttpsUrl()),
-				uuid             : $(anyUuid()),
-				date             : $(anyDate()),
-				dateTime         : $(anyDateTime()),
-				time             : $(anyTime()),
-				iso8601WithOffset: $(anyIso8601WithOffset()),
-				nonBlankString   : $(anyNonBlankString()),
-				nonEmptyString   : $(anyNonEmptyString()),
-				anyOf            : $(anyOf('foo', 'bar'))
-		])
-	}
-}

8.5.3 Passing Optional Parameters

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

It is possible to provide optional parameters in your contract. However, you can provide -optional parameters only for the following:

  • STUB side of the Request
  • TEST side of the Response

The following example shows how to provide optional parameters:

org.springframework.cloud.contract.spec.Contract.make {
-	priority 1
-	request {
-		method 'POST'
-		url '/users/password'
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
-				callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
-		)
-	}
-	response {
-		status 404
-		headers {
-			header 'Content-Type': 'application/json'
-		}
-		body(
-				code: value(consumer("123123"), producer(optional("123123")))
-		)
-	}
-}

By wrapping a part of the body with the optional() method, you create a regular -expression that must be present 0 or more times.

If you use Spock for, the following test would be generated from the previous example:

					"""
- given:
-  def request = given()
-    .header("Content-Type", "application/json")
-    .body('''{"email":"abc@abc.com","callback_url":"http://partners.com"}''')
-
- when:
-  def response = given().spec(request)
-    .post("/users/password")
-
- then:
-  response.statusCode == 404
-  response.header('Content-Type')  == 'application/json'
- and:
-  DocumentContext parsedJson = JsonPath.parse(response.body.asString())
-  assertThatJson(parsedJson).field("['code']").matches("(123123)?")
-"""

The following stub would also be generated:

					'''
-{
-  "request" : {
-	"url" : "/users/password",
-	"method" : "POST",
-	"bodyPatterns" : [ {
-	  "matchesJsonPath" : "$[?(@.['email'] =~ /([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,6})?/)]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.['callback_url'] =~ /((http[s]?|ftp):\\\\/)\\\\/?([^:\\\\/\\\\s]+)(:[0-9]{1,5})?/)]"
-	} ],
-	"headers" : {
-	  "Content-Type" : {
-		"equalTo" : "application/json"
-	  }
-	}
-  },
-  "response" : {
-	"status" : 404,
-	"body" : "{\\"code\\":\\"123123\\",\\"message\\":\\"User not found by email == [not.existing@user.com]\\"}",
-	"headers" : {
-	  "Content-Type" : "application/json"
-	}
-  },
-  "priority" : 1
-}
-'''

8.5.4 Executing Custom Methods on the Server Side

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

You can define a method call that executes on the server side during the test. Such a -method can be added to the class defined as "baseClassForTests" in the configuration. The -following code shows an example of the contract portion of the test case:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url $(consumer(regex('^/api/[0-9]{2}$')), producer('/api/12'))
-		headers {
-			header 'Content-Type': 'application/json'
-		}
-		body '''\
-			[{
-				"text": "Gonna see you at Warsaw"
-			}]
-		'''
-	}
-	response {
-		body(
-				path: $(consumer('/api/12'), producer(regex('^/api/[0-9]{2}$'))),
-				correlationId: $(consumer('1223456'), producer(execute('isProperCorrelationId($it)')))
-		)
-		status OK()
-	}
-}

The following code shows the base class portion of the test case:

abstract class BaseMockMvcSpec extends Specification {
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new PairIdController())
-	}
-
-	void isProperCorrelationId(Integer correlationId) {
-		assert correlationId == 123456
-	}
-
-	void isEmpty(String value) {
-		assert value == null
-	}
-
-}
[Important]Important

You cannot use both a String and execute to perform concatenation. For -example, calling header('Authorization', 'Bearer ' + execute('authToken()')) leads to -improper results. Instead, call header('Authorization', execute('authToken()')) and -ensure that the authToken() method returns everything you need.

The type of the object read from the JSON can be one of the following, depending on the -JSON path:

  • String: If you point to a String value in the JSON.
  • JSONArray: If you point to a List in the JSON.
  • Map: If you point to a Map in the JSON.
  • Number: If you point to Integer, Double etc. in the JSON.
  • Boolean: If you point to a Boolean in the JSON.

In the request part of the contract, you can specify that the body should be taken from -a method.

[Important]Important

You must provide both the consumer and the producer side. The execute part -is applied for the whole body - not for parts of it.

The following example shows how to read an object from JSON:

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		url '/something'
-		body(
-				$(c('foo'), p(execute('hashCode()')))
-		)
-	}
-	response {
-		status OK()
-	}
-}

The preceding example results in calling the hashCode() method in the request body. -It should resemble the following code:

// given:
- MockMvcRequestSpecification request = given()
-   .body(hashCode());
-
-// when:
- ResponseOptions response = given().spec(request)
-   .get("/something");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);

8.5.5 Referencing the Request from the Response

The best situation is to provide fixed values, but sometimes you need to reference a -request in your response.

If you’re writing contracts using Groovy DSL, you can use the fromRequest() method, which lets -you reference a bunch of elements from the HTTP request. You can use the following -options:

  • fromRequest().url(): Returns the request URL and query parameters.
  • fromRequest().query(String key): Returns the first query parameter with a given name.
  • fromRequest().query(String key, int index): Returns the nth query parameter with a -given name.
  • fromRequest().path(): Returns the full path.
  • fromRequest().path(int index): Returns the nth path element.
  • fromRequest().header(String key): Returns the first header with a given name.
  • fromRequest().header(String key, int index): Returns the nth header with a given name.
  • fromRequest().body(): Returns the full request body.
  • fromRequest().body(String jsonPath): Returns the element from the request that -matches the JSON Path.

If you’re using the YAML contract definition you have to use the -Handlebars {{{ }}} notation with custom, Spring Cloud Contract - functions to achieve this.

  • {{{ request.url }}}: Returns the request URL and query parameters.
  • {{{ request.query.key.[index] }}}: Returns the nth query parameter with a given name. -E.g. for key foo, first entry {{{ request.query.foo.[0] }}}
  • {{{ request.path }}}: Returns the full path.
  • {{{ request.path.[index] }}}: Returns the nth path element. E.g. -for first entry `{{{ request.path.[0] }}}
  • {{{ request.headers.key }}}: Returns the first header with a given name.
  • {{{ request.headers.key.[index] }}}: Returns the nth header with a given name.
  • {{{ request.body }}}: Returns the full request body.
  • {{{ jsonpath this 'your.json.path' }}}: Returns the element from the request that -matches the JSON Path. E.g. for json path $.foo - {{{ jsonpath this '$.foo' }}}

Consider the following contract:

Groovy DSL.  -

-

YAML.  -

request:
-  method: GET
-  url: /api/v1/xxxx
-  queryParameters:
-    foo:
-      - bar
-      - bar2
-  headers:
-    Authorization:
-      - secret
-      - secret2
-  body:
-    foo: bar
-    baz: 5
-response:
-  status: 200
-  headers:
-    Authorization: "foo {{{ request.headers.Authorization.0 }}} bar"
-  body:
-    url: "{{{ request.url }}}"
-    path: "{{{ request.path }}}"
-    pathIndex: "{{{ request.path.1 }}}"
-    param: "{{{ request.query.foo }}}"
-    paramIndex: "{{{ request.query.foo.1 }}}"
-    authorization: "{{{ request.headers.Authorization.0 }}}"
-    authorization2: "{{{ request.headers.Authorization.1 }}"
-    fullBody: "{{{ request.body }}}"
-    responseFoo: "{{{ jsonpath this '$.foo' }}}"
-    responseBaz: "{{{ jsonpath this '$.baz' }}}"
-    responseBaz2: "Bla bla {{{ jsonpath this '$.foo' }}} bla bla"

-

Running a JUnit test generation leads to a test that resembles the following example:

// given:
- MockMvcRequestSpecification request = given()
-   .header("Authorization", "secret")
-   .header("Authorization", "secret2")
-   .body("{\"foo\":\"bar\",\"baz\":5}");
-
-// when:
- ResponseOptions response = given().spec(request)
-   .queryParam("foo","bar")
-   .queryParam("foo","bar2")
-   .get("/api/v1/xxxx");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Authorization")).isEqualTo("foo secret bar");
-// and:
- DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
- assertThatJson(parsedJson).field("['fullBody']").isEqualTo("{\"foo\":\"bar\",\"baz\":5}");
- assertThatJson(parsedJson).field("['authorization']").isEqualTo("secret");
- assertThatJson(parsedJson).field("['authorization2']").isEqualTo("secret2");
- assertThatJson(parsedJson).field("['path']").isEqualTo("/api/v1/xxxx");
- assertThatJson(parsedJson).field("['param']").isEqualTo("bar");
- assertThatJson(parsedJson).field("['paramIndex']").isEqualTo("bar2");
- assertThatJson(parsedJson).field("['pathIndex']").isEqualTo("v1");
- assertThatJson(parsedJson).field("['responseBaz']").isEqualTo(5);
- assertThatJson(parsedJson).field("['responseFoo']").isEqualTo("bar");
- assertThatJson(parsedJson).field("['url']").isEqualTo("/api/v1/xxxx?foo=bar&foo=bar2");
- assertThatJson(parsedJson).field("['responseBaz2']").isEqualTo("Bla bla bar bla bla");

As you can see, elements from the request have been properly referenced in the response.

The generated WireMock stub should resemble the following example:

{
-  "request" : {
-    "urlPath" : "/api/v1/xxxx",
-    "method" : "POST",
-    "headers" : {
-      "Authorization" : {
-        "equalTo" : "secret2"
-      }
-    },
-    "queryParameters" : {
-      "foo" : {
-        "equalTo" : "bar2"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.['baz'] == 5)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['foo'] == 'bar')]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\"authorization\":\"{{{request.headers.Authorization.[0]}}}\",\"path\":\"{{{request.path}}}\",\"responseBaz\":{{{jsonpath this '$.baz'}}} ,\"param\":\"{{{request.query.foo.[0]}}}\",\"pathIndex\":\"{{{request.path.[1]}}}\",\"responseBaz2\":\"Bla bla {{{jsonpath this '$.foo'}}} bla bla\",\"responseFoo\":\"{{{jsonpath this '$.foo'}}}\",\"authorization2\":\"{{{request.headers.Authorization.[1]}}}\",\"fullBody\":\"{{{escapejsonbody}}}\",\"url\":\"{{{request.url}}}\",\"paramIndex\":\"{{{request.query.foo.[1]}}}\"}",
-    "headers" : {
-      "Authorization" : "{{{request.headers.Authorization.[0]}}};foo"
-    },
-    "transformers" : [ "response-template" ]
-  }
-}

Sending a request such as the one presented in the request part of the contract results -in sending the following response body:

{
-  "url" : "/api/v1/xxxx?foo=bar&foo=bar2",
-  "path" : "/api/v1/xxxx",
-  "pathIndex" : "v1",
-  "param" : "bar",
-  "paramIndex" : "bar2",
-  "authorization" : "secret",
-  "authorization2" : "secret2",
-  "fullBody" : "{\"foo\":\"bar\",\"baz\":5}",
-  "responseFoo" : "bar",
-  "responseBaz" : 5,
-  "responseBaz2" : "Bla bla bar bla bla"
-}
[Important]Important

This feature works only with WireMock having a version greater than or equal -to 2.5.1. The Spring Cloud Contract Verifier uses WireMock’s -response-template response transformer. It uses Handlebars to convert the Mustache {{{ }}} templates into -proper values. Additionally, it registers two helper functions:

  • escapejsonbody: Escapes the request body in a format that can be embedded in a JSON.
  • jsonpath: For a given parameter, find an object in the request body.

8.5.6 Registering Your Own WireMock Extension

WireMock lets you register custom extensions. By default, Spring Cloud Contract registers -the transformer, which lets you reference a request from a response. If you want to -provide your own extensions, you can register an implementation of the -org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockExtensions interface. -Since we use the spring.factories extension approach, you can create an entry in -META-INF/spring.factories file similar to the following:

org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockExtensions=\
-org.springframework.cloud.contract.stubrunner.provider.wiremock.TestWireMockExtensions
-org.springframework.cloud.contract.spec.ContractConverter=\
-org.springframework.cloud.contract.stubrunner.TestCustomYamlContractConverter

The following is an example of a custom extension:

TestWireMockExtensions.groovy.  -

/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.contract.verifier.dsl.wiremock
-
-import com.github.tomakehurst.wiremock.extension.Extension
-
-/**
- * Extension that registers the default transformer and the custom one
- */
-class TestWireMockExtensions implements WireMockExtensions {
-	@Override
-	List<Extension> extensions() {
-		return [
-				new DefaultResponseTransformer(),
-				new CustomExtension()
-		]
-	}
-}
-
-class CustomExtension implements Extension {
-
-	@Override
-	String getName() {
-		return "foo-transformer"
-	}
-}

-

[Important]Important

Remember to override the applyGlobally() method and set it to false if you -want the transformation to be applied only for a mapping that explicitly requires it.

8.5.7 Dynamic Properties in the Matchers Sections

If you work with Pact, the following discussion may seem familiar. -Quite a few users are used to having a separation between the body and setting the -dynamic parts of a contract.

You can use the bodyMatchers section for two reasons:

  • Define the dynamic values that should end up in a stub. -You can set it in the request or inputMessage part of your contract.
  • Verify the result of your test. -This section is present in the response or outputMessage side of the -contract.

Currently, Spring Cloud Contract Verifier supports only JSON Path-based matchers with the -following matching possibilities:

Groovy DSL

  • For the stubs(in tests on the Consumer’s side):

    • byEquality(): The value taken from the consumer’s request via the provided JSON Path must be -equal to the value provided in the contract.
    • byRegex(…​): The value taken from the consumer’s request via the provided JSON Path must -match the regex. You can also pass the type of the expected matched value (e.g. asString(), asLong() etc.)
    • byDate(): The value taken from the consumer’s request via the provided JSON Path must -match the regex for an ISO Date value.
    • byTimestamp(): The value taken from the consumer’s request via the provided JSON Path must -match the regex for an ISO DateTime value.
    • byTime(): The value taken from the consumer’s request via the provided JSON Path must -match the regex for an ISO Time value.
  • For the verification(in generated tests on the Producer’s side):

    • byEquality(): The value taken from the producer’s response via the provided JSON Path must be -equal to the provided value in the contract.
    • byRegex(…​): The value taken from the producer’s response via the provided JSON Path must -match the regex.
    • byDate(): The value taken from the producer’s response via the provided JSON Path must match -the regex for an ISO Date value.
    • byTimestamp(): The value taken from the producer’s response via the provided JSON Path must -match the regex for an ISO DateTime value.
    • byTime(): The value taken from the producer’s response via the provided JSON Path must match -the regex for an ISO Time value.
    • byType(): The value taken from the producer’s response via the provided JSON Path needs to be -of the same type as the type defined in the body of the response in the contract. -byType can take a closure, in which you can set minOccurrence and maxOccurrence. For the request side, you should use the closure to assert size of the collection. -That way, you can assert the size of the flattened collection. To check the size of an -unflattened collection, use a custom method with the byCommand(…​) testMatcher.
    • byCommand(…​): The value taken from the producer’s response via the provided JSON Path is -passed as an input to the custom method that you provide. For example, -byCommand('foo($it)') results in calling a foo method to which the value matching the -JSON Path gets passed. The type of the object read from the JSON can be one of the -following, depending on the JSON path:

      • String: If you point to a String value.
      • JSONArray: If you point to a List.
      • Map: If you point to a Map.
      • Number: If you point to Integer, Double, or other kind of number.
      • Boolean: If you point to a Boolean.
    • byNull(): The value taken from the response via the provided JSON Path must be null

YAML. Please read the Groovy section for detailed explanation of -what the types mean

For YAML the structure of a matcher looks like this

- path: $.foo
-  type: by_regex
-  value: bar
-  regexType: as_string

Or if you want to use one of the predefined regular expressions -[only_alpha_unicode, number, any_boolean, ip_address, hostname, -email, url, uuid, iso_date, iso_date_time, iso_time, iso_8601_with_offset, non_empty, non_blank]:

- path: $.foo
-  type: by_regex
-  predefined: only_alpha_unicode

Below you can find the allowed list of `type`s.

  • For stubMatchers:

    • by_equality
    • by_regex
    • by_date
    • by_timestamp
    • by_time
    • by_type

      • there are 2 additional fields accepted: minOccurrence and maxOccurrence.
  • For testMatchers:

    • by_equality
    • by_regex
    • by_date
    • by_timestamp
    • by_time
    • by_type

      • there are 2 additional fields accepted: minOccurrence and maxOccurrence.
    • by_command
    • by_null

You can also define which type the regular expression corresponds to via the regexType field. Below you can find the allowed list of regular expression types:

  • as_integer
  • as_double
  • as_float,
  • as_long
  • as_short
  • as_boolean
  • as_string

Consider the following example:

Groovy DSL.  -

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		urlPath '/get'
-		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',
-				key                 : [
-						'complex.key': 'foo'
-				]
-		])
-		bodyMatchers {
-			jsonPath('$.duck', byRegex("[0-9]{3}").asInteger())
-			jsonPath('$.duck', byEquality())
-			jsonPath('$.alpha', byRegex(onlyAlphaUnicode()).asString())
-			jsonPath('$.alpha', byEquality())
-			jsonPath('$.number', byRegex(number()).asInteger())
-			jsonPath('$.aBoolean', byRegex(anyBoolean()).asBooleanType())
-			jsonPath('$.date', byDate())
-			jsonPath('$.dateTime', byTimestamp())
-			jsonPath('$.time', byTime())
-			jsonPath("\$.['key'].['complex.key']", byEquality())
-		}
-		headers {
-			contentType(applicationJson())
-		}
-	}
-	response {
-		status OK()
-		body([
-				duck                 : 123,
-				alpha                : 'abc',
-				number               : 123,
-				positiveInteger      : 1234567890,
-				negativeInteger      : -1234567890,
-				positiveDecimalNumber: 123.4567890,
-				negativeDecimalNumber: -123.4567890,
-				aBoolean             : true,
-				date                 : '2017-01-01',
-				dateTime             : '2017-01-01T01:23:45',
-				time                 : "01:02:34",
-				valueWithoutAMatcher : 'foo',
-				valueWithTypeMatch   : 'string',
-				valueWithMin         : [
-						1, 2, 3
-				],
-				valueWithMax         : [
-						1, 2, 3
-				],
-				valueWithMinMax      : [
-						1, 2, 3
-				],
-				valueWithMinEmpty    : [],
-				valueWithMaxEmpty    : [],
-				key                  : [
-						'complex.key': 'foo'
-				],
-				nullValue            : null
-		])
-		bodyMatchers {
-			// asserts the jsonpath value against manual regex
-			jsonPath('$.duck', byRegex("[0-9]{3}").asInteger())
-			// asserts the jsonpath value against the provided value
-			jsonPath('$.duck', byEquality())
-			// asserts the jsonpath value against some default regex
-			jsonPath('$.alpha', byRegex(onlyAlphaUnicode()).asString())
-			jsonPath('$.alpha', byEquality())
-			jsonPath('$.number', byRegex(number()).asInteger())
-			jsonPath('$.positiveInteger', byRegex(anInteger()).asInteger())
-			jsonPath('$.negativeInteger', byRegex(anInteger()).asInteger())
-			jsonPath('$.positiveDecimalNumber', byRegex(aDouble()).asDouble())
-			jsonPath('$.negativeDecimalNumber', byRegex(aDouble()).asDouble())
-			jsonPath('$.aBoolean', byRegex(anyBoolean()).asBooleanType())
-			// asserts vs inbuilt time related regex
-			jsonPath('$.date', byDate())
-			jsonPath('$.dateTime', byTimestamp())
-			jsonPath('$.time', byTime())
-			// asserts that the resulting type is the same as in response body
-			jsonPath('$.valueWithTypeMatch', byType())
-			jsonPath('$.valueWithMin', byType {
-				// results in verification of size of array (min 1)
-				minOccurrence(1)
-			})
-			jsonPath('$.valueWithMax', byType {
-				// results in verification of size of array (max 3)
-				maxOccurrence(3)
-			})
-			jsonPath('$.valueWithMinMax', byType {
-				// results in verification of size of array (min 1 & max 3)
-				minOccurrence(1)
-				maxOccurrence(3)
-			})
-			jsonPath('$.valueWithMinEmpty', byType {
-				// results in verification of size of array (min 0)
-				minOccurrence(0)
-			})
-			jsonPath('$.valueWithMaxEmpty', byType {
-				// results in verification of size of array (max 0)
-				maxOccurrence(0)
-			})
-			// will execute a method `assertThatValueIsANumber`
-			jsonPath('$.duck', byCommand('assertThatValueIsANumber($it)'))
-			jsonPath("\$.['key'].['complex.key']", byEquality())
-			jsonPath('$.nullValue', byNull())
-		}
-		headers {
-			contentType(applicationJson())
-			header('Some-Header', $(c('someValue'), p(regex('[a-zA-Z]{9}'))))
-		}
-	}
-}

-

YAML.  -

request:
-  method: GET
-  urlPath: /get/1
-  headers:
-    Content-Type: application/json
-  cookies:
-    foo: 2
-    bar: 3
-  queryParameters:
-    limit: 10
-    offset: 20
-    filter: 'email'
-    sort: name
-    search: 55
-    age: 99
-    name: John.Doe
-    email: 'bob@email.com'
-  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"
-    key:
-      "complex.key": 'foo'
-    nullValue: null
-    valueWithMin:
-      - 1
-      - 2
-      - 3
-    valueWithMax:
-      - 1
-      - 2
-      - 3
-    valueWithMinMax:
-      - 1
-      - 2
-      - 3
-    valueWithMinEmpty: []
-    valueWithMaxEmpty: []
-  matchers:
-    url:
-      regex: /get/[0-9]
-      # predefined:
-      # execute a method
-      #command: 'equals($it)'
-    queryParameters:
-      - key: limit
-        type: equal_to
-        value: 20
-      - key: offset
-        type: containing
-        value: 20
-      - key: sort
-        type: equal_to
-        value: name
-      - key: search
-        type: not_matching
-        value: '^[0-9]{2}$'
-      - key: age
-        type: not_matching
-        value: '^\\w*$'
-      - key: name
-        type: matching
-        value: 'John.*'
-      - key: hello
-        type: absent
-    cookies:
-      - key: foo
-        regex: '[0-9]'
-      - key: bar
-        command: 'equals($it)'
-    headers:
-      - key: Content-Type
-        regex: "application/json.*"
-    body:
-      - path: $.duck
-        type: by_regex
-        value: "[0-9]{3}"
-      - path: $.duck
-        type: by_equality
-      - path: $.alpha
-        type: by_regex
-        predefined: only_alpha_unicode
-      - path: $.alpha
-        type: by_equality
-      - path: $.number
-        type: by_regex
-        predefined: number
-      - path: $.aBoolean
-        type: by_regex
-        predefined: any_boolean
-      - path: $.date
-        type: by_date
-      - path: $.dateTime
-        type: by_timestamp
-      - path: $.time
-        type: by_time
-      - path: "$.['key'].['complex.key']"
-        type: by_equality
-      - path: $.nullvalue
-        type: by_null
-      - path: $.valueWithMin
-        type: by_type
-        minOccurrence: 1
-      - path: $.valueWithMax
-        type: by_type
-        maxOccurrence: 3
-      - path: $.valueWithMinMax
-        type: by_type
-        minOccurrence: 1
-        maxOccurrence: 3
-response:
-  status: 200
-  cookies:
-    foo: 1
-    bar: 2
-  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"
-    valueWithMin:
-      - 1
-      - 2
-      - 3
-    valueWithMax:
-      - 1
-      - 2
-      - 3
-    valueWithMinMax:
-      - 1
-      - 2
-      - 3
-    valueWithMinEmpty: []
-    valueWithMaxEmpty: []
-    key:
-      'complex.key': 'foo'
-    nulValue: null
-  matchers:
-    headers:
-      - key: Content-Type
-        regex: "application/json.*"
-    cookies:
-      - key: foo
-        regex: '[0-9]'
-      - key: bar
-        command: 'equals($it)'
-    body:
-      - path: $.duck
-        type: by_regex
-        value: "[0-9]{3}"
-      - path: $.duck
-        type: by_equality
-      - path: $.alpha
-        type: by_regex
-        predefined: only_alpha_unicode
-      - path: $.alpha
-        type: by_equality
-      - path: $.number
-        type: by_regex
-        predefined: number
-      - path: $.aBoolean
-        type: by_regex
-        predefined: any_boolean
-      - path: $.date
-        type: by_date
-      - path: $.dateTime
-        type: by_timestamp
-      - path: $.time
-        type: by_time
-      - path: $.valueWithTypeMatch
-        type: by_type
-      - path: $.valueWithMin
-        type: by_type
-        minOccurrence: 1
-      - path: $.valueWithMax
-        type: by_type
-        maxOccurrence: 3
-      - path: $.valueWithMinMax
-        type: by_type
-        minOccurrence: 1
-        maxOccurrence: 3
-      - path: $.valueWithMinEmpty
-        type: by_type
-        minOccurrence: 0
-      - path: $.valueWithMaxEmpty
-        type: by_type
-        maxOccurrence: 0
-      - path: $.duck
-        type: by_command
-        value: assertThatValueIsANumber($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-  headers:
-    Content-Type: application/json

-

In the preceding example, you can see the dynamic portions of the contract in the -matchers sections. For the request part, you can see that, for all fields but -valueWithoutAMatcher, the values of the regular expressions that the stub should -contain are explicitly set. For the valueWithoutAMatcher, the verification takes place -in the same way as without the use of matchers. In that case, the test performs an -equality check.

For the response side in the bodyMatchers section, we define the dynamic parts in a -similar manner. The only difference is that the byType matchers are also present. The -verifier engine checks four fields to verify whether the response from the test -has a value for which the JSON path matches the given field, is of the same type as the one -defined in the response body, and passes the following check (based on the method being called):

  • For $.valueWithTypeMatch, the engine checks whether the type is the same.
  • For $.valueWithMin, the engine check the type and asserts whether the size is greater -than or equal to the minimum occurrence.
  • For $.valueWithMax, the engine checks the type and asserts whether the size is -smaller than or equal to the maximum occurrence.
  • For $.valueWithMinMax, the engine checks the type and asserts whether the size is -between the min and maximum occurrence.

The resulting test would resemble the following example (note that an and section -separates the autogenerated assertions and the assertion from matchers):

// 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\",\"key\":{\"complex.key\":\"foo\"}}");
-
-// when:
- ResponseOptions response = given().spec(request)
-   .get("/get");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Content-Type")).matches("application/json.*");
-// and:
- DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
- assertThatJson(parsedJson).field("['valueWithoutAMatcher']").isEqualTo("foo");
-// and:
- assertThat(parsedJson.read("$.duck", String.class)).matches("[0-9]{3}");
- assertThat(parsedJson.read("$.duck", Integer.class)).isEqualTo(123);
- assertThat(parsedJson.read("$.alpha", String.class)).matches("[\\p{L}]*");
- assertThat(parsedJson.read("$.alpha", String.class)).isEqualTo("abc");
- assertThat(parsedJson.read("$.number", String.class)).matches("-?(\\d*\\.\\d+|\\d+)");
- assertThat(parsedJson.read("$.aBoolean", String.class)).matches("(true|false)");
- assertThat(parsedJson.read("$.date", String.class)).matches("(\\d\\d\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])");
- assertThat(parsedJson.read("$.dateTime", String.class)).matches("([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])");
- assertThat(parsedJson.read("$.time", String.class)).matches("(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])");
- assertThat((Object) parsedJson.read("$.valueWithTypeMatch")).isInstanceOf(java.lang.String.class);
- assertThat((Object) parsedJson.read("$.valueWithMin")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMin", java.util.Collection.class)).as("$.valueWithMin").hasSizeGreaterThanOrEqualTo(1);
- assertThat((Object) parsedJson.read("$.valueWithMax")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMax", java.util.Collection.class)).as("$.valueWithMax").hasSizeLessThanOrEqualTo(3);
- assertThat((Object) parsedJson.read("$.valueWithMinMax")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMinMax", java.util.Collection.class)).as("$.valueWithMinMax").hasSizeBetween(1, 3);
- assertThat((Object) parsedJson.read("$.valueWithMinEmpty")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMinEmpty", java.util.Collection.class)).as("$.valueWithMinEmpty").hasSizeGreaterThanOrEqualTo(0);
- assertThat((Object) parsedJson.read("$.valueWithMaxEmpty")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMaxEmpty", java.util.Collection.class)).as("$.valueWithMaxEmpty").hasSizeLessThanOrEqualTo(0);
- assertThatValueIsANumber(parsedJson.read("$.duck"));
- assertThat(parsedJson.read("$.['key'].['complex.key']", String.class)).isEqualTo("foo");
[Important]Important

Notice that, for the byCommand method, the example calls the -assertThatValueIsANumber. This method must be defined in the test base class or be -statically imported to your tests. Notice that the byCommand call was converted to -assertThatValueIsANumber(parsedJson.read("$.duck"));. That means that the engine took -the method name and passed the proper JSON path as a parameter to it.

The resulting WireMock stub is in the following example:

					'''
-{
-  "request" : {
-    "urlPath" : "/get",
-    "method" : "POST",
-    "headers" : {
-      "Content-Type" : {
-        "matches" : "application/json.*"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$.['list'].['some'].['nested'][?(@.['anothervalue'] == 4)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['valueWithoutAMatcher'] == 'foo')]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['valueWithTypeMatch'] == 'string')]"
-    }, {
-      "matchesJsonPath" : "$.['list'].['someother'].['nested'][?(@.['json'] == 'with value')]"
-    }, {
-      "matchesJsonPath" : "$.['list'].['someother'].['nested'][?(@.['anothervalue'] == 4)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.duck =~ /([0-9]{3})/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.duck == 123)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.alpha =~ /([\\\\p{L}]*)/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.alpha == 'abc')]"
-    }, {
-      "matchesJsonPath" : "$[?(@.number =~ /(-?(\\\\d*\\\\.\\\\d+|\\\\d+))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.aBoolean =~ /((true|false))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.date =~ /((\\\\d\\\\d\\\\d\\\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.dateTime =~ /(([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.time =~ /((2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]))/)]"
-    }, {
-      "matchesJsonPath" : "$.list.some.nested[?(@.json =~ /(.*)/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.valueWithMin.size() >= 1)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.valueWithMax.size() <= 3)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.valueWithMinMax.size() >= 1 && @.valueWithMinMax.size() <= 3)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.valueWithOccurrence.size() >= 4 && @.valueWithOccurrence.size() <= 4)]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\\"date\\":\\"2017-01-01\\",\\"dateTime\\":\\"2017-01-01T01:23:45\\",\\"aBoolean\\":true,\\"valueWithMax\\":[1,2,3],\\"valueWithOccurrence\\":[1,2,3,4],\\"number\\":123,\\"duck\\":123,\\"alpha\\":\\"abc\\",\\"valueWithMin\\":[1,2,3],\\"time\\":\\"01:02:34\\",\\"valueWithTypeMatch\\":\\"string\\",\\"valueWithMinMax\\":[1,2,3],\\"valueWithoutAMatcher\\":\\"foo\\"}",
-    "headers" : {
-      "Content-Type" : "application/json"
-    },
-    "transformers" : [ "response-template" ]
-  }
-}
-'''
[Important]Important

If you use a matcher, then the part of the request and response that the -matcher addresses with the JSON Path gets removed from the assertion. In the case of -verifying a collection, you must create matchers for all the elements of the -collection.

Consider the following example:

Contract.make {
-    request {
-        method 'GET'
-        url("/foo")
-    }
-    response {
-        status OK()
-        body(events: [[
-                                 operation          : 'EXPORT',
-                                 eventId            : '16f1ed75-0bcc-4f0d-a04d-3121798faf99',
-                                 status             : 'OK'
-                         ], [
-                                 operation          : 'INPUT_PROCESSING',
-                                 eventId            : '3bb4ac82-6652-462f-b6d1-75e424a0024a',
-                                 status             : 'OK'
-                         ]
-                ]
-        )
-        bodyMatchers {
-            jsonPath('$.events[0].operation', byRegex('.+'))
-            jsonPath('$.events[0].eventId', byRegex('^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})$'))
-            jsonPath('$.events[0].status', byRegex('.+'))
-        }
-    }
-}

The preceding code leads to creating the following test (the code block shows only the assertion section):

and:
-	DocumentContext parsedJson = JsonPath.parse(response.body.asString())
-	assertThatJson(parsedJson).array("['events']").contains("['eventId']").isEqualTo("16f1ed75-0bcc-4f0d-a04d-3121798faf99")
-	assertThatJson(parsedJson).array("['events']").contains("['operation']").isEqualTo("EXPORT")
-	assertThatJson(parsedJson).array("['events']").contains("['operation']").isEqualTo("INPUT_PROCESSING")
-	assertThatJson(parsedJson).array("['events']").contains("['eventId']").isEqualTo("3bb4ac82-6652-462f-b6d1-75e424a0024a")
-	assertThatJson(parsedJson).array("['events']").contains("['status']").isEqualTo("OK")
-and:
-	assertThat(parsedJson.read("\$.events[0].operation", String.class)).matches(".+")
-	assertThat(parsedJson.read("\$.events[0].eventId", String.class)).matches("^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})\$")
-	assertThat(parsedJson.read("\$.events[0].status", String.class)).matches(".+")

As you can see, the assertion is malformed. Only the first element of the array got -asserted. In order to fix this, you should apply the assertion to the whole $.events -collection and assert it with the byCommand(…​) method.

8.6 JAX-RS Support

The Spring Cloud Contract Verifier supports the JAX-RS 2 Client API. The base class needs -to define protected WebTarget webTarget and server initialization. The only option for -testing JAX-RS API is to start a web server. Also, a request with a body needs to have a -content type set. Otherwise, the default of application/octet-stream gets used.

In order to use JAX-RS mode, use the following settings:

testMode == 'JAXRSCLIENT'

The following example shows a generated test API:

					'''
- // when:
-  Response response = webTarget
-    .path("/users")
-    .queryParam("limit", "10")
-    .queryParam("offset", "20")
-    .queryParam("filter", "email")
-    .queryParam("sort", "name")
-    .queryParam("search", "55")
-    .queryParam("age", "99")
-    .queryParam("name", "Denis.Stepanov")
-    .queryParam("email", "bob@email.com")
-    .request()
-    .method("GET");
-
-  String responseAsString = response.readEntity(String.class);
-
- // then:
-  assertThat(response.getStatus()).isEqualTo(200);
- // and:
-  DocumentContext parsedJson = JsonPath.parse(responseAsString);
-  assertThatJson(parsedJson).field("['property1']").isEqualTo("a");
-'''

8.7 Async Support

If you’re using asynchronous communication on the server side (your controllers are -returning Callable, DeferredResult, and so on), then, inside your contract, you must -provide an async() method in the response section. The following code shows an example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-    request {
-        method GET()
-        url '/get'
-    }
-    response {
-        status OK()
-        body 'Passed'
-        async()
-    }
-}

-

YAML.  -

response:
-    async: true

-

You can also use the fixedDelayMilliseconds method / property to add delay to your stubs.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-    request {
-        method GET()
-        url '/get'
-    }
-    response {
-        status 200
-        body 'Passed'
-        fixedDelayMilliseconds 1000
-    }
-}

-

YAML.  -

response:
-    fixedDelayMilliseconds: 1000

-

8.8 Working with Context Paths

Spring Cloud Contract supports context paths.

[Important]Important

The only change needed to fully support context paths is the switch on the -PRODUCER side. Also, the autogenerated tests must use EXPLICIT mode. The consumer -side remains untouched. In order for the generated test to pass, you must use EXPLICIT -mode.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <testMode>EXPLICIT</testMode>
-    </configuration>
-</plugin>

-

Gradle.  -

contracts {
-		testMode = 'EXPLICIT'
-}

-

That way, you generate a test that DOES NOT use MockMvc. It means that you generate -real requests and you need to setup your generated test’s base class to work on a real -socket.

Consider the following contract:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'GET'
-		url '/my-context-path/url'
-	}
-	response {
-		status OK()
-	}
-}

The following example shows how to set up a base class and Rest Assured:

import io.restassured.RestAssured;
-import org.junit.Before;
-import org.springframework.boot.web.server.LocalServerPort;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest(classes = ContextPathTestingBaseClass.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-class ContextPathTestingBaseClass {
-
-	@LocalServerPort int port;
-
-	@Before
-	public void setup() {
-		RestAssured.baseURI = "http://localhost";
-		RestAssured.port = this.port;
-	}
-}

If you do it this way:

  • All of your requests in the autogenerated tests are sent to the real endpoint with your -context path included (for example, /my-context-path/url).
  • Your contracts reflect that you have a context path. Your generated stubs also have -that information (for example, in the stubs, you have to call /my-context-path/url).

8.9 Working with WebFlux

Spring Cloud Contract offers two ways of working with WebFlux.

8.9.1 WebFlux with WebTestClient

One of them is via the WebTestClient mode.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <testMode>WEBTESTCLIENT</testMode>
-    </configuration>
-</plugin>

-

Gradle.  -

contracts {
-		testMode = 'WEBTESTCLIENT'
-}

-

The following example shows how to set up a WebTestClient base class and RestAssured -for WebFlux:

import io.restassured.module.webtestclient.RestAssuredWebTestClient;
-import org.junit.Before;
-
-public abstract class BeerRestBase {
-
-	@Before
-	public void setup() {
-		RestAssuredWebTestClient.standaloneSetup(
-		new ProducerController(personToCheck -> personToCheck.age >= 20));
-	}
-}
-}

8.9.2 WebFlux with Explicit mode

Another way is with the EXPLICIT mode in your generated tests -to work with WebFlux.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <testMode>EXPLICIT</testMode>
-    </configuration>
-</plugin>

-

Gradle.  -

contracts {
-		testMode = 'EXPLICIT'
-}

-

The following example shows how to set up a base class and Rest Assured for Web Flux:

@RunWith(SpringRunner.class)
-@SpringBootTest(classes = BeerRestBase.Config.class,
-		webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
-		properties = "server.port=0")
-public abstract class BeerRestBase {
-
-    // your tests go here
-
-    // in this config class you define all controllers and mocked services
-@Configuration
-@EnableAutoConfiguration
-static class Config {
-
-	@Bean
-	PersonCheckingService personCheckingService()  {
-		return personToCheck -> personToCheck.age >= 20;
-	}
-
-	@Bean
-	ProducerController producerController() {
-		return new ProducerController(personCheckingService());
-	}
-}
-
-}

8.10 XML Support for REST

For REST contracts, we also support XML request and response body. -The XML body has to be passed within the body element -as a String or GString. Also body matchers can be provided for -both request and response. In place of the jsonPath(…​) method, the org.springframework.cloud.contract.spec.internal.BodyMatchers.xPath -method should be used, with the desired xPath provided as the first argument -and the appropriate MatchingType as second. All the body matchers apart from byType() are supported.

Here is an example of a Groovy DSL contract with XML response body:

					Contract.make {
-						request {
-							method GET()
-							urlPath '/get'
-							headers {
-								contentType(applicationXml())
-							}
-						}
-						response {
-							status(OK())
-							headers {
-								contentType(applicationXml())
-							}
-							body """
-<test>
-<duck type='xtype'>123</duck>
-<alpha>abc</alpha>
-<list>
-<elem>abc</elem>
-<elem>def</elem>
-<elem>ghi</elem>
-</list>
-<number>123</number>
-<aBoolean>true</aBoolean>
-<date>2017-01-01</date>
-<dateTime>2017-01-01T01:23:45</dateTime>
-<time>01:02:34</time>
-<valueWithoutAMatcher>foo</valueWithoutAMatcher>
-<key><complex>foo</complex></key>
-</test>"""
-							bodyMatchers {
-								xPath('/test/duck/text()', byRegex("[0-9]{3}"))
-								xPath('/test/duck/text()', byCommand('test($it)'))
-								xPath('/test/duck/xxx', byNull())
-								xPath('/test/duck/text()', byEquality())
-								xPath('/test/alpha/text()', byRegex(onlyAlphaUnicode()))
-								xPath('/test/alpha/text()', byEquality())
-								xPath('/test/number/text()', byRegex(number()))
-								xPath('/test/date/text()', byDate())
-								xPath('/test/dateTime/text()', byTimestamp())
-								xPath('/test/time/text()', byTime())
-								xPath('/test/*/complex/text()', byEquality())
-								xPath('/test/duck/@type', byEquality())
-							}
-						}
-					}

And below is an example of a YAML contract with XML request and response bodies:

include::{verifier_core_path}/src/test/resources/yml/contract_rest_xml.yml

Here is an example of an automatically generated test for XML response body:

@Test
-public void validate_xmlMatches() throws Exception {
-	// given:
-	MockMvcRequestSpecification request = given()
-				.header("Content-Type", "application/xml");
-
-	// when:
-	ResponseOptions response = given().spec(request).get("/get");
-
-	// then:
-	assertThat(response.statusCode()).isEqualTo(200);
-	// and:
-	DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance()
-					.newDocumentBuilder();
-	Document parsedXml = documentBuilder.parse(new InputSource(
-				new StringReader(response.getBody().asString())));
-	// and:
-	assertThat(valueFromXPath(parsedXml, "/test/list/elem/text()")).isEqualTo("abc");
-	assertThat(valueFromXPath(parsedXml,"/test/list/elem[2]/text()")).isEqualTo("def");
-	assertThat(valueFromXPath(parsedXml, "/test/duck/text()")).matches("[0-9]{3}");
-	assertThat(nodeFromXPath(parsedXml, "/test/duck/xxx")).isNull();
-	assertThat(valueFromXPath(parsedXml, "/test/alpha/text()")).matches("[\\p{L}]*");
-	assertThat(valueFromXPath(parsedXml, "/test/*/complex/text()")).isEqualTo("foo");
-	assertThat(valueFromXPath(parsedXml, "/test/duck/@type")).isEqualTo("xtype");
-	}

8.11 Messaging Top-Level Elements

The DSL for messaging looks a little bit different than the one that focuses on HTTP. The -following sections explain the differences:

8.11.1 Output Triggered by a Method

The output message can be triggered by calling a method (such as a Scheduler when a was -started and a message was sent), as shown in the following example:

Groovy DSL.  -

def dsl = Contract.make {
-	// Human readable description
-	description 'Some description'
-	// Label by means of which the output message can be triggered
-	label 'some_label'
-	// input to the contract
-	input {
-		// the contract will be triggered by a method
-		triggeredBy('bookReturnedTriggered()')
-	}
-	// output message of the contract
-	outputMessage {
-		// destination to which the output message will be sent
-		sentTo('output')
-		// the body of the output message
-		body('''{ "bookName" : "foo" }''')
-		// the headers of the output message
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

-

YAML.  -

# Human readable description
-description: Some description
-# Label by means of which the output message can be triggered
-label: some_label
-input:
-  # the contract will be triggered by a method
-  triggeredBy: bookReturnedTriggered()
-# output message of the contract
-outputMessage:
-  # destination to which the output message will be sent
-  sentTo: output
-  # the body of the output message
-  body:
-    bookName: foo
-  # the headers of the output message
-  headers:
-    BOOK-NAME: foo

-

In the previous example case, the output message is sent to output if a method called -bookReturnedTriggered is executed. On the message publisher’s side, we generate a -test that calls that method to trigger the message. On the consumer side, you can use -the some_label to trigger the message.

8.11.2 Output Triggered by a Message

The output message can be triggered by receiving a message, as shown in the following -example:

Groovy DSL.  -

def dsl = Contract.make {
-	description 'Some Description'
-	label 'some_label'
-	// input is a message
-	input {
-		// the message was received from this destination
-		messageFrom('input')
-		// has the following body
-		messageBody([
-				bookName: 'foo'
-		])
-		// and the following headers
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

-

YAML.  -

# Human readable description
-description: Some description
-# Label by means of which the output message can be triggered
-label: some_label
-# input is a message
-input:
-  messageFrom: input
-  # has the following body
-  messageBody:
-    bookName: 'foo'
-  # and the following headers
-  messageHeaders:
-    sample: 'header'
-# output message of the contract
-outputMessage:
-  # destination to which the output message will be sent
-  sentTo: output
-  # the body of the output message
-  body:
-    bookName: foo
-  # the headers of the output message
-  headers:
-    BOOK-NAME: foo

-

In the preceding example, the output message is sent to output if a proper message is -received on the input destination. On the message publisher’s side, the engine -generates a test that sends the input message to the defined destination. On the -consumer side, you can either send a message to the input destination or use a label -(some_label in the example) to trigger the message.

8.11.3 Consumer/Producer

[Important]Important

This section is valid only for Groovy DSL.

In HTTP, you have a notion of client/stub and `server/test notation. You can also -use those paradigms in messaging. In addition, Spring Cloud Contract Verifier also -provides the consumer and producer methods, as presented in the following example -(note that you can use either $ or value methods to provide consumer and producer -parts):

					Contract.make {
-						label 'some_label'
-						input {
-							messageFrom value(consumer('jms:output'), producer('jms:input'))
-							messageBody([
-									bookName: 'foo'
-							])
-							messageHeaders {
-								header('sample', 'header')
-							}
-						}
-						outputMessage {
-							sentTo $(consumer('jms:input'), producer('jms:output'))
-							body([
-									bookName: 'foo'
-							])
-						}
-					}

8.11.4 Common

In the input or outputMessage section you can call assertThat with the name -of a method (e.g. assertThatMessageIsOnTheQueue()) that you have defined in the -base class or in a static import. Spring Cloud Contract will execute that method -in the generated test.

8.12 Multiple Contracts in One File

You can define multiple contracts in one file. Such a contract might resemble the -following example:

Groovy DSL.  -

import org.springframework.cloud.contract.spec.Contract
-
-[
-	Contract.make {
-		name("should post a user")
-		request {
-			method 'POST'
-			url('/users/1')
-		}
-		response {
-			status OK()
-		}
-	},
-	Contract.make {
-		request {
-			method 'POST'
-			url('/users/2')
-		}
-		response {
-			status OK()
-		}
-	}
-]

-

YAML.  -

---
-name: should post a user
-request:
-  method: POST
-  url: /users/1
-response:
-  status: 200
----
-request:
-  method: POST
-  url: /users/2
-response:
-  status: 200
----
-request:
-  method: POST
-  url: /users/3
-response:
-  status: 200

-

In the preceding example, one contract has the name field and the other does not. This -leads to generation of two tests that look more or less like this:

package org.springframework.cloud.contract.verifier.tests.com.hello;
-
-import com.example.TestBase;
-import com.jayway.jsonpath.DocumentContext;
-import com.jayway.jsonpath.JsonPath;
-import com.jayway.restassured.module.mockmvc.specification.MockMvcRequestSpecification;
-import com.jayway.restassured.response.ResponseOptions;
-import org.junit.Test;
-
-import static com.jayway.restassured.module.mockmvc.RestAssuredMockMvc.*;
-import static com.toomuchcoding.jsonassert.JsonAssertion.assertThatJson;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class V1Test extends TestBase {
-
-	@Test
-	public void validate_should_post_a_user() throws Exception {
-		// given:
-			MockMvcRequestSpecification request = given();
-
-		// when:
-			ResponseOptions response = given().spec(request)
-					.post("/users/1");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-	}
-
-	@Test
-	public void validate_withList_1() throws Exception {
-		// given:
-			MockMvcRequestSpecification request = given();
-
-		// when:
-			ResponseOptions response = given().spec(request)
-					.post("/users/2");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-	}
-
-}

Notice that, for the contract that has the name field, the generated test method is named -validate_should_post_a_user. For the one that does not have the name, it is called -validate_withList_1. It corresponds to the name of the file WithList.groovy and the -index of the contract in the list.

The generated stubs is shown in the following example:

should post a user.json
-1_WithList.json

As you can see, the first file got the name parameter from the contract. The second -got the name of the contract file (WithList.groovy) prefixed with the index (in this -case, the contract had an index of 1 in the list of contracts in the file).

[Tip]Tip

As you can see, it is much better if you name your contracts because doing so makes -your tests far more meaningful.

8.13 Generating Spring REST Docs snippets from the contracts

When you want to include the requests and responses of your API using Spring REST Docs, -you only need to make some minor changes to your setup if you are using MockMvc and RestAssuredMockMvc. -Simply include the following dependencies if you haven’t already.

Maven.  -

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>
-<dependency>
-	<groupId>org.springframework.restdocs</groupId>
-	<artifactId>spring-restdocs-mockmvc</artifactId>
-	<optional>true</optional>
-</dependency>

-

Gradle.  -

testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
-testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc'

-

Next you need to make some changes to your base class like the following example.

package com.example.fraud;
-
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.junit.runner.RunWith;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.restdocs.JUnitRestDocumentation;
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = Application.class)
-public abstract class FraudBaseWithWebAppSetup {
-
-	private static final String OUTPUT = "target/generated-snippets";
-
-	@Rule
-	public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(OUTPUT);
-
-	@Rule
-	public TestName testName = new TestName();
-
-	@Autowired
-	private WebApplicationContext context;
-
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.mockMvc(MockMvcBuilders.webAppContextSetup(this.context)
-				.apply(documentationConfiguration(this.restDocumentation))
-				.alwaysDo(document(
-						getClass().getSimpleName() + "_" + testName.getMethodName()))
-				.build());
-	}
-
-	protected void assertThatRejectionReasonIsNull(Object rejectionReason) {
-		assert rejectionReason == null;
-	}
-
-}

In case you are using the standalone setup, you can set up RestAssuredMockMvc like this:

package com.example.fraud;
-
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-
-import org.springframework.restdocs.JUnitRestDocumentation;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
-
-public abstract class FraudBaseWithStandaloneSetup {
-
-	private static final String OUTPUT = "target/generated-snippets";
-
-	@Rule
-	public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(OUTPUT);
-
-	@Rule
-	public TestName testName = new TestName();
-
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.standaloneSetup(MockMvcBuilders
-				.standaloneSetup(new FraudDetectionController())
-				.apply(documentationConfiguration(this.restDocumentation))
-				.alwaysDo(document(
-						getClass().getSimpleName() + "_" + testName.getMethodName())));
-	}
-
-}
[Tip]Tip

You don’t need to specify the output directory for the generated snippets since version 1.2.0.RELEASE of Spring REST Docs.

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi_pr01.html b/multi/multi_pr01.html index 107f77b27f..a5ffb82f50 100644 --- a/multi/multi_pr01.html +++ b/multi/multi_pr01.html @@ -1,4 +1,13 @@ - - -

Documentation Authors: Adam Dudczak, Mathias Düsterhöft, Marcin Grzejszczak, Dennis Kieselhorst, Jakub Kubryński, Karol Lassak, -Olga Maciaszek-Sharma, Mariusz Smykuła, Dave Syer, Jay Bryant

2.1.2.BUILD-SNAPSHOT

\ No newline at end of file + + + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi_spring-cloud-contract.html b/multi/multi_spring-cloud-contract.html index e046ea4743..a5ffb82f50 100644 --- a/multi/multi_spring-cloud-contract.html +++ b/multi/multi_spring-cloud-contract.html @@ -1,3 +1,13 @@ - - - Spring Cloud Contract

Spring Cloud Contract


Table of Contents

1. Spring Cloud Contract
2. Spring Cloud Contract Verifier Introduction
2.1. History
2.2. Why a Contract Verifier?
2.2.1. Testing issues
2.3. Purposes
2.4. How It Works
2.4.1. A Three-second Tour
On the Producer Side
On the Consumer Side
2.4.2. A Three-minute Tour
On the Producer Side
On the Consumer Side
2.4.3. Defining the Contract
2.4.4. Client Side
2.4.5. Server Side
2.5. Step-by-step Guide to Consumer Driven Contracts (CDC)
2.5.1. Technical note
2.5.2. Consumer side (Loan Issuance)
2.5.3. Producer side (Fraud Detection server)
2.5.4. Consumer Side (Loan Issuance) Final Step
2.6. Dependencies
2.7. Additional Links
2.7.1. Spring Cloud Contract video
2.7.2. Readings
2.8. Samples
3. Spring Cloud Contract FAQ
3.1. Why use Spring Cloud Contract Verifier and not X ?
3.2. I don’t want to write a contract in Groovy!
3.3. What is this value(consumer(), producer()) ?
3.4. How to do Stubs versioning?
3.4.1. API Versioning
3.4.2. JAR versioning
3.4.3. Dev or prod stubs
3.5. Common repo with contracts
3.5.1. Repo structure
3.5.2. Workflow
3.5.3. Consumer
3.5.4. Producer
3.5.5. How can I define messaging contracts per topic not per producer?
For Maven Project
For Gradle Project
3.6. Do I need a Binary Storage? Can’t I use Git?
3.6.1. Protocol convention
3.6.2. Producer
3.6.3. Producer with contracts stored locally
Keeping contracts with the producer and stubs in an external repository
3.6.4. Consumer
3.7. Can I use the Pact Broker?
3.7.1. Pact Consumer
3.7.2. Producer
3.7.3. Pact Consumer (Producer Contract approach)
3.8. How can I debug the request/response being sent by the generated tests client?
3.8.1. How can I debug the mapping/request/response being sent by WireMock?
3.8.2. How can I see what got registered in the HTTP server stub?
3.8.3. Can I reference text from file?
4. Spring Cloud Contract Verifier Setup
4.1. Gradle Project
4.1.1. Prerequisites
4.1.2. Add Gradle Plugin with Dependencies
4.1.3. Gradle and Rest Assured 2.0
4.1.4. Snapshot Versions for Gradle
4.1.5. Add stubs
4.1.6. Run the Plugin
4.1.7. Default Setup
4.1.8. Configure Plugin
4.1.9. Configuration Options
4.1.10. Single Base Class for All Tests
4.1.11. Different Base Classes for Contracts
4.1.12. Invoking Generated Tests
4.1.13. Pushing stubs to SCM
4.1.14. Spring Cloud Contract Verifier on the Consumer Side
4.2. Maven Project
4.2.1. Add maven plugin
4.2.2. Maven and Rest Assured 2.0
4.2.3. Snapshot versions for Maven
4.2.4. Add stubs
4.2.5. Run plugin
4.2.6. Configure plugin
4.2.7. Configuration Options
4.2.8. Single Base Class for All Tests
4.2.9. Different base classes for contracts
4.2.10. Invoking generated tests
4.2.11. Pushing stubs to SCM
4.2.12. Maven Plugin and STS
4.2.13. Maven Plugin with Spock Tests
4.3. Stubs and Transitive Dependencies
4.4. Scenarios
4.5. Docker Project
4.5.1. Short intro to Maven, JARs and Binary storage
4.5.2. How it works
Environment Variables
4.5.3. Example of usage
4.5.4. Server side (nodejs)
5. Spring Cloud Contract Verifier Messaging
5.1. Integrations
5.2. Manual Integration Testing
5.3. Publisher-Side Test Generation
5.3.1. Scenario 1: No Input Message
5.3.2. Scenario 2: Output Triggered by Input
5.3.3. Scenario 3: No Output Message
5.4. Consumer Stub Generation
6. Spring Cloud Contract Stub Runner
6.1. Snapshot versions
6.2. Publishing Stubs as JARs
6.3. Stub Runner Core
6.3.1. Retrieving stubs
Stub downloading
Classpath scanning
Configuring HTTP Server Stubs
6.3.2. Running stubs
Running using main app
HTTP Stubs
Viewing registered mappings
Messaging Stubs
6.4. Stub Runner JUnit Rule and Stub Runner JUnit5 Extension
6.4.1. Maven settings
6.4.2. Providing fixed ports
6.4.3. Fluent API
6.4.4. Stub Runner with Spring
6.5. Stub Runner Spring Cloud
6.5.1. Stubbing Service Discovery
Test profiles and service discovery
6.5.2. Additional Configuration
6.6. Stub Runner Boot Application
6.6.1. How to use it?
Stub Runner Server
Stub Runner Server Fat Jar
Spring Cloud CLI
6.6.2. Endpoints
HTTP
Messaging
6.6.3. Example
6.6.4. Stub Runner Boot with Service Discovery
6.7. Stubs Per Consumer
6.8. Common
6.8.1. Common Properties for JUnit and Spring
6.8.2. Stub Runner Stubs IDs
6.9. Stub Runner Docker
6.9.1. How to use it
6.9.2. Example of client side usage in a non JVM project
7. Stub Runner for Messaging
7.1. Stub triggering
7.1.1. Trigger by Label
7.1.2. Trigger by Group and Artifact Ids
7.1.3. Trigger by Artifact Ids
7.1.4. Trigger All Messages
7.2. Stub Runner Camel
7.2.1. Adding it to the project
7.2.2. Disabling the functionality
7.2.3. Examples
Stubs structure
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
7.3. Stub Runner Integration
7.3.1. Adding the Runner to the Project
7.3.2. Disabling the functionality
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
7.4. Stub Runner Stream
7.4.1. Adding the Runner to the Project
7.4.2. Disabling the functionality
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
7.5. Stub Runner Spring AMQP
7.5.1. Adding the Runner to the Project
Triggering the message
Spring AMQP Test Configuration
8. Contract DSL
8.1. Limitations
8.2. Common Top-Level elements
8.2.1. Description
8.2.2. Name
8.2.3. Ignoring Contracts
8.2.4. Passing Values from Files
8.2.5. HTTP Top-Level Elements
8.3. Request
8.4. Response
8.5. Dynamic properties
8.5.1. Dynamic properties inside the body
8.5.2. Regular expressions
8.5.3. Passing Optional Parameters
8.5.4. Executing Custom Methods on the Server Side
8.5.5. Referencing the Request from the Response
8.5.6. Registering Your Own WireMock Extension
8.5.7. Dynamic Properties in the Matchers Sections
8.6. JAX-RS Support
8.7. Async Support
8.8. Working with Context Paths
8.9. Working with WebFlux
8.9.1. WebFlux with WebTestClient
8.9.2. WebFlux with Explicit mode
8.10. XML Support for REST
8.11. Messaging Top-Level Elements
8.11.1. Output Triggered by a Method
8.11.2. Output Triggered by a Message
8.11.3. Consumer/Producer
8.11.4. Common
8.12. Multiple Contracts in One File
8.13. Generating Spring REST Docs snippets from the contracts
9. Customization
9.1. Extending the DSL
9.1.1. Common JAR
9.1.2. Adding the Dependency to the Project
9.1.3. Test the Dependency in the Project’s Dependencies
9.1.4. Test a Dependency in the Plugin’s Dependencies
9.1.5. Referencing classes in DSLs
10. Using the Pluggable Architecture
10.1. Custom Contract Converter
10.1.1. Pact Converter
10.1.2. Pact Contract
10.1.3. Pact for Producers
10.1.4. Pact for Consumers
10.2. Using the Custom Test Generator
10.3. Using the Custom Stub Generator
10.4. Using the Custom Stub Runner
10.5. Using the Custom Stub Downloader
10.6. Using the SCM Stub Downloader
10.7. Using the Pact Stub Downloader
11. Spring Cloud Contract WireMock
11.1. Registering Stubs Automatically
11.2. Using Files to Specify the Stub Bodies
11.3. Alternative: Using JUnit Rules
11.4. Relaxed SSL Validation for Rest Template
11.5. WireMock and Spring MVC Mocks
11.6. Customization of WireMock configuration
11.7. Generating Stubs using REST Docs
11.8. Generating Contracts by Using REST Docs
12. Migrations
12.1. 1.0.x → 1.1.x
12.1.1. New structure of generated stubs
12.2. 1.1.x → 1.2.x
12.2.1. Custom HttpServerStub
12.2.2. New packages for generated tests
12.2.3. New Methods in TemplateProcessor
12.2.4. RestAssured 3.0
12.3. 1.2.x → 2.0.x
13. Links
\ No newline at end of file + + + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/multi_stub-runner-for-messaging.html b/multi/multi_stub-runner-for-messaging.html index 856e677935..a5ffb82f50 100644 --- a/multi/multi_stub-runner-for-messaging.html +++ b/multi/multi_stub-runner-for-messaging.html @@ -1,360 +1,13 @@ - - - 7. Stub Runner for Messaging

7. Stub Runner for Messaging

Stub Runner can run the published stubs in memory. It can integrate with the following -frameworks:

  • Spring Integration
  • Spring Cloud Stream
  • Apache Camel
  • Spring AMQP

It also provides entry points to integrate with any other solution on the market.

[Important]Important

If you have multiple frameworks on the classpath Stub Runner will need to -define which one should be used. Let’s assume that you have both AMQP, Spring Cloud Stream and Spring Integration -on the classpath. Then you need to set stubrunner.stream.enabled=false and stubrunner.integration.enabled=false. -That way the only remaining framework is Spring AMQP.

7.1 Stub triggering

To trigger a message, use the StubTrigger interface:

package org.springframework.cloud.contract.stubrunner;
+
 
-import java.util.Collection;
-import java.util.Map;
+
+
 
-/**
- * Contract for triggering stub messages.
- *
- * @author Marcin Grzejszczak
- */
-public interface StubTrigger {
+
 
-	/**
-	 * Triggers an event by a given label for a given {@code groupid:artifactid} notation.
-	 * You can use only {@code artifactId} too.
-	 *
-	 * Feature related to messaging.
-	 * @param ivyNotation ivy notation of a stub
-	 * @param labelName name of the label to trigger
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger(String ivyNotation, String labelName);
+Page Redirection
 
-	/**
-	 * Triggers an event by a given label.
-	 *
-	 * Feature related to messaging.
-	 * @param labelName name of the label to trigger
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger(String labelName);
-
-	/**
-	 * Triggers all possible events.
-	 *
-	 * Feature related to messaging.
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger();
-
-	/**
-	 * Feature related to messaging.
-	 * @return a mapping of ivy notation of a dependency to all the labels it has.
-	 */
-	Map<String, Collection<String>> labels();
-
-}

For convenience, the StubFinder interface extends StubTrigger, so you only need one -or the other in your tests.

StubTrigger gives you the following options to trigger a message:

7.1.1 Trigger by Label

stubFinder.trigger('return_book_1')

7.1.2 Trigger by Group and Artifact Ids

stubFinder.trigger('org.springframework.cloud.contract.verifier.stubs:streamService', 'return_book_1')

7.1.3 Trigger by Artifact Ids

stubFinder.trigger('streamService', 'return_book_1')

7.1.4 Trigger All Messages

stubFinder.trigger()

7.2 Stub Runner Camel

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to integrate with Apache Camel. -For the provided artifacts it will automatically download the stubs and register the required -routes.

7.2.1 Adding it to the project

It’s enough to have both Apache Camel and Spring Cloud Contract Stub Runner on classpath. -Remember to annotate your test class with @AutoConfigureStubRunner.

7.2.2 Disabling the functionality

If you need to disable this functionality just pass stubrunner.camel.enabled=false property.

7.2.3 Examples

Stubs structure

Let us assume that we have the following Maven repository with a deployed stubs for the -camelService application.

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── camelService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── camelService-0.0.1-SNAPSHOT.pom
-                            │   ├── camelService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

And the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Let’s consider the following contracts (let' number it with 1):

Contract.make {
-	label 'return_book_1'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('jms:output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and number 2

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('jms:input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('jms:output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			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 = 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.

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.

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 -stubrunner.integration.enabled=false property.

Assume that you have the following Maven repository with deployed stubs for the -integrationService application:

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── integrationService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── integrationService-0.0.1-SNAPSHOT.pom
-                            │   ├── integrationService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

Further assume the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Consider the following contracts (numbered 1):

Contract.make {
-	label 'return_book_1'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

Now consider 2:

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and the following Spring Integration Route:

<?xml version="1.0" encoding="UTF-8"?>
-<beans:beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-			 xmlns:beans="http://www.springframework.org/schema/beans"
-			 xmlns="http://www.springframework.org/schema/integration"
-			 xsi:schemaLocation="http://www.springframework.org/schema/beans
-			https://www.springframework.org/schema/beans/spring-beans.xsd
-			http://www.springframework.org/schema/integration
-			https://www.springframework.org/schema/integration/spring-integration.xsd">
-
-
-	<!-- REQUIRED FOR TESTING -->
-	<bridge input-channel="output"
-			output-channel="outputTest"/>
-
-	<channel id="outputTest">
-		<queue/>
-	</channel>
-
-</beans:beans>

These examples lend themselves to three scenarios:

Scenario 1 (no input message)

To trigger a message via the return_book_1 label, use the StubTigger interface, as -follows:

stubFinder.trigger('return_book_1')

To listen to the output of the message sent to output:

Message<?> receivedMessage = messaging.receive('outputTest')

The received message would pass the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input)

Since the route is set for you, you can send a message to the output -destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'input')

To listen to the output of the message sent to output:

Message<?> receivedMessage = messaging.receive('outputTest')

The received message passes the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 3 (input with no output)

Since the route is set for you, you can send a message to the input destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')

7.4 Stub Runner Stream

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

[Warning]Warning

If Stub Runner’s integration with Stream the messageFrom or sentTo Strings -are resolved first as a destination of a channel and no such destination exists, the -destination is resolved as a channel name.

[Important]Important

If you want to use Spring Cloud Stream remember, to add a dependency on -org.springframework.cloud:spring-cloud-stream-test-support.

Maven.  -

<dependency>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-stream-test-support</artifactId>
-    <scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-stream-test-support"

-

7.4.1 Adding the Runner to the Project

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

7.4.2 Disabling the functionality

If you need to disable this functionality, set the stubrunner.stream.enabled=false -property.

Assume that you have the following Maven repository with a deployed stubs for the -streamService application:

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── streamService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── streamService-0.0.1-SNAPSHOT.pom
-                            │   ├── streamService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

Further assume the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Consider the following contracts (numbered 1):

Contract.make {
-	label 'return_book_1'
-	input { triggeredBy('bookReturnedTriggered()') }
-	outputMessage {
-		sentTo('returnBook')
-		body('''{ "bookName" : "foo" }''')
-		headers { header('BOOK-NAME', 'foo') }
-	}
-}

Now consider 2:

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('bookStorage')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders { header('sample', 'header') }
-	}
-	outputMessage {
-		sentTo('returnBook')
-		body([
-				bookName: 'foo'
-		])
-		headers { header('BOOK-NAME', 'foo') }
-	}
-}

Now consider the following Spring configuration:

stubrunner.repositoryRoot: classpath:m2repo/repository/
-stubrunner.ids: org.springframework.cloud.contract.verifier.stubs:streamService:0.0.1-SNAPSHOT:stubs
-stubrunner.stubs-mode: remote
-spring:
-  cloud:
-    stream:
-      bindings:
-        output:
-          destination: returnBook
-        input:
-          destination: bookStorage
-
-server:
-  port: 0
-
-debug: true

These examples lend themselves to three scenarios:

Scenario 1 (no input message)

To trigger a message via the return_book_1 label, use the StubTrigger interface as -follows:

stubFinder.trigger('return_book_1')

To listen to the output of the message sent to a channel whose destination is -returnBook:

Message<?> receivedMessage = messaging.receive('returnBook')

The received message passes the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input)

Since the route is set for you, you can send a message to the bookStorage -destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'bookStorage')

To listen to the output of the message sent to returnBook:

Message<?> receivedMessage = messaging.receive('returnBook')

The received message passes the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 3 (input with no output)

Since the route is set for you, you can send a message to the output -destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')

7.5 Stub Runner Spring AMQP

Spring Cloud Contract Verifier Stub Runner’s messaging module provides an easy way to -integrate with Spring AMQP’s Rabbit Template. For the provided artifacts, it -automatically downloads the stubs and registers the required routes.

The integration tries to work standalone (that is, without interaction with a running -RabbitMQ message broker). It expects a RabbitTemplate on the application context and -uses it as a spring boot test named @SpyBean. As a result, it can use the mockito spy -functionality to verify and inspect messages sent by the application.

On the message consumer side, the stub runner considers all @RabbitListener annotated -endpoints and all SimpleMessageListenerContainer objects on the application context.

As messages are usually sent to exchanges in AMQP, the message contract contains the -exchange name as the destination. Message listeners on the other side are bound to -queues. Bindings connect an exchange to a queue. If message contracts are triggered, the -Spring AMQP stub runner integration looks for bindings on the application context that -match this exchange. Then it collects the queues from the Spring exchanges and tries to -find message listeners bound to these queues. The message is triggered for all matching -message listeners.

If you need to work with routing keys, it’s enough to pass them via the amqp_receivedRoutingKey -messaging header.

7.5.1 Adding the Runner to the Project

You can have both Spring AMQP and Spring Cloud Contract Stub Runner on the classpath and -set the property stubrunner.amqp.enabled=true. Remember to annotate your test class -with @AutoConfigureStubRunner.

[Important]Important

If you already have Stream and Integration on the classpath, you need -to disable them explicitly by setting the stubrunner.stream.enabled=false and -stubrunner.integration.enabled=false properties.

Assume that you have the following Maven repository with a deployed stubs for the -spring-cloud-contract-amqp-test application.

└── .m2
-    └── repository
-        └── com
-            └── example
-                └── spring-cloud-contract-amqp-test
-                    ├── 0.4.0-SNAPSHOT
-                    │   ├── spring-cloud-contract-amqp-test-0.4.0-SNAPSHOT.pom
-                    │   ├── spring-cloud-contract-amqp-test-0.4.0-SNAPSHOT-stubs.jar
-                    │   └── maven-metadata-local.xml
-                    └── maven-metadata-local.xml

Further assume that the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── contracts
-    └── shouldProduceValidPersonData.groovy

Consider the following contract:

Contract.make {
-	// Human readable description
-	description 'Should produce valid person data'
-	// Label by means of which the output message can be triggered
-	label 'contract-test.person.created.event'
-	// input to the contract
-	input {
-		// the contract will be triggered by a method
-		triggeredBy('createPerson()')
-	}
-	// output message of the contract
-	outputMessage {
-		// destination to which the output message will be sent
-		sentTo 'contract-test.exchange'
-		headers {
-			header('contentType': 'application/json')
-			header('__TypeId__': 'org.springframework.cloud.contract.stubrunner.messaging.amqp.Person')
-		}
-		// the body of the output message
-		body([
-				id  : $(consumer(9), producer(regex("[0-9]+"))),
-				name: "me"
-		])
-	}
-}

Now consider the following Spring configuration:

stubrunner:
-  repositoryRoot: classpath:m2repo/repository/
-  ids: org.springframework.cloud.contract.verifier.stubs.amqp:spring-cloud-contract-amqp-test:0.4.0-SNAPSHOT:stubs
-  stubs-mode: remote
-  amqp:
-    enabled: true
-server:
-  port: 0

Triggering the message

To trigger a message using the contract above, use the StubTrigger interface as -follows:

stubTrigger.trigger("contract-test.person.created.event")

The message has a destination of contract-test.exchange, so the Spring AMQP stub runner -integration looks for bindings related to this exchange.

@Bean
-public Binding binding() {
-	return BindingBuilder.bind(new Queue("test.queue"))
-			.to(new DirectExchange("contract-test.exchange")).with("#");
-}

The binding definition binds the queue test.queue. As a result, the following listener -definition is matched and invoked with the contract message.

@Bean
-public SimpleMessageListenerContainer simpleMessageListenerContainer(
-		ConnectionFactory connectionFactory,
-		MessageListenerAdapter listenerAdapter) {
-	SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
-	container.setConnectionFactory(connectionFactory);
-	container.setQueueNames("test.queue");
-	container.setMessageListener(listenerAdapter);
-
-	return container;
-}

Also, the following annotated listener matches and is invoked:

@RabbitListener(bindings = @QueueBinding(value = @Queue("test.queue"), exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true")))
-public void handlePerson(Person person) {
-	this.person = person;
-}
[Note]Note

The message is directly handed over to the onMessage method of the -MessageListener associated with the matching SimpleMessageListenerContainer.

Spring AMQP Test Configuration

In order to avoid Spring AMQP trying to connect to a running broker during our tests -configure a mock ConnectionFactory.

To disable the mocked ConnectionFactory, set the following property: -stubrunner.amqp.mockConnection=false

stubrunner:
-  amqp:
-    mockConnection: false
\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/pr01.html b/multi/pr01.html index 15e4920ecc..a5ffb82f50 100644 --- a/multi/pr01.html +++ b/multi/pr01.html @@ -1,4 +1,13 @@ - - -

Documentation Authors: Adam Dudczak, Mathias Düsterhöft, Marcin Grzejszczak, Dennis Kieselhorst, Jakub Kubryński, Karol Lassak, -Olga Maciaszek-Sharma, Mariusz Smykuła, Dave Syer

1.2.0.BUILD-SNAPSHOT

\ No newline at end of file + + + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/multi/spring-cloud-contract.html b/multi/spring-cloud-contract.html index e36df6d8b2..a5ffb82f50 100644 --- a/multi/spring-cloud-contract.html +++ b/multi/spring-cloud-contract.html @@ -1,3 +1,13 @@ - - - Spring Cloud Contract

Spring Cloud Contract


Table of Contents

1. Spring Cloud Contract
2. Spring Cloud Contract Verifier
2.1. Introduction
2.1.1. Why?
Testing issues
2.1.2. Purposes
2.1.3. How
Define the contract
Client Side
Server Side
2.1.4. Step by step guide to CDC
Technical note
Consumer side (Loan Issuance)
Producer side (Fraud Detection server)
Consumer side (Loan Issuance) final step
2.1.5. Dependencies
2.1.6. Additional links
Spring Cloud Contract video
Readings
2.1.7. Samples
2.2. FAQ
2.2.1. Why use Spring Cloud Contract Verifier and not X ?
2.2.2. What is this value(consumer(), producer()) ?
2.2.3. How to do Stubs versioning?
API Versioning
JAR versioning
Dev or prod stubs
2.2.4. Common repo with contracts
Repo structure
Workflow
2.2.5. Can I have multiple base classes for tests?
2.2.6. How can I debug the request/response being sent by the generated tests client?
2.2.7. How can I debug the mapping/request/response being sent by WireMock?
2.2.8. How can I see what got registered in the HTTP server stub?
2.2.9. Can I reference the request from the response?
2.2.10. Can I reference text from file?
2.3. Spring Cloud Contract Verifier HTTP
2.3.1. Gradle Project
Prerequisites
Run plugin
Default setup
Configure plugin
Invoking generated tests
Spring Cloud Contract Verifier on consumer side
2.3.2. Using in your Maven project
Add maven plugin
Add stubs
Run plugin
Configure plugin
Invoking generated tests
FAQ with Maven Plugin
Spring Cloud Contract Verifier on consumer side
2.3.3. Scenarios
2.3.4. Stubs and transitive dependencies
2.4. Spring Cloud Contract Verifier Messaging
2.4.1. Integrations
2.4.2. Manual Integration Testing
2.4.3. Publisher side test generation
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (no output message)
2.4.4. Consumer Stub Side generation
2.5. Spring Cloud Contract Stub Runner
2.5.1. Snapshot versions
2.5.2. Publishing stubs as JARs
2.6. Stub Runner Core
2.6.1. Retrieving stubs
Stub downloading
Classpath scanning
2.6.2. Running stubs
Limitations
Running using main app
HTTP Stubs
Viewing registered mappings
Messaging Stubs
2.7. Stub Runner JUnit Rule
2.7.1. Maven settings
2.7.2. Providing fixed ports
2.7.3. Fluent API
2.7.4. Stub Runner with Spring
2.8. Stub Runner Spring Cloud
2.8.1. Stubbing Service Discovery
Test profiles and service discovery
2.8.2. Additional Configuration
2.9. Stub Runner Boot Application
2.9.1. How to use it?
Stub Runner Server
Spring Cloud CLI
2.9.2. Endpoints
HTTP
Messaging
2.9.3. Example
2.9.4. Stub Runner Boot with Service Discovery
2.10. Stubs Per Consumer
2.11. Common
2.11.1. Common properties for JUnit and Spring
Stub runner stubs ids
2.12. Stub Runner for Messaging
2.12.1. Stub triggering
Trigger by label
Trigger all messages
2.13. Stub Runner Camel
2.13.1. Adding it to the project
2.13.2. Examples
Stubs structure
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
2.14. Stub Runner Integration
2.14.1. Adding it to the project
2.14.2. Examples
Stubs structure
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
2.15. Stub Runner Stream
2.15.1. Adding it to the project
2.15.2. Examples
Stubs structure
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
2.16. Stub Runner Spring AMQP
2.16.1. Adding it to the project
2.16.2. Examples
Stubs structure
Triggering the message
Spring AMQP Test Configuration
2.17. Contract DSL
2.17.1. Limitations
2.17.2. Common Top-Level elements
Description
Name
Ignoring contracts
Passing values from files
2.17.3. HTTP Top-Level Elements
2.17.4. Request
2.17.5. Response
2.17.6. Dynamic properties
Dynamic properties inside the body
Referencing request from response
Dynamic properties in matchers sections
2.17.7. JAX-RS support
2.17.8. Async support
2.17.9. Working with Context Paths
2.17.10. Messaging Top-Level Elements
Output triggered by a method
Output triggered by a message
Consumer / Producer
2.17.11. Multiple contracts in one file
2.18. Customization
2.18.1. Extending the DSL
Common JAR
Adding the dependency to project
2.19. Pluggable architecture
2.19.1. Custom contract converter
Pact converter
2.19.2. Custom test generator
2.19.3. Custom stub generator
2.19.4. Custom Stub Runner
2.19.5. Custom Stub Downloader
2.20. Links
3. Spring Cloud Contract WireMock
3.1. Registering Stubs Automatically
3.2. Using Files to Specify the Stub Bodies
3.3. Alternative: Using JUnit Rules
4. Relaxed SSL Validation for Rest Template
5. WireMock and Spring MVC Mocks
6. Generating Stubs using RestDocs
7. Generating Contracts using RestDocs
8. Migrations
8.1. 1.0.x → 1.1.x
8.1.1. New structure of generated stubs
8.2. 1.1.x → 1.2.x
8.2.1. Custom HttpServerStub
8.2.2. New packages for generated tests
\ No newline at end of file + + + + + + + +Page Redirection + + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file diff --git a/single/css/highlight.css b/single/css/highlight.css deleted file mode 100644 index 3850f8b9e8..0000000000 --- a/single/css/highlight.css +++ /dev/null @@ -1,35 +0,0 @@ -/* - code highlight CSS resemblign the Eclipse IDE default color schema - @author Costin Leau -*/ - -.hl-keyword { - color: #7F0055; - font-weight: bold; -} - -.hl-comment { - color: #3F5F5F; - font-style: italic; -} - -.hl-multiline-comment { - color: #3F5FBF; - font-style: italic; -} - -.hl-tag { - color: #3F7F7F; -} - -.hl-attribute { - color: #7F007F; -} - -.hl-value { - color: #2A00FF; -} - -.hl-string { - color: #2A00FF; -} \ No newline at end of file diff --git a/single/css/manual-multipage.css b/single/css/manual-multipage.css deleted file mode 100644 index b790654b1d..0000000000 --- a/single/css/manual-multipage.css +++ /dev/null @@ -1,9 +0,0 @@ -@IMPORT url("manual.css"); - -body.firstpage { - background: url("../images/background.png") no-repeat center top; -} - -div.part h1 { - border-top: none; -} diff --git a/single/css/manual-singlepage.css b/single/css/manual-singlepage.css deleted file mode 100644 index 303192a8b1..0000000000 --- a/single/css/manual-singlepage.css +++ /dev/null @@ -1,6 +0,0 @@ -@IMPORT url("manual.css"); - -body { - background: url("../images/background.png") no-repeat center top; -} - diff --git a/single/css/manual.css b/single/css/manual.css deleted file mode 100644 index 20cf07dafe..0000000000 --- a/single/css/manual.css +++ /dev/null @@ -1,342 +0,0 @@ -@IMPORT url("highlight.css"); - -html { - padding: 0pt; - margin: 0pt; -} - -body { - color: #333333; - margin: 15px 30px; - font-family: Helvetica, Arial, Freesans, Clean, Sans-serif; - line-height: 1.6; - -webkit-font-smoothing: antialiased; -} - -code { - font-size: 16px; - font-family: Consolas, "Liberation Mono", Courier, monospace; -} - -:not(a) > code { - color: #6D180B; -} - -:not(pre) > code { - background-color: #F2F2F2; - border: 1px solid #CCCCCC; - border-radius: 4px; - padding: 1px 3px 0; - text-shadow: none; - white-space: nowrap; -} - -body > *:first-child { - margin-top: 0 !important; -} - -div { - margin: 0pt; -} - -hr { - border: 1px solid #CCCCCC; - background: #CCCCCC; -} - -h1, h2, h3, h4, h5, h6 { - color: #000000; - cursor: text; - font-weight: bold; - margin: 30px 0 10px; - padding: 0; -} - -h1, h2, h3 { - margin: 40px 0 10px; -} - -h1 { - margin: 70px 0 30px; - padding-top: 20px; -} - -div.part h1 { - border-top: 1px dotted #CCCCCC; -} - -h1, h1 code { - font-size: 32px; -} - -h2, h2 code { - font-size: 24px; -} - -h3, h3 code { - font-size: 20px; -} - -h4, h1 code, h5, h5 code, h6, h6 code { - font-size: 18px; -} - -div.book, div.chapter, div.appendix, div.part, div.preface { - min-width: 300px; - max-width: 1200px; - margin: 0 auto; -} - -p.releaseinfo { - font-weight: bold; - margin-bottom: 40px; - margin-top: 40px; -} - -div.authorgroup { - line-height: 1; -} - -p.copyright { - line-height: 1; - margin-bottom: -5px; -} - -.legalnotice p { - font-style: italic; - font-size: 14px; - line-height: 1; -} - -div.titlepage + p, div.titlepage + p { - margin-top: 0; -} - -pre { - line-height: 1.0; - color: black; -} - -a { - color: #4183C4; - text-decoration: none; -} - -p { - margin: 15px 0; - text-align: left; -} - -ul, ol { - padding-left: 30px; -} - -li p { - margin: 0; -} - -div.table { - margin: 1em; - padding: 0.5em; - text-align: center; -} - -div.table table, div.informaltable table { - display: table; - width: 100%; -} - -div.table td { - padding-left: 7px; - padding-right: 7px; -} - -.sidebar { - line-height: 1.4; - padding: 0 20px; - background-color: #F8F8F8; - border: 1px solid #CCCCCC; - border-radius: 3px 3px 3px 3px; -} - -.sidebar p.title { - color: #6D180B; -} - -pre.programlisting, pre.screen { - font-size: 15px; - padding: 6px 10px; - background-color: #F8F8F8; - border: 1px solid #CCCCCC; - border-radius: 3px 3px 3px 3px; - clear: both; - overflow: auto; - line-height: 1.4; - font-family: Consolas, "Liberation Mono", Courier, monospace; -} - -table { - border-collapse: collapse; - border-spacing: 0; - border: 1px solid #DDDDDD !important; - border-radius: 4px !important; - border-collapse: separate !important; - line-height: 1.6; -} - -table thead { - background: #F5F5F5; -} - -table tr { - border: none; - border-bottom: none; -} - -table th { - font-weight: bold; -} - -table th, table td { - border: none !important; - padding: 6px 13px; -} - -table tr:nth-child(2n) { - background-color: #F8F8F8; -} - -td p { - margin: 0 0 15px 0; -} - -div.table-contents td p { - margin: 0; -} - -div.important *, div.note *, div.tip *, div.warning *, div.navheader *, div.navfooter *, div.calloutlist * { - border: none !important; - background: none !important; - margin: 0; -} - -div.important p, div.note p, div.tip p, div.warning p { - color: #6F6F6F; - line-height: 1.6; -} - -div.important code, div.note code, div.tip code, div.warning code { - background-color: #F2F2F2 !important; - border: 1px solid #CCCCCC !important; - border-radius: 4px !important; - padding: 1px 3px 0 !important; - text-shadow: none !important; - white-space: nowrap !important; -} - -.note th, .tip th, .warning th { - display: none; -} - -.note tr:first-child td, .tip tr:first-child td, .warning tr:first-child td { - border-right: 1px solid #CCCCCC !important; - padding-top: 10px; -} - -div.calloutlist p, div.calloutlist td { - padding: 0; - margin: 0; -} - -div.calloutlist > table > tbody > tr > td:first-child { - padding-left: 10px; - width: 30px !important; -} - -div.important, div.note, div.tip, div.warning { - margin-left: 0px !important; - margin-right: 20px !important; - margin-top: 20px; - margin-bottom: 20px; - padding-top: 10px; - padding-bottom: 10px; -} - -div.toc { - line-height: 1.2; -} - -dl, dt { - margin-top: 1px; - margin-bottom: 0; -} - -div.toc > dl > dt { - font-size: 32px; - font-weight: bold; - margin: 30px 0 10px 0; - display: block; -} - -div.toc > dl > dd > dl > dt { - font-size: 24px; - font-weight: bold; - margin: 20px 0 10px 0; - display: block; -} - -div.toc > dl > dd > dl > dd > dl > dt { - font-weight: bold; - font-size: 20px; - margin: 10px 0 0 0; -} - -tbody.footnotes * { - border: none !important; -} - -div.footnote p { - margin: 0; - line-height: 1; -} - -div.footnote p sup { - margin-right: 6px; - vertical-align: middle; -} - -div.navheader { - border-bottom: 1px solid #CCCCCC; -} - -div.navfooter { - border-top: 1px solid #CCCCCC; -} - -.title { - margin-left: -1em; - padding-left: 1em; -} - -.title > a { - position: absolute; - visibility: hidden; - display: block; - font-size: 0.85em; - margin-top: 0.05em; - margin-left: -1em; - vertical-align: text-top; - color: black; -} - -.title > a:before { - content: "\00A7"; -} - -.title:hover > a, .title > a:hover, .title:hover > a:hover { - visibility: visible; -} - -.title:focus > a, .title > a:focus, .title:focus > a:focus { - outline: 0; -} diff --git a/single/images/background.png b/single/images/background.png deleted file mode 100644 index 15dca6fbe2669fae3609605e49c69cc414f1b6ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18255 zcmZ{Mc{tQ-|NlrKgrcaFbPBDOvWBUg7G=wtim_B8Ysgq;M%hj&Dizr#DKZMBkY&bF zQI^rsG?*CsWEtBu%$S+a=XX!f_xC*4>2RIPIp^}n{kiY^y}jPA_v?1U#_HHA$qkYS z1Y(u>@jq=52vKeDlPn+z~j!r2!xcp@J9rZ zo~ZL*W#N2~h3F^Y#kf z79Vq?HYz92POY^z60RQgu$cgc!baLFp8`pJN$ z)TpgHDYO!o(|FCbF@nU|Z4{PyQT_pWk^4ba(@3pLy~5i|7uwlU`v1B%7(o3njiTd=qKqO7b}K-at&!f*f2n8M46&RIPn?wT2jQCY?} ze6G^KcX(b!Y*uXj(zgAp+m$yS9Gsr>(+F2nC60BdVfIQ`)cSJ{^*od zepxlPa|MUm>e9Vgly6ynJN3^PvB=>&xF()rO3xDmHI z=|xsK0?M48ABv)1&|8*aUyhO2#E8jlc2-#f51xWHc^hUwi&%dc@+wWVCpXJq!}S%S zg>L#^WBV(Qw|v9bo1MW5gc=&srYW_5F+__kX%{Z>&RZmXwCdi!gd5#fJ|%lv+{G zr|b#Ts1}Bc(CPkXaIO8<1+}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u0>w%){Em8Kb$J{Ki7mOj@HkB5hlCwgUVStwRB(`$msn3 zW68l6_-QmuY@|h*k!h-dE>&&v=30 zIv3(Tl=pJrKH6z|rv)q59=N?as&_Po3H~a==sNM|4X=W#K*8r$N&#WvHVMQ8zDzLd zV)Dt$dm^J%7u}~piF^kD8Yp_Z&Uk|80}tRszg$ALiocA z&U(s2XW__mKc4sym@3MmQf`RaZ2ZcnKKE3-oF85QR&6*9*Yoc#x~^M{;7jY+&Nx1t z9;OP1mj0CKUwb(Wvpa1A;s-a3=aPnOem&7jJ&5aKY2kjAi{EseM4;=;;4Y}e@sWF= zA0G=hridbHd(+pd7ntI!Pli6S)3UB0XF*&6?nyx9LSypblGr5BFXg^bRHDaZeGF zKYA6I?$BJ$!L3>1>)B@=SqdDI3o3txyAWJ%X`+7$fgnGTVp-1)+LLdd#y_o80#604 zYlXS!e-r&*Hpl$YNw?FUCO!B6n`0ac3lmUA*{JK!y4vN-5Z^ntAy0%#PdCo!;3cP# ze=PC+U8O~-JElo5M!ch(!`Q83c7(#bv0mwAFrrrE5)C~5ch4R(H$BOIVbEpddh3J; zWYV{|9gznU$MoW0C(72_{L`{VHwf0)f?kIvSV!PME*{ zhd_id>2bhvo;mP@Wgu3p2Aky|)HjztWISA0VuGkm!N0#4W6x*^BIJJva$+1S*n4!) zCiO7Sgt7Qu7>7JKB)^RP#3H8x*Ka+C5rq*D8&~zJvVh1l@cY*588DzHswso`$^0{< zaeiKC>U(5clg*a4F7Y$QzIfTj!#wdNZk$~Dm((($rpWbbXsHY>Olrl~je|XOJwK=N zJSBwdWUS7&7){b$u-Of~v(u)OBQK6!AROCBQ@p+q)v&k`$%WuAmy`q^%nA*C8_Lt$ zy`sJB_R8ha=<5bQu#C;Iomk~$cR_2=p{VTaMRN^|+#-uw6KJym1SZ1#h}EA(huyCK EKU&lfD*ylh diff --git a/single/images/callouts/1.png b/single/images/callouts/1.png deleted file mode 100644 index 7d473430b7bec514f7de12f5769fe7c5859e8c5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 329 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQC}X^4DKU-G|w_t}fLBA)Suv#nrW z!^h2QnY_`l!BOq-UXEX{m2up>JTQkX)2m zTvF+fTUlI^nXH#utd~++ke^qgmzgTe~DWM4ffP81J diff --git a/single/images/callouts/2.png b/single/images/callouts/2.png deleted file mode 100644 index 5d09341b2f6d2ea2d1d5dad5d980f14b4b05dfd2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^JRr;gBp8b2n5}^nQxaY7e*=hH)_rZeB4|imU1$R#1`!P>&$poQl;nzm}mD5ZFopaX|GsS%q*{P~< z;WtmO%lhToBL0i}yfkaOt?EN=nkLNGuU`ywhI5H)L`iUdT1k0gQ7VIjhO(w-Zen_> zZ(@38a<+nro{^q~f~BRtfrY+-p+a&|W^qZSLvCepNoKNMYO!8QX+eHoiC%Jk?!;Y+ zJAlS%fsM;d&r2*R1)67JkeZlkYGj#gX_9E3W@4U_nw*@Ln38B@k(iuhnUeN2eF0kK0(Y1u|9Rc(19XFPiEBhjaDG}zd16s2gM)^$re|(qda7?? zdS-IAf{C7yo`r&?rM`iMzJZ}aa#3b+Nu@(>WpPPnvR-PjUP@^}eqM=Qa(?c_U5Yz^ z#%Y0#%S_KpEGY$=XJL?(l#*ybuErX#^g`ttQfwnX4x42*}TIo_3IbsoNRf>aVMfsJ4-Q{^hZZrE#!3~DHIyIo;*1&0#S#R8GXWt43k48;BRp7)N)S|- z1>C&kGA0Xf^G^6@Z7$n zMFutQvv~;*MUZYF%!pN!TPX!dM|v*>m&a&)K+gzU_K;pxx#tfwf0eF z{6Aql)Y@kWdT@am_mNw@Hu^kjk`}>q?S9@-*pQ9}E$|ZbpD$ zJ7Gs5k(91tmKe$sLWmTGr7Bn~6>1?^s}f2PnR1ciVOW(27K@ZZwFriDU|1uRs#UNC zk|@Pmnn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WGzYSl#_Wjpr@eu7sVJhKCFm=a%+M#HR diff --git a/single/images/logo.png b/single/images/logo.png deleted file mode 100644 index ade2ce6ed9d9e9f2f4d9c5729a252ee618a0a5a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4387 zcmV+;5!~*HP){P%3MJaDx_;_%u2|NZg!>}aqze!Nxc^y8Ao zaMb9>c)3l4zg^w!(u~7spv{7=)Rn#5sM+hyw%MSF!DHa>*1_JcqtAwz$$7Kao2k-{ z$Ktlp=fbSilJ55Bz}~Eo#%^5i?uh^Z5MW6}K~#90-Cc>2qDT-G%qj|s`%n~65K#I5 zADlwl_5$Q6z@8Veu^l@*Ej;tC%&f&?en^rmW8G4Bfs-$nj#hCGIahUzrMVw+I%xQ$E)R)G83X}t`1ui)Ke0b?i}V~=x;*#OP5^AJ z_OVA5<-$S(*dHs3nS@MY=6>c;q3@Q*^@Wc{Iv$8o7%%=lu>Mmu!n-W>7#}U^c;JPI zcIceuet!P2`VsO2g}6x=;JIIdC*&i)%=!Asvn$`C@XK&1|;bH5D_ z=zH7c!N>)KddJ;g59siDEplU|gd&)!`j@>B<Ren; zZ&4m;WDi^gpt1Gv2zv@ph@g01qCEH@j_rY~NI}KjsHjX%MJEA4+|NkF9jCN)QIRhc zFaLQ2c|!z};lxO_~%A+Qex!?*?#BCYPpKKPI zY^8;41BlDH8Ck6C87V0(Eh9w^6@ery;@8d~7@N5%3D&bI&W)5%c0@q##k7>lV_Tmd zdSptXnJFnrN!I{yxMakbDUX|fdg@WJnp;XPU|!EiuDPM4^)e9poGEjf}cm) zQ6T<|r>a)+C6s`;zm+8Q0)h9IA5I2+zPRKWK##xWH90f{l+8s6PUi_;-+}yxY%qW_ zpq+;jDIBj9-3_RCtVLQ8Qlfc6S#9Zl2_?oe1NdkN)R~2omG>pa#E4!j>XLcm?Homv z)0|1pBko@KhMk9$WCm|6Z@xrINc5&Ax^KW7RoSKZ9md31ze)+imI%u9;l1k3P*$se zQB*}|EF)A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=Q?-U<6r^xvteF z9r!imY+~MwU-%rjeD#Bk@DU*X&T~;_% zenSheBq=Iz?4{Z#4cNNjar1}zz0jUsoPci0!no+g@^+yo%5ah9{j;mzFd1rL!Y&8l zTcPoDx0T`Z2sq=}{oZK(3GcIQY0PHx{;A1jk*Ze*>yYhwtCJ#z51zrUV6=9neF>Tj za3FoTO{AkOuKerT6)(lGo3$TPQ}!;Q?aWssvEM=(Pa-<`znbSTZXGnvGr$2;U9?y` zsu`2*)*nCq-&6EN@cZ_3HSfn5Ay0f*WpOcVpb%;i>MGA5N_GZ{HMwY%a!Ob|hWgjf z$pY70(mcj`EiQ$kDi*Jib@TVnAG`ByK@A8~+|`>5k6kmDkThu-Q-}us@~e<9VUgdf zy}!V=eJ=&K3?NWcW&sON5mk_^=T?`zS(ebGpq;qag@s-x+&uf%a1#3;$S%b17byOd znx@Jylv+n^O+Jo1yPq)lIa-4`Rf0#8ZCx%@b<7qE_Jk9hL^ zZec%GvSPdTi#9C}$+(T>r7O+b{L5Bhh7ie1{JE_X>|?8u2rYg{r-!I|P#sH6N;Hv0 z?sC66W%n)`B>OyOyB%>YeAaZzZ9KO4_hljXs|53h zPjJg5k`dmfiKH8a5BVJe9K8$ka%g Gh5jGOsoGNj diff --git a/single/images/tip.png b/single/images/tip.png deleted file mode 100644 index 6530abb4b5a5d68e3b1c98de512d264c1f8ba883..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 931 zcmV;U16=%xP)bSEogsT%F|x0xuT7xdRv7>Rev?4wv{qrDN}+xS$8V5!!ga&#Y1*BgqL?&c}jPc zG_JlfMSD5I%DQQcHXTbGWQtKpeL6yAB|UI5CQ=~#`}=c}Um;E%R)9u^qI0>&GHQ-g zOm;DCkym+{WF$}@UWrV1mtnTPtu!WtY$r7BOpo|N_#mqWGhK#KR0MD7eW*yPaY&xBTRfcG-E5p&`2dq z875XFdy+3GStd(wD_Mg`dys8Xd_houJju_&*4)mZt2Tk1H)DTRJY^_lf>>*ZU2Th5 zWQ3Ly{;kf91GM2s4Vfv8a-fcsXpb+4t> zmM%11X*>M&PQZNVdARf4d*2x!aq1>jOzQ?>>R)(Ok;sOJ)7jfk$Fdif23? z-}3V78&9qod*O;uGk%fEW^;|k`Lo>bOq2iF72o-IGb2gTw+4B~#iYz(oL}sS7|$R2 zDGfrR{|@~AQJ&v(#4u|ZtJP}t520N48P!$8U;|Vfuq=8>E$w`o2Jf`%eqhqbr%IH1zV?O3uDWqKZId-wMQ*MFefpD5X*w@ zok{kNA?%%$F{M!OUcE^^x{~(wkHK|_*9Yg`KNS88FaVH_sda1Xfs6nE002ovPDHLk FV1jwin)(0$ diff --git a/single/images/warning.png b/single/images/warning.png deleted file mode 100644 index 0d5b5244605adbb7ab05a1549746a9c35490f95b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2130 zcmbVNYg7|w8V(4q($)50y>JmGlLW#g$xLn}Vd2Si)}#|ptPAQp3Bp-3!-lL0;i^LY?;i#f0m5s49g z3h?3rDQg~EDPlm?FKkgKIcWEK-3X6YU0uzs7H|nq84s39r2!5;pF?SI$QqXy^Ko1x zV~zpENvp@<_Bsd`5MabC#3rvCq&$5dg43yGR zAdy0-rWjC#a1N_+kzUMY#pmogD7!DP(9dEKr3c5ngvUq_6>}Y+w-a81v=eSXnIi_+ zI?U>D1q2C!0zHox#XXKH+@|&rPT*OF5yvY$5J|)WwLqnU)c-5;=UChSlQkaY3@^|g z|J5#YBB}=i+n3Ex9bS$P?xJSKLk)-HHII@;3qG#TG^!+aj>0QkO~7kB0+|yM;YrGB zF>Ge@isQ#73%Tp#k_(tInh3U$uJWY-+DND*o}L-CB5g@#9YWWw~pxZ!Obm>yN#ZHFvL0zA3vNCTJ=t?)~`2O1M{L6un=ml<2x zQEYfifmA?Pz0tqRs^2Utt1pU0BQB1eIY0U_I}c1Y#PP7Ci5s7#IJn}xK{G+{_v^Z+1V#$Erodv>d}ew>RP0wzw+GWkGCBlS1Oj5Z!5NK z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ke~E*>fL`SVLz z>d)poPL9p*CMc@y{c+ZRzjLyh`6sTKcMb`u{MV`7S1l#FF)-%R?QgctySE*GnCjzZ z-fC_6{Qt?;sYi-DCKY>d3&)E8fAa0#8YWiVo)pDXGqM7!Cy2$pne%H^p`*xZTds-! zw|ef0T>fh=dV>>`lpBrvfgXAP%yjAQmF;;8lN8f;s{OZIrmVE!_VoV9gG|Yyn(JCD zYu=|9*q>he;rzw-^KUIzNkzJh|ul8iGsQFj?{cl+E<@ZyeOL&lSk^|=+Z;llVKlCD3 z1oK`l`fq*pd;ayWQ%-9|FP^_pW#5AP+DG?qU;TCa`nmf>`nTsFsXsXFp5MYB`kMP9 z^LpJ1RrFtfju)6)wiLcR2+8aRcYPdK50rm?wO2TKdB>OOSL*I{YG%zx&B};;Z84eS z!a~gUIg0XhEk;p>^H-)`t<*$blZ0d`$ULC{#(?dO*uovE$)cHa1w#d!{yINjv=oMH z>I#Mx)d=T-7eAp`H0K~o2!lVY&ceTDk!!U>+R3x)NW&h%%J&BlMtzEF@LV0H#XdnBS`_u+?7JRC6`# zV#gzYKoS(~#ubI7Sr|4T1uv_^U1mJ;4|vojm=@-l&E~x}zw`dfbo3E06bJa(GfkVP zzFye-+KU%2c4Tji;JKJ_C1&=IyE~-6HseVL0ZhwT83q5jTo%sFPdYhC-}S}h@ZER& z0yI+I6R{p;MOE;WDYPs<;6t5@!np$M}YxDfS zI+IR5d1=Zl+l$u``JN6(>^1B5%j-?&zPq<}!`=^nJ}-7Ye3*l+`Ng|;#||7g5N)=^ z99vYtjV-7W68Px9Wgl=Xkmt+SL)Y$Kx30RKyFK~pQE_Df4vF|gL%}PH@TAfy2X=Qi zwEQaGeb?>J?ak@@>-K#rx>2=jx7+UBRv%wo3;%eht@lIa-d9Y2-bIDWu7%r+nX(O7 sjR diff --git a/single/spring-cloud-contract.html b/single/spring-cloud-contract.html index 4af07da2d2..a5ffb82f50 100644 --- a/single/spring-cloud-contract.html +++ b/single/spring-cloud-contract.html @@ -1,7020 +1,13 @@ - - - Spring Cloud Contract

Spring Cloud Contract


Table of Contents

1. Spring Cloud Contract
2. Spring Cloud Contract Verifier Introduction
2.1. History
2.2. Why a Contract Verifier?
2.2.1. Testing issues
2.3. Purposes
2.4. How It Works
2.4.1. A Three-second Tour
On the Producer Side
On the Consumer Side
2.4.2. A Three-minute Tour
On the Producer Side
On the Consumer Side
2.4.3. Defining the Contract
2.4.4. Client Side
2.4.5. Server Side
2.5. Step-by-step Guide to Consumer Driven Contracts (CDC)
2.5.1. Technical note
2.5.2. Consumer side (Loan Issuance)
2.5.3. Producer side (Fraud Detection server)
2.5.4. Consumer Side (Loan Issuance) Final Step
2.6. Dependencies
2.7. Additional Links
2.7.1. Spring Cloud Contract video
2.7.2. Readings
2.8. Samples
3. Spring Cloud Contract FAQ
3.1. Why use Spring Cloud Contract Verifier and not X ?
3.2. I don’t want to write a contract in Groovy!
3.3. What is this value(consumer(), producer()) ?
3.4. How to do Stubs versioning?
3.4.1. API Versioning
3.4.2. JAR versioning
3.4.3. Dev or prod stubs
3.5. Common repo with contracts
3.5.1. Repo structure
3.5.2. Workflow
3.5.3. Consumer
3.5.4. Producer
3.5.5. How can I define messaging contracts per topic not per producer?
For Maven Project
For Gradle Project
3.6. Do I need a Binary Storage? Can’t I use Git?
3.6.1. Protocol convention
3.6.2. Producer
3.6.3. Producer with contracts stored locally
Keeping contracts with the producer and stubs in an external repository
3.6.4. Consumer
3.7. Can I use the Pact Broker?
3.7.1. Pact Consumer
3.7.2. Producer
3.7.3. Pact Consumer (Producer Contract approach)
3.8. How can I debug the request/response being sent by the generated tests client?
3.8.1. How can I debug the mapping/request/response being sent by WireMock?
3.8.2. How can I see what got registered in the HTTP server stub?
3.8.3. Can I reference text from file?
4. Spring Cloud Contract Verifier Setup
4.1. Gradle Project
4.1.1. Prerequisites
4.1.2. Add Gradle Plugin with Dependencies
4.1.3. Gradle and Rest Assured 2.0
4.1.4. Snapshot Versions for Gradle
4.1.5. Add stubs
4.1.6. Run the Plugin
4.1.7. Default Setup
4.1.8. Configure Plugin
4.1.9. Configuration Options
4.1.10. Single Base Class for All Tests
4.1.11. Different Base Classes for Contracts
4.1.12. Invoking Generated Tests
4.1.13. Pushing stubs to SCM
4.1.14. Spring Cloud Contract Verifier on the Consumer Side
4.2. Maven Project
4.2.1. Add maven plugin
4.2.2. Maven and Rest Assured 2.0
4.2.3. Snapshot versions for Maven
4.2.4. Add stubs
4.2.5. Run plugin
4.2.6. Configure plugin
4.2.7. Configuration Options
4.2.8. Single Base Class for All Tests
4.2.9. Different base classes for contracts
4.2.10. Invoking generated tests
4.2.11. Pushing stubs to SCM
4.2.12. Maven Plugin and STS
4.2.13. Maven Plugin with Spock Tests
4.3. Stubs and Transitive Dependencies
4.4. Scenarios
4.5. Docker Project
4.5.1. Short intro to Maven, JARs and Binary storage
4.5.2. How it works
Environment Variables
4.5.3. Example of usage
4.5.4. Server side (nodejs)
5. Spring Cloud Contract Verifier Messaging
5.1. Integrations
5.2. Manual Integration Testing
5.3. Publisher-Side Test Generation
5.3.1. Scenario 1: No Input Message
5.3.2. Scenario 2: Output Triggered by Input
5.3.3. Scenario 3: No Output Message
5.4. Consumer Stub Generation
6. Spring Cloud Contract Stub Runner
6.1. Snapshot versions
6.2. Publishing Stubs as JARs
6.3. Stub Runner Core
6.3.1. Retrieving stubs
Stub downloading
Classpath scanning
Configuring HTTP Server Stubs
6.3.2. Running stubs
Running using main app
HTTP Stubs
Viewing registered mappings
Messaging Stubs
6.4. Stub Runner JUnit Rule and Stub Runner JUnit5 Extension
6.4.1. Maven settings
6.4.2. Providing fixed ports
6.4.3. Fluent API
6.4.4. Stub Runner with Spring
6.5. Stub Runner Spring Cloud
6.5.1. Stubbing Service Discovery
Test profiles and service discovery
6.5.2. Additional Configuration
6.6. Stub Runner Boot Application
6.6.1. How to use it?
Stub Runner Server
Stub Runner Server Fat Jar
Spring Cloud CLI
6.6.2. Endpoints
HTTP
Messaging
6.6.3. Example
6.6.4. Stub Runner Boot with Service Discovery
6.7. Stubs Per Consumer
6.8. Common
6.8.1. Common Properties for JUnit and Spring
6.8.2. Stub Runner Stubs IDs
6.9. Stub Runner Docker
6.9.1. How to use it
6.9.2. Example of client side usage in a non JVM project
7. Stub Runner for Messaging
7.1. Stub triggering
7.1.1. Trigger by Label
7.1.2. Trigger by Group and Artifact Ids
7.1.3. Trigger by Artifact Ids
7.1.4. Trigger All Messages
7.2. Stub Runner Camel
7.2.1. Adding it to the project
7.2.2. Disabling the functionality
7.2.3. Examples
Stubs structure
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
7.3. Stub Runner Integration
7.3.1. Adding the Runner to the Project
7.3.2. Disabling the functionality
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
7.4. Stub Runner Stream
7.4.1. Adding the Runner to the Project
7.4.2. Disabling the functionality
Scenario 1 (no input message)
Scenario 2 (output triggered by input)
Scenario 3 (input with no output)
7.5. Stub Runner Spring AMQP
7.5.1. Adding the Runner to the Project
Triggering the message
Spring AMQP Test Configuration
8. Contract DSL
8.1. Limitations
8.2. Common Top-Level elements
8.2.1. Description
8.2.2. Name
8.2.3. Ignoring Contracts
8.2.4. Passing Values from Files
8.2.5. HTTP Top-Level Elements
8.3. Request
8.4. Response
8.5. Dynamic properties
8.5.1. Dynamic properties inside the body
8.5.2. Regular expressions
8.5.3. Passing Optional Parameters
8.5.4. Executing Custom Methods on the Server Side
8.5.5. Referencing the Request from the Response
8.5.6. Registering Your Own WireMock Extension
8.5.7. Dynamic Properties in the Matchers Sections
8.6. JAX-RS Support
8.7. Async Support
8.8. Working with Context Paths
8.9. Working with WebFlux
8.9.1. WebFlux with WebTestClient
8.9.2. WebFlux with Explicit mode
8.10. XML Support for REST
8.11. Messaging Top-Level Elements
8.11.1. Output Triggered by a Method
8.11.2. Output Triggered by a Message
8.11.3. Consumer/Producer
8.11.4. Common
8.12. Multiple Contracts in One File
8.13. Generating Spring REST Docs snippets from the contracts
9. Customization
9.1. Extending the DSL
9.1.1. Common JAR
9.1.2. Adding the Dependency to the Project
9.1.3. Test the Dependency in the Project’s Dependencies
9.1.4. Test a Dependency in the Plugin’s Dependencies
9.1.5. Referencing classes in DSLs
10. Using the Pluggable Architecture
10.1. Custom Contract Converter
10.1.1. Pact Converter
10.1.2. Pact Contract
10.1.3. Pact for Producers
10.1.4. Pact for Consumers
10.2. Using the Custom Test Generator
10.3. Using the Custom Stub Generator
10.4. Using the Custom Stub Runner
10.5. Using the Custom Stub Downloader
10.6. Using the SCM Stub Downloader
10.7. Using the Pact Stub Downloader
11. Spring Cloud Contract WireMock
11.1. Registering Stubs Automatically
11.2. Using Files to Specify the Stub Bodies
11.3. Alternative: Using JUnit Rules
11.4. Relaxed SSL Validation for Rest Template
11.5. WireMock and Spring MVC Mocks
11.6. Customization of WireMock configuration
11.7. Generating Stubs using REST Docs
11.8. Generating Contracts by Using REST Docs
12. Migrations
12.1. 1.0.x → 1.1.x
12.1.1. New structure of generated stubs
12.2. 1.1.x → 1.2.x
12.2.1. Custom HttpServerStub
12.2.2. New packages for generated tests
12.2.3. New Methods in TemplateProcessor
12.2.4. RestAssured 3.0
12.3. 1.2.x → 2.0.x
13. Links

Documentation Authors: Adam Dudczak, Mathias Düsterhöft, Marcin Grzejszczak, Dennis Kieselhorst, Jakub Kubryński, Karol Lassak, -Olga Maciaszek-Sharma, Mariusz Smykuła, Dave Syer, Jay Bryant

2.1.2.BUILD-SNAPSHOT

1. Spring Cloud Contract

You need confidence when pushing new features to a new application or service in a -distributed system. This project provides support for Consumer Driven Contracts and -service schemas in Spring applications (for both HTTP and message-based interactions), -covering a range of options for writing tests, publishing them as assets, and asserting -that a contract is kept by producers and consumers.

2. Spring Cloud Contract Verifier Introduction

Spring Cloud Contract Verifier enables Consumer Driven Contract (CDC) development of -JVM-based applications. It moves TDD to the level of software architecture.

Spring Cloud Contract Verifier ships with Contract Definition Language (CDL). Contract -definitions are used to produce the following resources:

  • JSON stub definitions to be used by WireMock when doing integration testing on the -client code (client tests). Test code must still be written by hand, and test data is -produced by Spring Cloud Contract Verifier.
  • Messaging routes, if you’re using a messaging service. We integrate with Spring -Integration, Spring Cloud Stream, Spring AMQP, and Apache Camel. You can also set your -own integrations.
  • Acceptance tests (in JUnit 4, JUnit 5 or Spock) are used to verify if server-side implementation -of the API is compliant with the contract (server tests). A full test is generated by -Spring Cloud Contract Verifier.

2.1 History

Before becoming Spring Cloud Contract, this project was called Accurest. -It was created by Marcin Grzejszczak and Jakub Kubrynski -from (codearte.io.

The 0.1.0 release took place on 26 Jan 2015 and it became stable with 1.0.0 release on 29 Feb 2016.

2.2 Why a Contract Verifier?

Assume that we have a system consisting of multiple microservices:

Microservices Architecture

2.2.1 Testing issues

If we wanted to test the application in top left corner to determine whether it can -communicate with other services, we could do one of two things:

  • Deploy all microservices and perform end-to-end tests.
  • Mock other microservices in unit/integration tests.

Both have their advantages but also a lot of disadvantages.

Deploy all microservices and perform end to end tests

Advantages:

  • Simulates production.
  • Tests real communication between services.

Disadvantages:

  • To test one microservice, we have to deploy 6 microservices, a couple of databases, -etc.
  • The environment where the tests run is locked for a single suite of tests (nobody else -would be able to run the tests in the meantime).
  • They take a long time to run.
  • The feedback comes very late in the process.
  • They are extremely hard to debug.

Mock other microservices in unit/integration tests

Advantages:

  • They provide very fast feedback.
  • They have no infrastructure requirements.

Disadvantages:

  • The implementor of the service creates stubs that might have nothing to do with -reality.
  • You can go to production with passing tests and failing production.

To solve the aforementioned issues, Spring Cloud Contract Verifier with Stub Runner was -created. The main idea is to give you very fast feedback, without the need to set up the -whole world of microservices. If you work on stubs, then the only applications you need -are those that your application directly uses.

Stubbed Services

Spring Cloud Contract Verifier gives you the certainty that the stubs that you use were -created by the service that you’re calling. Also, if you can use them, it means that they -were tested against the producer’s side. In short, you can trust those stubs.

2.3 Purposes

The main purposes of Spring Cloud Contract Verifier with Stub Runner are:

  • To ensure that WireMock/Messaging stubs (used when developing the client) do exactly -what the actual server-side implementation does.
  • To promote ATDD method and Microservices architectural style.
  • To provide a way to publish changes in contracts that are immediately visible on both -sides.
  • To generate boilerplate test code to be used on the server side.
[Important]Important

Spring Cloud Contract Verifier’s purpose is NOT to start writing business -features in the contracts. Assume that we have a business use case of fraud check. If a -user can be a fraud for 100 different reasons, we would assume that you would create 2 -contracts, one for the positive case and one for the negative case. Contract tests are -used to test contracts between applications and not to simulate full behavior.

2.4 How It Works

This section explores how Spring Cloud Contract Verifier with Stub Runner works.

2.4.1 A Three-second Tour

This very brief tour walks through using Spring Cloud Contract:

You can find a somewhat longer tour -here.

On the Producer Side

To start working with Spring Cloud Contract, add files with REST/ messaging contracts -expressed in either Groovy DSL or YAML to the contracts directory, which is set by the -contractsDslDir property. By default, it is $rootDir/src/test/resources/contracts.

Then add the Spring Cloud Contract Verifier dependency and plugin to your build file, as -shown in the following example:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>

The following listing shows how to add the plugin, which should go in the build/plugins -portion of the file:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-</plugin>

Running ./mvnw clean install automatically generates tests that verify the application -compliance with the added contracts. By default, the tests get generated under -org.springframework.cloud.contract.verifier.tests..

As the implementation of the functionalities described by the contracts is not yet -present, the tests fail.

To make them pass, you must add the correct implementation of either handling HTTP -requests or messages. Also, you must add a correct base test class for auto-generated -tests to the project. This class is extended by all the auto-generated tests, and it -should contain all the setup necessary to run them (for example RestAssuredMockMvc -controller setup or messaging test setup).

Once the implementation and the test base class are in place, the tests pass, and both the -application and the stub artifacts are built and installed in the local Maven repository. -The changes can now be merged, and both the application and the stub artifacts may be -published in an online repository.

On the Consumer Side

Spring Cloud Contract Stub Runner can be used in the integration tests to get a running -WireMock instance or messaging route that simulates the actual service.

To do so, add the dependency to Spring Cloud Contract Stub Runner, as shown in the -following example:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-	<scope>test</scope>
-</dependency>

You can get the Producer-side stubs installed in your Maven repository in either of two -ways:

  • By checking out the Producer side repository and adding contracts and generating the stubs -by running the following commands:

    $ cd local-http-server-repo
    -$ ./mvnw clean install -DskipTests
    [Tip]Tip

    The tests are being skipped because the Producer-side contract implementation is not -in place yet, so the automatically-generated contract tests fail.

  • By getting already-existing producer service stubs from a remote repository. To do so, -pass the stub artifact IDs and artifact repository URL as Spring Cloud Contract -Stub Runner properties, as shown in the following example:

    stubrunner:
    -  ids: 'com.example:http-server-dsl:+:stubs:8080'
    -  repositoryRoot: https://repo.spring.io/libs-snapshot

Now you can annotate your test class with @AutoConfigureStubRunner. In the annotation, -provide the group-id and artifact-id values for Spring Cloud Contract Stub Runner to -run the collaborators' stubs for you, as shown in the following example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment=WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
-		stubsMode = StubRunnerProperties.StubsMode.LOCAL)
-public class LoanApplicationServiceTests {
[Tip]Tip

Use the REMOTE stubsMode when downloading stubs from an online repository and -LOCAL for offline work.

Now, in your integration test, you can receive stubbed versions of HTTP responses or -messages that are expected to be emitted by the collaborator service.

2.4.2 A Three-minute Tour

This brief tour walks through using Spring Cloud Contract:

You can find an even more brief tour -here.

On the Producer Side

To start working with Spring Cloud Contract, add files with REST/ messaging contracts -expressed in either Groovy DSL or YAML to the contracts directory, which is set by the -contractsDslDir property. By default, it is $rootDir/src/test/resources/contracts.

For the HTTP stubs, a contract defines what kind of response should be returned for a -given request (taking into account the HTTP methods, URLs, headers, status codes, and so -on). The following example shows how an HTTP stub contract in Groovy DSL:

package contracts
+
 
-org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url '/fraudcheck'
-		body([
-			   "client.id": $(regex('[0-9]{10}')),
-			   loanAmount: 99999
-		])
-		headers {
-			contentType('application/json')
-		}
-	}
-	response {
-		status OK()
-		body([
-			   fraudCheckStatus: "FRAUD",
-			   "rejection.reason": "Amount too high"
-		])
-		headers {
-			contentType('application/json')
-		}
-	}
-}

The same contract expressed in YAML would look like the following example:

request:
-  method: PUT
-  url: /fraudcheck
-  body:
-    "client.id": 1234567890
-    loanAmount: 99999
-  headers:
-    Content-Type: application/json
-  matchers:
-    body:
-      - path: $.['client.id']
-        type: by_regex
-        value: "[0-9]{10}"
-response:
-  status: 200
-  body:
-    fraudCheckStatus: "FRAUD"
-    "rejection.reason": "Amount too high"
-  headers:
-    Content-Type: application/json;charset=UTF-8

In the case of messaging, you can define:

  • The input and the output messages can be defined (taking into account from and where it -was sent, the message body, and the header).
  • The methods that should be called after the message is received.
  • The methods that, when called, should trigger a message.

The following example shows a Camel messaging contract expressed in Groovy DSL:

			def contractDsl = Contract.make {
-				label 'some_label'
-				input {
-					messageFrom('jms:delete')
-					messageBody([
-							bookName: 'foo'
-					])
-					messageHeaders {
-						header('sample', 'header')
-					}
-					assertThat('bookWasDeleted()')
-				}
-			}

The following example shows the same contract expressed in YAML:

label: some_label
-input:
-  messageFrom: jms:delete
-  messageBody:
-    bookName: 'foo'
-  messageHeaders:
-    sample: header
-  assertThat: bookWasDeleted()

Then you can add Spring Cloud Contract Verifier dependency and plugin to your build file, -as shown in the following example:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>

The following listing shows how to add the plugin, which should go in the build/plugins -portion of the file:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-</plugin>

Running ./mvnw clean install automatically generates tests that verify the application -compliance with the added contracts. By default, the generated tests are under -org.springframework.cloud.contract.verifier.tests..

The following example shows a sample auto-generated test for an HTTP contract:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-    // given:
-        MockMvcRequestSpecification request = given()
-                .header("Content-Type", "application/vnd.fraud.v1+json")
-                .body("{\"client.id\":\"1234567890\",\"loanAmount\":99999}");
+
+
 
-    // when:
-        ResponseOptions response = given().spec(request)
-                .put("/fraudcheck");
+
 
-    // then:
-        assertThat(response.statusCode()).isEqualTo(200);
-        assertThat(response.header("Content-Type")).matches("application/vnd.fraud.v1.json.*");
-    // and:
-        DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-        assertThatJson(parsedJson).field("['fraudCheckStatus']").matches("[A-Z]{5}");
-        assertThatJson(parsedJson).field("['rejection.reason']").isEqualTo("Amount too high");
-}

The preceding example uses Spring’s MockMvc to run the tests. This is the default test -mode for HTTP contracts. However, JAX-RS client and explicit HTTP invocations can also be -used. (To do so, change the testMode property of the plugin to JAX-RS or EXPLICIT, -respectively.)

Since 2.1.0, it is also possible to use RestAssuredWebTestClient`with Spring’s reactive `WebTestClient -run under the hood. This is particularly recommended while working with Reactive, Web-Flux-based applications. -In order to use WebTestClient set testMode to WEBTESTCLIENT.

Here is an example of a test generated in WEBTESTCLIENT test mode:

[source,java,indent=0]
@Test
-	public void validate_shouldRejectABeerIfTooYoung() throws Exception {
-		// given:
-			WebTestClientRequestSpecification request = given()
-					.header("Content-Type", "application/json")
-					.body("{\"age\":10}");
+Page Redirection
 
-		// when:
-			WebTestClientResponse response = given().spec(request)
-					.post("/check");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-			assertThat(response.header("Content-Type")).matches("application/json.*");
-		// and:
-			DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-			assertThatJson(parsedJson).field("['status']").isEqualTo("NOT_OK");
-	}

Apart from the default JUnit 4, you can instead use JUnit 5 or Spock tests, by setting the plugin -testFramework property to either JUNIT5 or Spock.

[Tip]Tip

You can now also generate WireMock scenarios based on the contracts, by including an -order number followed by an underscore at the beginning of the contract file names.

The following example shows an auto-generated test in Spock for a messaging stub contract:

[source,groovy,indent=0]
given:
-	 ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-		\'\'\'{"bookName":"foo"}\'\'\',
-		['sample': 'header']
-	)
-
-when:
-	 contractVerifierMessaging.send(inputMessage, 'jms:delete')
-
-then:
-	 noExceptionThrown()
-	 bookWasDeleted()

As the implementation of the functionalities described by the contracts is not yet -present, the tests fail.

To make them pass, you must add the correct implementation of handling either HTTP -requests or messages. Also, you must add a correct base test class for auto-generated -tests to the project. This class is extended by all the auto-generated tests and should -contain all the setup necessary to run them (for example, RestAssuredMockMvc controller -setup or messaging test setup).

Once the implementation and the test base class are in place, the tests pass, and both the -application and the stub artifacts are built and installed in the local Maven repository. -Information about installing the stubs jar to the local repository appears in the logs, as -shown in the following example:

[INFO] --- spring-cloud-contract-maven-plugin:1.0.0.BUILD-SNAPSHOT:generateStubs (default-generateStubs) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar
-[INFO]
-[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar
-[INFO]
-[INFO] --- spring-boot-maven-plugin:1.5.5.BUILD-SNAPSHOT:repackage (default) @ http-server ---
-[INFO]
-[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ http-server ---
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.jar
-[INFO] Installing /some/path/http-server/pom.xml to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.pom
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar

You can now merge the changes and publish both the application and the stub artifacts -in an online repository.

Docker Project

In order to enable working with contracts while creating applications in non-JVM -technologies, the springcloud/spring-cloud-contract Docker image has been created. It -contains a project that automatically generates tests for HTTP contracts and executes them -in EXPLICIT test mode. Then, if the tests pass, it generates Wiremock stubs and, -optionally, publishes them to an artifact manager. In order to use the image, you can -mount the contracts into the /contracts directory and set a few environment variables.

On the Consumer Side

Spring Cloud Contract Stub Runner can be used in the integration tests to get a running -WireMock instance or messaging route that simulates the actual service.

To get started, add the dependency to Spring Cloud Contract Stub Runner:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-	<scope>test</scope>
-</dependency>

You can get the Producer-side stubs installed in your Maven repository in either of two -ways:

  • By checking out the Producer side repository and adding contracts and generating the -stubs by running the following commands:

    $ cd local-http-server-repo
    -$ ./mvnw clean install -DskipTests
    [Note]Note

    The tests are skipped because the Producer-side contract implementation is not yet -in place, so the automatically-generated contract tests fail.

  • Getting already existing producer service stubs from a remote repository. To do so, -pass the stub artifact IDs and artifact repository URl as Spring Cloud Contract Stub -Runner properties, as shown in the following example:

    stubrunner:
    -  ids: 'com.example:http-server-dsl:+:stubs:8080'
    -  repositoryRoot: https://repo.spring.io/libs-snapshot

Now you can annotate your test class with @AutoConfigureStubRunner. In the annotation, -provide the group-id and artifact-id for Spring Cloud Contract Stub Runner to run -the collaborators' stubs for you, as shown in the following example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment=WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
-		stubsMode = StubRunnerProperties.StubsMode.LOCAL)
-public class LoanApplicationServiceTests {
[Tip]Tip

Use the REMOTE stubsMode when downloading stubs from an online repository and -LOCAL for offline work.

In your integration test, you can receive stubbed versions of HTTP responses or messages -that are expected to be emitted by the collaborator service. You can see entries similar -to the following in the build logs:

2016-07-19 14:22:25.403  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Desired version is + - will try to resolve the latest version
-2016-07-19 14:22:25.438  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved version is 0.0.1-SNAPSHOT
-2016-07-19 14:22:25.439  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolving artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT using remote repositories []
-2016-07-19 14:22:25.451  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar
-2016-07-19 14:22:25.465  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacking stub from JAR [URI: file:/path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar]
-2016-07-19 14:22:25.475  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacked file to [/var/folders/0p/xwq47sq106x1_g3dtv6qfm940000gq/T/contracts100276532569594265]
-2016-07-19 14:22:27.737  INFO 41050 --- [           main] o.s.c.c.stubrunner.StubRunnerExecutor    : All stubs are now running RunningStubs [namesAndPorts={com.example:http-server:0.0.1-SNAPSHOT:stubs=8080}]

2.4.3 Defining the Contract

As consumers of services, we need to define what exactly we want to achieve. We need to -formulate our expectations. That is why we write contracts.

Assume that you want to send a request containing the ID of a client company and the -amount it wants to borrow from us. You also want to send it to the /fraudcheck url via -the PUT method.

Groovy DSL.  -

/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package contracts
-
-org.springframework.cloud.contract.spec.Contract.make {
-	request { // (1)
-		method 'PUT' // (2)
-		url '/fraudcheck' // (3)
-		body([ // (4)
-			   "client.id": $(regex('[0-9]{10}')),
-			   loanAmount : 99999
-		])
-		headers { // (5)
-			contentType('application/json')
-		}
-	}
-	response { // (6)
-		status OK() // (7)
-		body([ // (8)
-			   fraudCheckStatus  : "FRAUD",
-			   "rejection.reason": "Amount too high"
-		])
-		headers { // (9)
-			contentType('application/json')
-		}
-	}
-}
-
-/*
-From the Consumer perspective, when shooting a request in the integration test:
-
-(1) - If the consumer sends a request
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `client.id` that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the response will be sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` equal to `application/json`
-
-From the Producer perspective, in the autogenerated producer-side test:
-
-(1) - A request will be sent to the producer
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `client.id` that will have a generated value that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the test will assert if the response has been sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` matching `application/json.*`
- */

-

YAML.  -

request: # (1)
-  method: PUT # (2)
-  url: /fraudcheck # (3)
-  body: # (4)
-    "client.id": 1234567890
-    loanAmount: 99999
-  headers: # (5)
-    Content-Type: application/json
-  matchers:
-    body:
-      - path: $.['client.id'] # (6)
-        type: by_regex
-        value: "[0-9]{10}"
-response: # (7)
-  status: 200 # (8)
-  body:  # (9)
-    fraudCheckStatus: "FRAUD"
-    "rejection.reason": "Amount too high"
-  headers: # (10)
-    Content-Type: application/json;charset=UTF-8
-
-
-#From the Consumer perspective, when shooting a request in the integration test:
-#
-#(1) - If the consumer sends a request
-#(2) - With the "PUT" method
-#(3) - to the URL "/fraudcheck"
-#(4) - with the JSON body that
-# * has a field `client.id`
-# * has a field `loanAmount` that is equal to `99999`
-#(5) - with header `Content-Type` equal to `application/json`
-#(6) - and a `client.id` json entry matches the regular expression `[0-9]{10}`
-#(7) - then the response will be sent with
-#(8) - status equal `200`
-#(9) - and JSON body equal to
-# { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-#(10) - with header `Content-Type` equal to `application/json`
-#
-#From the Producer perspective, in the autogenerated producer-side test:
-#
-#(1) - A request will be sent to the producer
-#(2) - With the "PUT" method
-#(3) - to the URL "/fraudcheck"
-#(4) - with the JSON body that
-# * has a field `client.id` `1234567890`
-# * has a field `loanAmount` that is equal to `99999`
-#(5) - with header `Content-Type` equal to `application/json`
-#(7) - then the test will assert if the response has been sent with
-#(8) - status equal `200`
-#(9) - and JSON body equal to
-# { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-#(10) - with header `Content-Type` equal to `application/json;charset=UTF-8`

-

2.4.4 Client Side

Spring Cloud Contract generates stubs, which you can use during client-side testing. -You get a running WireMock instance/Messaging route that simulates the service. -You would like to feed that instance with a proper stub definition.

At some point in time, you need to send a request to the Fraud Detection service.

ResponseEntity<FraudServiceResponse> response = restTemplate.exchange(
-		"http://localhost:" + port + "/fraudcheck", HttpMethod.PUT,
-		new HttpEntity<>(request, httpHeaders), FraudServiceResponse.class);

Annotate your test class with @AutoConfigureStubRunner. In the annotation provide the group id and artifact id for the Stub Runner to download stubs of your collaborators.

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {
-		"com.example:http-server-dsl:+:stubs:6565" }, stubsMode = StubRunnerProperties.StubsMode.LOCAL)
-public class LoanApplicationServiceTests {

After that, during the tests, Spring Cloud Contract automatically finds the stubs -(simulating the real service) in the Maven repository and exposes them on a configured -(or random) port.

2.4.5 Server Side

Since you are developing your stub, you need to be sure that it actually resembles your -concrete implementation. You cannot have a situation where your stub acts in one way and -your application behaves in a different way, especially in production.

To ensure that your application behaves the way you define in your stub, tests are -generated from the stub you provide.

The autogenerated test looks, more or less, like this:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-    // given:
-        MockMvcRequestSpecification request = given()
-                .header("Content-Type", "application/vnd.fraud.v1+json")
-                .body("{\"client.id\":\"1234567890\",\"loanAmount\":99999}");
-
-    // when:
-        ResponseOptions response = given().spec(request)
-                .put("/fraudcheck");
-
-    // then:
-        assertThat(response.statusCode()).isEqualTo(200);
-        assertThat(response.header("Content-Type")).matches("application/vnd.fraud.v1.json.*");
-    // and:
-        DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-        assertThatJson(parsedJson).field("['fraudCheckStatus']").matches("[A-Z]{5}");
-        assertThatJson(parsedJson).field("['rejection.reason']").isEqualTo("Amount too high");
-}

2.5 Step-by-step Guide to Consumer Driven Contracts (CDC)

Consider an example of Fraud Detection and the Loan Issuance process. The business -scenario is such that we want to issue loans to people but do not want them to steal from -us. The current implementation of our system grants loans to everybody.

Assume that Loan Issuance is a client to the Fraud Detection server. In the current -sprint, we must develop a new feature: if a client wants to borrow too much money, then -we mark the client as a fraud.

Technical remark - Fraud Detection has an artifact-id of http-server, while Loan -Issuance has an artifact-id of http-client, and both have a group-id of com.example.

Social remark - both client and server development teams need to communicate directly and -discuss changes while going through the process. CDC is all about communication.

The server -side code is available here and the -client code here.

[Tip]Tip

In this case, the producer owns the contracts. Physically, all the contract are -in the producer’s repository.

2.5.1 Technical note

If using the SNAPSHOT / Milestone / Release Candidate versions please add the -following section to your build:

Maven.  -

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

-

Gradle.  -

repositories {
-	mavenCentral()
-	mavenLocal()
-	maven { url "https://repo.spring.io/snapshot" }
-	maven { url "https://repo.spring.io/milestone" }
-	maven { url "https://repo.spring.io/release" }
-}

-

2.5.2 Consumer side (Loan Issuance)

As a developer of the Loan Issuance service (a consumer of the Fraud Detection server), you might do the following steps:

  1. Start doing TDD by writing a test for your feature.
  2. Write the missing implementation.
  3. Clone the Fraud Detection service repository locally.
  4. Define the contract locally in the repo of Fraud Detection service.
  5. Add the Spring Cloud Contract Verifier plugin.
  6. Run the integration tests.
  7. File a pull request.
  8. Create an initial implementation.
  9. Take over the pull request.
  10. Write the missing implementation.
  11. Deploy your app.
  12. Work online.

Start doing TDD by writing a test for your feature.

@Test
-public void shouldBeRejectedDueToAbnormalLoanAmount() {
-	// given:
-	LoanApplication application = new LoanApplication(new Client("1234567890"),
-			99999);
-	// when:
-	LoanApplicationResult loanApplication = service.loanApplication(application);
-	// then:
-	assertThat(loanApplication.getLoanApplicationStatus())
-			.isEqualTo(LoanApplicationStatus.LOAN_APPLICATION_REJECTED);
-	assertThat(loanApplication.getRejectionReason()).isEqualTo("Amount too high");
-}

Assume that you have written a test of your new feature. If a loan application for a big -amount is received, the system should reject that loan application with some description.

Write the missing implementation.

At some point in time, you need to send a request to the Fraud Detection service. Assume -that you need to send the request containing the ID of the client and the amount the -client wants to borrow. You want to send it to the /fraudcheck url via the PUT method.

ResponseEntity<FraudServiceResponse> response = restTemplate.exchange(
-		"http://localhost:" + port + "/fraudcheck", HttpMethod.PUT,
-		new HttpEntity<>(request, httpHeaders), FraudServiceResponse.class);

For simplicity, the port of the Fraud Detection service is set to 8080, and the -application runs on 8090.

If you start the test at this point, it breaks, because no service currently runs on port -8080.

Clone the Fraud Detection service repository locally.

You can start by playing around with the server side contract. To do so, you must first -clone it.

$ git clone https://your-git-server.com/server-side.git local-http-server-repo

Define the contract locally in the repo of Fraud Detection service.

As a consumer, you need to define what exactly you want to achieve. You need to formulate -your expectations. To do so, write the following contract:

[Important]Important

Place the contract under src/test/resources/contracts/fraud folder. The fraud folder -is important because the producer’s test base class name references that folder.

Groovy DSL.  -

/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package contracts
-
-org.springframework.cloud.contract.spec.Contract.make {
-	request { // (1)
-		method 'PUT' // (2)
-		url '/fraudcheck' // (3)
-		body([ // (4)
-			   "client.id": $(regex('[0-9]{10}')),
-			   loanAmount : 99999
-		])
-		headers { // (5)
-			contentType('application/json')
-		}
-	}
-	response { // (6)
-		status OK() // (7)
-		body([ // (8)
-			   fraudCheckStatus  : "FRAUD",
-			   "rejection.reason": "Amount too high"
-		])
-		headers { // (9)
-			contentType('application/json')
-		}
-	}
-}
-
-/*
-From the Consumer perspective, when shooting a request in the integration test:
-
-(1) - If the consumer sends a request
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `client.id` that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the response will be sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` equal to `application/json`
-
-From the Producer perspective, in the autogenerated producer-side test:
-
-(1) - A request will be sent to the producer
-(2) - With the "PUT" method
-(3) - to the URL "/fraudcheck"
-(4) - with the JSON body that
- * has a field `client.id` that will have a generated value that matches a regular expression `[0-9]{10}`
- * has a field `loanAmount` that is equal to `99999`
-(5) - with header `Content-Type` equal to `application/json`
-(6) - then the test will assert if the response has been sent with
-(7) - status equal `200`
-(8) - and JSON body equal to
- { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-(9) - with header `Content-Type` matching `application/json.*`
- */

-

YAML.  -

request: # (1)
-  method: PUT # (2)
-  url: /fraudcheck # (3)
-  body: # (4)
-    "client.id": 1234567890
-    loanAmount: 99999
-  headers: # (5)
-    Content-Type: application/json
-  matchers:
-    body:
-      - path: $.['client.id'] # (6)
-        type: by_regex
-        value: "[0-9]{10}"
-response: # (7)
-  status: 200 # (8)
-  body:  # (9)
-    fraudCheckStatus: "FRAUD"
-    "rejection.reason": "Amount too high"
-  headers: # (10)
-    Content-Type: application/json;charset=UTF-8
-
-
-#From the Consumer perspective, when shooting a request in the integration test:
-#
-#(1) - If the consumer sends a request
-#(2) - With the "PUT" method
-#(3) - to the URL "/fraudcheck"
-#(4) - with the JSON body that
-# * has a field `client.id`
-# * has a field `loanAmount` that is equal to `99999`
-#(5) - with header `Content-Type` equal to `application/json`
-#(6) - and a `client.id` json entry matches the regular expression `[0-9]{10}`
-#(7) - then the response will be sent with
-#(8) - status equal `200`
-#(9) - and JSON body equal to
-# { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-#(10) - with header `Content-Type` equal to `application/json`
-#
-#From the Producer perspective, in the autogenerated producer-side test:
-#
-#(1) - A request will be sent to the producer
-#(2) - With the "PUT" method
-#(3) - to the URL "/fraudcheck"
-#(4) - with the JSON body that
-# * has a field `client.id` `1234567890`
-# * has a field `loanAmount` that is equal to `99999`
-#(5) - with header `Content-Type` equal to `application/json`
-#(7) - then the test will assert if the response has been sent with
-#(8) - status equal `200`
-#(9) - and JSON body equal to
-# { "fraudCheckStatus": "FRAUD", "rejectionReason": "Amount too high" }
-#(10) - with header `Content-Type` equal to `application/json;charset=UTF-8`

-

The YML contract is quite straight-forward. However when you take a look at the Contract -written using a statically typed Groovy DSL - you might wonder what the -value(client(…​), server(…​)) parts are. By using this notation, Spring Cloud -Contract lets you define parts of a JSON block, a URL, etc., which are dynamic. In case -of an identifier or a timestamp, you need not hardcode a value. You want to allow some -different ranges of values. To enable ranges of values, you can set regular expressions -matching those values for the consumer side. You can provide the body by means of either -a map notation or String with interpolations. -Consult the Chapter 8, Contract DSL section for more information. We highly recommend using the map notation!

[Tip]Tip

You must understand the map notation in order to set up contracts. Please read the -Groovy docs regarding JSON.

The previously shown contract is an agreement between two sides that:

  • if an HTTP request is sent with all of

    • a PUT method on the /fraudcheck endpoint,
    • a JSON body with a client.id that matches the regular expression [0-9]{10} and -loanAmount equal to 99999,
    • and a Content-Type header with a value of application/vnd.fraud.v1+json,
  • then an HTTP response is sent to the consumer that

    • has status 200,
    • contains a JSON body with the fraudCheckStatus field containing a value FRAUD and -the rejectionReason field having value Amount too high,
    • and a Content-Type header with a value of application/vnd.fraud.v1+json.

Once you are ready to check the API in practice in the integration tests, you need to -install the stubs locally.

Add the Spring Cloud Contract Verifier plugin.

We can add either a Maven or a Gradle plugin. In this example, you see how to add Maven. -First, add the Spring Cloud Contract BOM.

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-release.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Next, add the Spring Cloud Contract Verifier Maven plugin

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-		<convertToYaml>true</convertToYaml>
-	</configuration>
-</plugin>

Since the plugin was added, you get the Spring Cloud Contract Verifier features which, -from the provided contracts:

  • generate and run tests
  • produce and install stubs

You do not want to generate tests since you, as the consumer, want only to play with the -stubs. You need to skip the test generation and execution. When you execute:

$ cd local-http-server-repo
-$ ./mvnw clean install -DskipTests

In the logs, you see something like this:

[INFO] --- spring-cloud-contract-maven-plugin:1.0.0.BUILD-SNAPSHOT:generateStubs (default-generateStubs) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar
-[INFO]
-[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ http-server ---
-[INFO] Building jar: /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar
-[INFO]
-[INFO] --- spring-boot-maven-plugin:1.5.5.BUILD-SNAPSHOT:repackage (default) @ http-server ---
-[INFO]
-[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ http-server ---
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.jar
-[INFO] Installing /some/path/http-server/pom.xml to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT.pom
-[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar

The following line is extremely important:

[INFO] Installing /some/path/http-server/target/http-server-0.0.1-SNAPSHOT-stubs.jar to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar

It confirms that the stubs of the http-server have been installed in the local -repository.

Run the integration tests.

In order to profit from the Spring Cloud Contract Stub Runner functionality of automatic -stub downloading, you must do the following in your consumer side project (Loan -Application service):

Add the Spring Cloud Contract BOM:

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-release-train.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Add the dependency to Spring Cloud Contract Stub Runner:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-	<scope>test</scope>
-</dependency>

Annotate your test class with @AutoConfigureStubRunner. In the annotation, provide the -group-id and artifact-id for the Stub Runner to download the stubs of your -collaborators. (Optional step) Because you’re playing with the collaborators offline, you -can also provide the offline work switch (StubRunnerProperties.StubsMode.LOCAL).

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.NONE)
-@AutoConfigureStubRunner(ids = {
-		"com.example:http-server-dsl:+:stubs:6565" }, stubsMode = StubRunnerProperties.StubsMode.LOCAL)
-public class LoanApplicationServiceTests {

Now, when you run your tests, you see something like this:

2016-07-19 14:22:25.403  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Desired version is + - will try to resolve the latest version
-2016-07-19 14:22:25.438  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved version is 0.0.1-SNAPSHOT
-2016-07-19 14:22:25.439  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolving artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT using remote repositories []
-2016-07-19 14:22:25.451  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Resolved artifact com.example:http-server:jar:stubs:0.0.1-SNAPSHOT to /path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar
-2016-07-19 14:22:25.465  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacking stub from JAR [URI: file:/path/to/your/.m2/repository/com/example/http-server/0.0.1-SNAPSHOT/http-server-0.0.1-SNAPSHOT-stubs.jar]
-2016-07-19 14:22:25.475  INFO 41050 --- [           main] o.s.c.c.stubrunner.AetherStubDownloader  : Unpacked file to [/var/folders/0p/xwq47sq106x1_g3dtv6qfm940000gq/T/contracts100276532569594265]
-2016-07-19 14:22:27.737  INFO 41050 --- [           main] o.s.c.c.stubrunner.StubRunnerExecutor    : All stubs are now running RunningStubs [namesAndPorts={com.example:http-server:0.0.1-SNAPSHOT:stubs=8080}]

This output means that Stub Runner has found your stubs and started a server for your app -with group id com.example, artifact id http-server with version 0.0.1-SNAPSHOT of -the stubs and with stubs classifier on port 8080.

File a pull request.

What you have done until now is an iterative process. You can play around with the -contract, install it locally, and work on the consumer side until the contract works as -you wish.

Once you are satisfied with the results and the test passes, publish a pull request to -the server side. Currently, the consumer side work is done.

2.5.3 Producer side (Fraud Detection server)

As a developer of the Fraud Detection server (a server to the Loan Issuance service):

Create an initial implementation.

As a reminder, you can see the initial implementation here:

@RequestMapping(value = "/fraudcheck", method = PUT)
-public FraudCheckResult fraudCheck(@RequestBody FraudCheck fraudCheck) {
-return new FraudCheckResult(FraudCheckStatus.OK, NO_REASON);
-}

Take over the pull request.

$ git checkout -b contract-change-pr master
-$ git pull https://your-git-server.com/server-side-fork.git contract-change-pr

You must add the dependencies needed by the autogenerated tests:

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>

In the configuration of the Maven plugin, pass the packageWithBaseClasses property

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-		<convertToYaml>true</convertToYaml>
-	</configuration>
-</plugin>
[Important]Important

This example uses "convention based" naming by setting the -packageWithBaseClasses property. Doing so means that the two last packages combine to -make the name of the base test class. In our case, the contracts were placed under -src/test/resources/contracts/fraud. Since you do not have two packages starting from -the contracts folder, pick only one, which should be fraud. Add the Base suffix and -capitalize fraud. That gives you the FraudBase test class name.

All the generated tests extend that class. Over there, you can set up your Spring Context -or whatever is necessary. In this case, use Rest Assured MVC to -start the server side FraudDetectionController.

/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.example.fraud;
-
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-import org.junit.Before;
-
-public class FraudBase {
-
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.standaloneSetup(new FraudDetectionController(),
-				new FraudStatsController(stubbedStatsProvider()));
-	}
-
-	private StatsProvider stubbedStatsProvider() {
-		return fraudType -> {
-			switch (fraudType) {
-			case DRUNKS:
-				return 100;
-			case ALL:
-				return 200;
-			}
-			return 0;
-		};
-	}
-
-	public void assertThatRejectionReasonIsNull(Object rejectionReason) {
-		assert rejectionReason == null;
-	}
-
-}

Now, if you run the ./mvnw clean install, you get something like this:

Results :
-
-Tests in error:
-  ContractVerifierTest.validate_shouldMarkClientAsFraud:32 » IllegalState Parsed...

This error occurs because you have a new contract from which a test was generated and it -failed since you have not implemented the feature. The auto-generated test would look -like this:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-    // given:
-        MockMvcRequestSpecification request = given()
-                .header("Content-Type", "application/vnd.fraud.v1+json")
-                .body("{\"client.id\":\"1234567890\",\"loanAmount\":99999}");
-
-    // when:
-        ResponseOptions response = given().spec(request)
-                .put("/fraudcheck");
-
-    // then:
-        assertThat(response.statusCode()).isEqualTo(200);
-        assertThat(response.header("Content-Type")).matches("application/vnd.fraud.v1.json.*");
-    // and:
-        DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-        assertThatJson(parsedJson).field("['fraudCheckStatus']").matches("[A-Z]{5}");
-        assertThatJson(parsedJson).field("['rejection.reason']").isEqualTo("Amount too high");
-}

If you used the Groovy DSL, you can see, all the producer() parts of the Contract that were present in the -value(consumer(…​), producer(…​)) blocks got injected into the test. -In case of using YAML, the same applied for the matchers sections of the response.

Note that, on the producer side, you are also doing TDD. The expectations are expressed -in the form of a test. This test sends a request to our own application with the URL, -headers, and body defined in the contract. It also is expecting precisely defined values -in the response. In other words, you have the red part of red, green, and -refactor. It is time to convert the red into the green.

Write the missing implementation.

Because you know the expected input and expected output, you can write the missing -implementation:

@RequestMapping(value = "/fraudcheck", method = PUT)
-public FraudCheckResult fraudCheck(@RequestBody FraudCheck fraudCheck) {
-if (amountGreaterThanThreshold(fraudCheck)) {
-	return new FraudCheckResult(FraudCheckStatus.FRAUD, AMOUNT_TOO_HIGH);
-}
-return new FraudCheckResult(FraudCheckStatus.OK, NO_REASON);
-}

When you execute ./mvnw clean install again, the tests pass. Since the Spring Cloud -Contract Verifier plugin adds the tests to the generated-test-sources, you can -actually run those tests from your IDE.

Deploy your app.

Once you finish your work, you can deploy your change. First, merge the branch:

$ git checkout master
-$ git merge --no-ff contract-change-pr
-$ git push origin master

Your CI might run something like ./mvnw clean deploy, which would publish both the -application and the stub artifacts.

2.5.4 Consumer Side (Loan Issuance) Final Step

As a developer of the Loan Issuance service (a consumer of the Fraud Detection server):

Merge branch to master.

$ git checkout master
-$ git merge --no-ff contract-change-pr

Work online.

Now you can disable the offline work for Spring Cloud Contract Stub Runner and indicate -where the repository with your stubs is located. At this moment the stubs of the server -side are automatically downloaded from Nexus/Artifactory. You can set the value of -stubsMode to REMOTE. The following code shows an example of -achieving the same thing by changing the properties.

stubrunner:
-  ids: 'com.example:http-server-dsl:+:stubs:8080'
-  repositoryRoot: https://repo.spring.io/libs-snapshot

That’s it!

2.6 Dependencies

The best way to add dependencies is to use the proper starter dependency.

For stub-runner, use spring-cloud-starter-stub-runner. When you use a plugin, add -spring-cloud-starter-contract-verifier.

2.7 Additional Links

Here are some resources related to Spring Cloud Contract Verifier and Stub Runner. Note -that some may be outdated, because the Spring Cloud Contract Verifier project is under -constant development.

2.7.1 Spring Cloud Contract video

You can check out the video from the Warsaw JUG about Spring Cloud Contract:

2.8 Samples

You can find some samples at -samples.

3. Spring Cloud Contract FAQ

3.1 Why use Spring Cloud Contract Verifier and not X ?

For the time being Spring Cloud Contract is a JVM based tool. So it could be your first pick when you’re already creating -software for the JVM. This project has a lot of really interesting features but especially quite a few of them definitely make -Spring Cloud Contract Verifier stand out on the "market" of Consumer Driven Contract (CDC) tooling. Out of many the most interesting are:

  • Possibility to do CDC with messaging
  • Clear and easy to use, statically typed DSL
  • Possibility to copy paste your current JSON file to the contract and only edit its elements
  • Automatic generation of tests from the defined Contract
  • Stub Runner functionality - the stubs are automatically downloaded at runtime from Nexus / Artifactory
  • Spring Cloud integration - no discovery service is needed for integration tests
  • Spring Cloud Contract integrates with Pact out of the box and provides easy hooks to extend its functionality
  • Via Docker adds support for any language & framework used

3.2 I don’t want to write a contract in Groovy!

No problem. You can write a contract in YAML!

3.3 What is this value(consumer(), producer()) ?

One of the biggest challenges related to stubs is their reusability. Only if they can be vastly used, will they serve their purpose. -What typically makes that difficult are the hard-coded values of request / response elements. For example dates or ids. -Imagine the following JSON request

{
-    "time" : "2016-10-10 20:10:15",
-    "id" : "9febab1c-6f36-4a0b-88d6-3b6a6d81cd4a",
-    "body" : "foo"
-}

and JSON response

{
-    "time" : "2016-10-10 21:10:15",
-    "id" : "c4231e1f-3ca9-48d3-b7e7-567d55f0d051",
-    "body" : "bar"
-}

Imagine the pain required to set proper value of the time field (let’s assume that this content is generated by the -database) by changing the clock in the system or providing stub implementations of data providers. The same is related -to the field called id. Will you create a stubbed implementation of UUID generator? Makes little sense…​

So as a consumer you would like to send a request that matches any form of a time or any UUID. That way your system -will work as usual - will generate data and you won’t have to stub anything out. Let’s assume that in case of the aforementioned -JSON the most important part is the body field. You can focus on that and provide matching for other fields. In other words -you would like the stub to work like this:

{
-    "time" : "SOMETHING THAT MATCHES TIME",
-    "id" : "SOMETHING THAT MATCHES UUID",
-    "body" : "foo"
-}

As far as the response goes as a consumer you need a concrete value that you can operate on. So such a JSON is valid

{
-    "time" : "2016-10-10 21:10:15",
-    "id" : "c4231e1f-3ca9-48d3-b7e7-567d55f0d051",
-    "body" : "bar"
-}

As you could see in the previous sections we generate tests from contracts. So from the producer’s side the situation looks -much different. We’re parsing the provided contract and in the test we want to send a real request to your endpoints. -So for the case of a producer for the request we can’t have any sort of matching. We need concrete values that the -producer’s backend can work on. Such a JSON would be a valid one:

{
-    "time" : "2016-10-10 20:10:15",
-    "id" : "9febab1c-6f36-4a0b-88d6-3b6a6d81cd4a",
-    "body" : "foo"
-}

On the other hand from the point of view of the validity of the contract the response doesn’t necessarily have to -contain concrete values of time or id. Let’s say that you generate those on the producer side - again, you’d -have to do a lot of stubbing to ensure that you always return the same values. That’s why from the producer’s side -what you might want is the following response:

{
-    "time" : "SOMETHING THAT MATCHES TIME",
-    "id" : "SOMETHING THAT MATCHES UUID",
-    "body" : "bar"
-}

How can you then provide one time a matcher for the consumer and a concrete value for the producer and vice versa? -In Spring Cloud Contract we’re allowing you to provide a dynamic value. That means that it can differ for both -sides of the communication. You can pass the values:

Either via the value method

value(consumer(...), producer(...))
-value(stub(...), test(...))
-value(client(...), server(...))

or using the $() method

$(consumer(...), producer(...))
-$(stub(...), test(...))
-$(client(...), server(...))

You can read more about this in the Chapter 8, Contract DSL section.

Calling value() or $() tells Spring Cloud Contract that you will be passing a dynamic value. -Inside the consumer() method you pass the value that should be used on the consumer side (in the generated stub). -Inside the producer() method you pass the value that should be used on the producer side (in the generated test).

[Tip]Tip

If on one side you have passed the regular expression and you haven’t passed the other, then the -other side will get auto-generated.

Most often you will use that method together with the regex helper method. E.g. consumer(regex('[0-9]{10}')).

To sum it up the contract for the aforementioned scenario would look more or less like this (the regular expression -for time and UUID are simplified and most likely invalid but we want to keep things very simple in this example):

org.springframework.cloud.contract.spec.Contract.make {
-				request {
-					method 'GET'
-					url '/someUrl'
-					body([
-					    time : value(consumer(regex('[0-9]{4}-[0-9]{2}-[0-9]{2} [0-2][0-9]-[0-5][0-9]-[0-5][0-9]')),
-					    id: value(consumer(regex('[0-9a-zA-z]{8}-[0-9a-zA-z]{4}-[0-9a-zA-z]{4}-[0-9a-zA-z]{12}'))
-					    body: "foo"
-					])
-				}
-			response {
-				status OK()
-				body([
-					    time : value(producer(regex('[0-9]{4}-[0-9]{2}-[0-9]{2} [0-2][0-9]-[0-5][0-9]-[0-5][0-9]')),
-					    id: value([producer(regex('[0-9a-zA-z]{8}-[0-9a-zA-z]{4}-[0-9a-zA-z]{4}-[0-9a-zA-z]{12}'))
-					    body: "bar"
-					])
-			}
-}
[Important]Important

Please read the Groovy docs related to JSON to understand how to -properly structure the request / response bodies.

3.4 How to do Stubs versioning?

3.4.1 API Versioning

Let’s try to answer a question what versioning really means. If you’re referring to the API version then there are -different approaches.

  • use Hypermedia, links and do not version your API by any means
  • pass versions through headers / urls

I will not try to answer a question which approach is better. Whatever suits your needs and allows you to generate -business value should be picked.

Let’s assume that you do version your API. In that case you should provide as many contracts as many versions you support. -You can create a subfolder for every version or append it to the contract name - whatever suits you more.

3.4.2 JAR versioning

If by versioning you mean the version of the JAR that contains the stubs then there are essentially two main approaches.

Let’s assume that you’re doing Continuous Delivery / Deployment which means that you’re generating a new version of -the jar each time you go through the pipeline and that jar can go to production at any time. For example your jar version -looks like this (it got built on the 20.10.2016 at 20:15:21) :

1.0.0.20161020-201521-RELEASE

In that case your generated stub jar will look like this.

1.0.0.20161020-201521-RELEASE-stubs.jar

In this case you should inside your application.yml or @AutoConfigureStubRunner when referencing stubs provide the - latest version of the stubs. You can do that by passing the + sign. Example

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:8080"})

If the versioning however is fixed (e.g. 1.0.4.RELEASE or 2.1.1) then you have to set the concrete value of the jar -version. Example for 2.1.1.

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:2.1.1:stubs:8080"})

3.4.3 Dev or prod stubs

You can manipulate the classifier to run the tests against current development version of the stubs of other services - or the ones that were deployed to production. If you alter your build to deploy the stubs with the prod-stubs classifier - once you reach production deployment then you can run tests in one case with dev stubs and one with prod stubs.

Example of tests using development version of stubs

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:8080"})

Example of tests using production version of stubs

@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:prod-stubs:8080"})

You can pass those values also via properties from your deployment pipeline.

3.5 Common repo with contracts

Another way of storing contracts other than having them with the producer is keeping them in a common place. -It can be related to security issues where the consumers can’t clone the producer’s code. Also if you keep -contracts in a single place then you, as a producer, will know how many consumers you have and which -consumer you will break with your local changes.

3.5.1 Repo structure

Let’s assume that we have a producer with coordinates com.example:server and 3 consumers: client1, -client2, client3. Then in the repository with common contracts you would have the following setup -(which you can checkout here):

├── com
-│   └── example
-│       └── server
-│           ├── client1
-│           │   └── expectation.groovy
-│           ├── client2
-│           │   └── expectation.groovy
-│           ├── client3
-│           │   └── expectation.groovy
-│           └── pom.xml
-├── mvnw
-├── mvnw.cmd
-├── pom.xml
-└── src
-    └── assembly
-        └── contracts.xml

As you can see under the slash-delimited groupid / artifact id folder (com/example/server) you have -expectations of the 3 consumers (client1, client2 and client3). Expectations are the standard Groovy DSL -contract files as described throughout this documentation. This repository has to produce a JAR file that maps -one to one to the contents of the repo.

Example of a pom.xml inside the server folder.

<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xmlns="http://maven.apache.org/POM/4.0.0"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<groupId>com.example</groupId>
-	<artifactId>server</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
-
-	<name>Server Stubs</name>
-	<description>POM used to install locally stubs for consumer side</description>
-
-	<parent>
-		<groupId>org.springframework.boot</groupId>
-		<artifactId>spring-boot-starter-parent</artifactId>
-		<version>2.1.3.RELEASE</version>
-		<relativePath/>
-	</parent>
-
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<java.version>1.8</java.version>
-		<spring-cloud-contract.version>2.1.2.BUILD-SNAPSHOT</spring-cloud-contract.version>
-		<spring-cloud-release.version>Greenwich.BUILD-SNAPSHOT
-		</spring-cloud-release.version>
-		<excludeBuildFolders>true</excludeBuildFolders>
-	</properties>
-
-	<dependencyManagement>
-		<dependencies>
-			<dependency>
-				<groupId>org.springframework.cloud</groupId>
-				<artifactId>spring-cloud-dependencies</artifactId>
-				<version>${spring-cloud-release.version}</version>
-				<type>pom</type>
-				<scope>import</scope>
-			</dependency>
-		</dependencies>
-	</dependencyManagement>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.springframework.cloud</groupId>
-				<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-				<version>${spring-cloud-contract.version}</version>
-				<extensions>true</extensions>
-				<configuration>
-					<!-- By default it would search under src/test/resources/ -->
-					<contractsDirectory>${project.basedir}</contractsDirectory>
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
-
-	<repositories>
-		<repository>
-			<id>spring-snapshots</id>
-			<name>Spring Snapshots</name>
-			<url>https://repo.spring.io/snapshot</url>
-			<snapshots>
-				<enabled>true</enabled>
-			</snapshots>
-		</repository>
-		<repository>
-			<id>spring-milestones</id>
-			<name>Spring Milestones</name>
-			<url>https://repo.spring.io/milestone</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</repository>
-		<repository>
-			<id>spring-releases</id>
-			<name>Spring Releases</name>
-			<url>https://repo.spring.io/release</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</repository>
-	</repositories>
-	<pluginRepositories>
-		<pluginRepository>
-			<id>spring-snapshots</id>
-			<name>Spring Snapshots</name>
-			<url>https://repo.spring.io/snapshot</url>
-			<snapshots>
-				<enabled>true</enabled>
-			</snapshots>
-		</pluginRepository>
-		<pluginRepository>
-			<id>spring-milestones</id>
-			<name>Spring Milestones</name>
-			<url>https://repo.spring.io/milestone</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</pluginRepository>
-		<pluginRepository>
-			<id>spring-releases</id>
-			<name>Spring Releases</name>
-			<url>https://repo.spring.io/release</url>
-			<snapshots>
-				<enabled>false</enabled>
-			</snapshots>
-		</pluginRepository>
-	</pluginRepositories>
-
-</project>

As you can see there are no dependencies other than the Spring Cloud Contract Maven Plugin. -Those poms are necessary for the consumer side to run mvn clean install -DskipTests to locally install - stubs of the producer project.

The pom.xml in the root folder can look like this:

<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		 xmlns="http://maven.apache.org/POM/4.0.0"
-		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-
-	<groupId>com.example.standalone</groupId>
-	<artifactId>contracts</artifactId>
-	<version>0.0.1-SNAPSHOT</version>
-
-	<name>Contracts</name>
-	<description>Contains all the Spring Cloud Contracts, well, contracts. JAR used by the
-		producers to generate tests and stubs
-	</description>
-
-	<properties>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-	</properties>
-
-	<build>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-assembly-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>contracts</id>
-						<phase>prepare-package</phase>
-						<goals>
-							<goal>single</goal>
-						</goals>
-						<configuration>
-							<attach>true</attach>
-							<descriptor>${basedir}/src/assembly/contracts.xml</descriptor>
-							<!-- If you want an explicit classifier remove the following line -->
-							<appendAssemblyId>false</appendAssemblyId>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-
-</project>

It’s using the assembly plugin in order to build the JAR with all the contracts. Example of such setup is here:

<assembly xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		  xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-		  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>project</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>${project.basedir}</directory>
-			<outputDirectory>/</outputDirectory>
-			<useDefaultExcludes>true</useDefaultExcludes>
-			<excludes>
-				<exclude>**/${project.build.directory}/**</exclude>
-				<exclude>mvnw</exclude>
-				<exclude>mvnw.cmd</exclude>
-				<exclude>.mvn/**</exclude>
-				<exclude>src/**</exclude>
-			</excludes>
-		</fileSet>
-	</fileSets>
-</assembly>

3.5.2 Workflow

The workflow would look similar to the one presented in the Step by step guide to CDC. The only difference - is that the producer doesn’t own the contracts anymore. So the consumer and the producer have to work on - common contracts in a common repository.

3.5.3 Consumer

When the consumer wants to work on the contracts offline, instead of cloning the producer code, the -consumer team clones the common repository, goes to the required producer’s folder (e.g. com/example/server) -and runs mvn clean install -DskipTests to install locally the stubs converted from the contracts.

[Tip]Tip

You need to have Maven installed locally

3.5.4 Producer

As a producer it’s enough to alter the Spring Cloud Contract Verifier to provide the URL and the dependency -of the JAR containing the contracts:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<contractsMode>REMOTE</contractsMode>
-		<contractsRepositoryUrl>
-			http://link/to/your/nexus/or/artifactory/or/sth
-		</contractsRepositoryUrl>
-		<contractDependency>
-			<groupId>com.example.standalone</groupId>
-			<artifactId>contracts</artifactId>
-		</contractDependency>
-	</configuration>
-</plugin>

With this setup the JAR with groupid com.example.standalone and artifactid contracts will be downloaded -from http://link/to/your/nexus/or/artifactory/or/sth. It will be then unpacked in a local temporary folder -and contracts present under the com/example/server will be picked as the ones used to generate the -tests and the stubs. Due to this convention the producer team will know which consumer teams will be broken -when some incompatible changes are done.

The rest of the flow looks the same.

3.5.5 How can I define messaging contracts per topic not per producer?

To avoid messaging contracts duplication in the common repo, when few producers writing messages to one topic, -we could create the structure when the rest contracts would be placed in a folder per producer and messaging -contracts in the folder per topic.

For Maven Project

To make it possible to work on the producer side we should specify an inclusion pattern for -filtering common repository jar by messaging topics we are interested in. includedFiles property of Maven Spring Cloud Contract plugin -allows us to do that. Also contractsPath need to be specified since the default path would be the common repository groupid/artifactid.

<plugin>
-   <groupId>org.springframework.cloud</groupId>
-   <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-   <version>${spring-cloud-contract.version}</version>
-   <configuration>
-      <contractsMode>REMOTE</contractsMode>
-      <contractsRepositoryUrl>http://link/to/your/nexus/or/artifactory/or/sth</contractsRepositoryUrl>
-      <contractDependency>
-         <groupId>com.example</groupId>
-         <artifactId>common-repo-with-contracts</artifactId>
-         <version>+</version>
-      </contractDependency>
-      <contractsPath>/</contractsPath>
-      <baseClassMappings>
-         <baseClassMapping>
-            <contractPackageRegex>.*messaging.*</contractPackageRegex>
-            <baseClassFQN>com.example.services.MessagingBase</baseClassFQN>
-         </baseClassMapping>
-         <baseClassMapping>
-            <contractPackageRegex>.*rest.*</contractPackageRegex>
-            <baseClassFQN>com.example.services.TestBase</baseClassFQN>
-         </baseClassMapping>
-      </baseClassMappings>
-      <includedFiles>
-         <includedFile>**/${project.artifactId}/**</includedFile>
-         <includedFile>**/${first-topic}/**</includedFile>
-         <includedFile>**/${second-topic}/**</includedFile>
-      </includedFiles>
-   </configuration>
-</plugin>

For Gradle Project

  • Add a custom configuration for the common-repo dependency:
ext {
-    conractsGroupId = "com.example"
-    contractsArtifactId = "common-repo"
-    contractsVersion = "1.2.3"
-}
-
-configurations {
-    contracts {
-        transitive = false
-    }
-}
  • Add the common-repo dependency to your classpath:
dependencies {
-    contracts "${conractsGroupId}:${contractsArtifactId}:${contractsVersion}"
-    testCompile "${conractsGroupId}:${contractsArtifactId}:${contractsVersion}"
-}
  • Download the dependency to an appropriate folder:
task getContracts(type: Copy) {
-    from configurations.contracts
-    into new File(project.buildDir, "downloadedContracts")
-}
  • Unzip JAR:
task unzipContracts(type: Copy) {
-    def zipFile = new File(project.buildDir, "downloadedContracts/${contractsArtifactId}-${contractsVersion}.jar")
-    def outputDir = file("${buildDir}/unpackedContracts")
-
-    from zipTree(zipFile)
-    into outputDir
-}
  • Cleanup unused contracts:
task deleteUnwantedContracts(type: Delete) {
-    delete fileTree(dir: "${buildDir}/unpackedContracts",
-        include: "**/*",
-        excludes: [
-            "**/${project.name}/**"",
-            "**/${first-topic}/**",
-            "**/${second-topic}/**"])
-}
  • Create task dependencies:
unzipContracts.dependsOn("getContracts")
-deleteUnwantedContracts.dependsOn("unzipContracts")
-build.dependsOn("deleteUnwantedContracts")
  • Configure plugin by specifying the directory containing contracts using contractsDslDir property
contracts {
-    contractsDslDir = new File("${buildDir}/unpackedContracts")
-}

3.6 Do I need a Binary Storage? Can’t I use Git?

In the polyglot world, there are languages that don’t use binary storages like -Artifactory or Nexus. Starting from Spring Cloud Contract version 2.0.0 we provide -mechanisms to store contracts and stubs in a SCM repository. Currently the -only supported SCM is Git.

The repository would have to the following setup -(which you can checkout here):

.
-└── META-INF
-    └── com.example
-        └── beer-api-producer-git
-            └── 0.0.1-SNAPSHOT
-                ├── contracts
-                │   └── beer-api-consumer
-                │       ├── messaging
-                │       │   ├── shouldSendAcceptedVerification.groovy
-                │       │   └── shouldSendRejectedVerification.groovy
-                │       └── rest
-                │           ├── shouldGrantABeerIfOldEnough.groovy
-                │           └── shouldRejectABeerIfTooYoung.groovy
-                └── mappings
-                    └── beer-api-consumer
-                        └── rest
-                            ├── shouldGrantABeerIfOldEnough.json
-                            └── shouldRejectABeerIfTooYoung.json

Under META-INF folder:

  • we group applications via groupId (e.g. com.example)
  • then each application is represented via the artifactId (e.g. beer-api-producer-git)
  • next, the version of the application (e.g. 0.0.1-SNAPSHOT). Starting from Spring Cloud Contract version 2.1.0, you can specify the versions as follows (assuming that your versions follow the semantic versioning)

    • + or latest - to find the latest version of your stubs (assuming that the snapshots are always the latest artifact for a given revision number). That means:

      • if you have a version 1.0.0.RELEASE, 2.0.0.BUILD-SNAPSHOT and 2.0.0.RELEASE we will assume that the latest is 2.0.0.BUILD-SNAPSHOT
      • if you have a version 1.0.0.RELEASE and 2.0.0.RELEASE we will assume that the latest is 2.0.0.RELEASE
      • if you have a version called latest or + we will pick that folder
    • release - to find the latest release version of your stubs. That means:

      • if you have a version 1.0.0.RELEASE, 2.0.0.BUILD-SNAPSHOT and 2.0.0.RELEASE we will assume that the latest is 2.0.0.RELEASE
      • if you have a version called release we will pick that folder
  • finally, there are two folders:

    • contracts - the good practice is to store the contracts required by each -consumer in the folder with the consumer name (e.g. beer-api-consumer). That way you -can use the stubs-per-consumer feature. Further directory structure is arbitrary.
    • mappings - in this folder the Maven / Gradle Spring Cloud Contract plugins will push -the stub server mappings. On the consumer side, Stub Runner will scan this folder -to start stub servers with stub definitions. The folder structure will be a copy -of the one created in the contracts subfolder.

3.6.1 Protocol convention

In order to control the type and location of the source of contracts (whether it’s -a binary storage or an SCM repository), you can use the protocol in the URL of -the repository. Spring Cloud Contract iterates over registered protocol resolvers -and tries to fetch the contracts (via a plugin) or stubs (via Stub Runner).

For the SCM functionality, currently, we support the Git repository. To use it, -in the property, where the repository URL needs to be placed you just have to prefix -the connection URL with git://. Here you can find a couple of examples:

git://file:///foo/bar
-git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git
-git://git@github.com:spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git

3.6.2 Producer

For the producer, to use the SCM approach, we can reuse the -same mechanism we use for external contracts. We route Spring Cloud Contract -to use the SCM implementation via the URL that contains -the git:// protocol.

[Important]Important

You have to manually add the pushStubsToScm -goal in Maven or execute (bind) the pushStubsToScm task in -Gradle. We don’t push stubs to origin of your git -repository out of the box.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <!-- Base class mappings etc. -->
-
-        <!-- We want to pick contracts from a Git repository -->
-        <contractsRepositoryUrl>git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git</contractsRepositoryUrl>
-
-        <!-- We reuse the contract dependency section to set up the path
-        to the folder that contains the contract definitions. In our case the
-        path will be /groupId/artifactId/version/contracts -->
-        <contractDependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>${project.artifactId}</artifactId>
-            <version>${project.version}</version>
-        </contractDependency>
-
-        <!-- The contracts mode can't be classpath -->
-        <contractsMode>REMOTE</contractsMode>
-    </configuration>
-    <executions>
-        <execution>
-            <phase>package</phase>
-            <goals>
-                <!-- By default we will not push the stubs back to SCM,
-                you have to explicitly add it as a goal -->
-                <goal>pushStubsToScm</goal>
-            </goals>
-        </execution>
-    </executions>
-</plugin>

-

Gradle.  -

contracts {
-	// We want to pick contracts from a Git repository
-	contractDependency {
-		stringNotation = "${project.group}:${project.name}:${project.version}"
-	}
-	/*
-	We reuse the contract dependency section to set up the path
-	to the folder that contains the contract definitions. In our case the
-	path will be /groupId/artifactId/version/contracts
-	 */
-	contractRepository {
-		repositoryUrl = "git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git"
-	}
-	// The mode can't be classpath
-	contractsMode = "REMOTE"
-	// Base class mappings etc.
-}
-
-/*
-In this scenario we want to publish stubs to SCM whenever
-the `publish` task is executed
-*/
-publish.dependsOn("publishStubsToScm")

-

With such a setup:

  • Git project will be cloned to a temporary directory
  • The SCM stub downloader will go to META-INF/groupId/artifactId/version/contracts folder -to find contracts. E.g. for com.example:foo:1.0.0 the path would be -META-INF/com.example/foo/1.0.0/contracts
  • Tests will be generated from the contracts
  • Stubs will be created from the contracts
  • Once the tests pass, the stubs will be committed in the cloned repository
  • Finally, a push will be done to that repo’s origin

3.6.3 Producer with contracts stored locally

Another option to use the SCM as the destination for stubs and contracts is to store the contracts locally, with the producer, and only push the contracts and the stubs to SCM. Below, you can find the setup required to achieve this using Maven and Gradle.

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<!-- In the default configuration, we want to use the contracts stored locally -->
-	<configuration>
-		<baseClassMappings>
-			<baseClassMapping>
-				<contractPackageRegex>.*messaging.*</contractPackageRegex>
-				<baseClassFQN>com.example.BeerMessagingBase</baseClassFQN>
-			</baseClassMapping>
-			<baseClassMapping>
-				<contractPackageRegex>.*rest.*</contractPackageRegex>
-				<baseClassFQN>com.example.BeerRestBase</baseClassFQN>
-			</baseClassMapping>
-		</baseClassMappings>
-		<basePackageForTests>com.example</basePackageForTests>
-	</configuration>
-	<executions>
-		<execution>
-			<phase>package</phase>
-			<goals>
-				<!-- By default we will not push the stubs back to SCM,
-				you have to explicitly add it as a goal -->
-				<goal>pushStubsToScm</goal>
-			</goals>
-			<configuration>
-				<!-- We want to pick contracts from a Git repository -->
-				<contractsRepositoryUrl>git://file://${env.ROOT}/target/contract_empty_git/
-				</contractsRepositoryUrl>
-				<!-- Example of URL via git protocol -->
-				<!--<contractsRepositoryUrl>git://git@github.com:spring-cloud-samples/spring-cloud-contract-samples.git</contractsRepositoryUrl>-->
-				<!-- Example of URL via http protocol -->
-				<!--<contractsRepositoryUrl>git://https://github.com/spring-cloud-samples/spring-cloud-contract-samples.git</contractsRepositoryUrl>-->
-				<!-- We reuse the contract dependency section to set up the path
-				to the folder that contains the contract definitions. In our case the
-				path will be /groupId/artifactId/version/contracts -->
-				<contractDependency>
-					<groupId>${project.groupId}</groupId>
-					<artifactId>${project.artifactId}</artifactId>
-					<version>${project.version}</version>
-				</contractDependency>
-				<!-- The mode can't be classpath -->
-				<contractsMode>LOCAL</contractsMode>
-			</configuration>
-		</execution>
-	</executions>
-</plugin>

-

Gradle.  -

contracts {
-		// Base package for generated tests
-	basePackageForTests = "com.example"
-	baseClassMappings {
-		baseClassMapping(".*messaging.*", "com.example.BeerMessagingBase")
-		baseClassMapping(".*rest.*", "com.example.BeerRestBase")
-	}
-}
-
-/*
-In this scenario we want to publish stubs to SCM whenever
-the `publish` task is executed
-*/
-publishStubsToScm {
-	// We want to modify the default set up of the plugin when publish stubs to scm is called
-	customize {
-		// We want to pick contracts from a Git repository
-		contractDependency {
-			stringNotation = "${project.group}:${project.name}:${project.version}"
-		}
-		/*
-		We reuse the contract dependency section to set up the path
-		to the folder that contains the contract definitions. In our case the
-		path will be /groupId/artifactId/version/contracts
-		 */
-		contractRepository {
-			repositoryUrl = "git://file://${System.getenv("ROOT")}/target/contract_empty_git/"
-		}
-		// The mode can't be classpath
-		contractsMode = "LOCAL"
-	}
-}
-
-publish.dependsOn("publishStubsToScm")
-publishToMavenLocal.dependsOn("publishStubsToScm")

-

With such a setup:

  • Contracts from the default src/test/resources/contracts directory will be picked
  • Tests will be generated from the contracts
  • Stubs will be created from the contracts
  • Once the tests pass

    • Git project will be cloned to a temporary directory
    • The stubs and contracts will be committed in the cloned repository
  • Finally, a push will be done to that repo’s origin

Keeping contracts with the producer and stubs in an external repository

It is also possible to keep the contracts in the producer repository, but keep the stubs in an external git repo. -This is most useful when you want to use the base consumer-producer collaboration flow, but do not have a possibility to -use an artifact repository for storing the stubs.

In order to do that, use the usual producer setup, and then add the pushStubsToScm goal and set -contractsRepositoryUrl to the repository where you want to keep the stubs.

3.6.4 Consumer

On the consumer side when passing the repositoryRoot parameter, -either from the @AutoConfigureStubRunner annotation, the -JUnit rule, JUnit 5 extension or properties, it’s enough to pass the URL of the -SCM repository, prefixed with the protocol. For example

@AutoConfigureStubRunner(
-    stubsMode="REMOTE",
-    repositoryRoot="git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git",
-    ids="com.example:bookstore:0.0.1.RELEASE"
-)

With such a setup:

  • Git project will be cloned to a temporary directory
  • The SCM stub downloader will go to META-INF/groupId/artifactId/version/ folder -to find stub definitions and contracts. E.g. for com.example:foo:1.0.0 the path would be -META-INF/com.example/foo/1.0.0/
  • Stub servers will be started and fed with mappings
  • Messaging definitions will be read and used in the messaging tests

3.7 Can I use the Pact Broker?

When using Pact you can use the Pact Broker -to store and share Pact definitions. Starting from Spring Cloud Contract -2.0.0 one can fetch Pact files from the Pact Broker to generate -tests and stubs.

As a prerequisite the Pact Converter and Pact Stub Downloader -are required. You have to add them via the spring-cloud-contract-pact dependency. -You can read more about it in the Section 10.1.1, “Pact Converter” section.

[Important]Important

Pact follows the Consumer Contract convention. That means -that the Consumer creates the Pact definitions first, then -shares the files with the Producer. Those expectations are generated -from the Consumer’s code and can break the Producer if the expectations -are not met.

3.7.1 Pact Consumer

The consumer uses Pact framework to generate Pact files. The -Pact files are sent to the Pact Broker. An example of such -setup can be found here.

3.7.2 Producer

For the producer, to use the Pact files from the Pact Broker, we can reuse the -same mechanism we use for external contracts. We route Spring Cloud Contract -to use the Pact implementation via the URL that contains -the pact:// protocol. It’s enough to pass the URL to the -Pact Broker. An example of such setup can be found here.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <!-- Base class mappings etc. -->
-
-        <!-- We want to pick contracts from a Git repository -->
-        <contractsRepositoryUrl>pact://http://localhost:8085</contractsRepositoryUrl>
-
-        <!-- We reuse the contract dependency section to set up the path
-        to the folder that contains the contract definitions. In our case the
-        path will be /groupId/artifactId/version/contracts -->
-        <contractDependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>${project.artifactId}</artifactId>
-            <!-- When + is passed, a latest tag will be applied when fetching pacts -->
-            <version>+</version>
-        </contractDependency>
-
-        <!-- The contracts mode can't be classpath -->
-        <contractsMode>REMOTE</contractsMode>
-    </configuration>
-    <!-- Don't forget to add spring-cloud-contract-pact to the classpath! -->
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-contract-pact</artifactId>
-            <version>${spring-cloud-contract.version}</version>
-        </dependency>
-    </dependencies>
-</plugin>

-

Gradle.  -

buildscript {
-	repositories {
-		//...
-	}
-
-	dependencies {
-		// ...
-		// Don't forget to add spring-cloud-contract-pact to the classpath!
-		classpath "org.springframework.cloud:spring-cloud-contract-pact:${contractVersion}"
-	}
-}
-
-contracts {
-	// When + is passed, a latest tag will be applied when fetching pacts
-	contractDependency {
-		stringNotation = "${project.group}:${project.name}:+"
-	}
-	contractRepository {
-		repositoryUrl = "pact://http://localhost:8085"
-	}
-	// The mode can't be classpath
-	contractsMode = "REMOTE"
-	// Base class mappings etc.
-}

-

With such a setup:

  • Pact files will be downloaded from the Pact Broker
  • Spring Cloud Contract will convert the Pact files into tests and stubs
  • The JAR with the stubs gets automatically created as usual

3.7.3 Pact Consumer (Producer Contract approach)

In the scenario where you don’t want to do Consumer Contract approach -(for every single consumer define the expectations) but you’d prefer -to do Producer Contracts (the producer provides the contracts and -publishes stubs), it’s enough to use Spring Cloud Contract with -Stub Runner option. An example of such setup can be found here.

First, remember to add Stub Runner and Spring Cloud Contract Pact module -as test dependencies.

Maven.  -

<dependencyManagement>
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-dependencies</artifactId>
-            <version>${spring-cloud.version}</version>
-            <type>pom</type>
-            <scope>import</scope>
-        </dependency>
-    </dependencies>
-</dependencyManagement>
-
-<!-- Don't forget to add spring-cloud-contract-pact to the classpath! -->
-<dependencies>
-    <!-- ... -->
-    <dependency>
-        <groupId>org.springframework.cloud</groupId>
-        <artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-        <scope>test</scope>
-    </dependency>
-    <dependency>
-        <groupId>org.springframework.cloud</groupId>
-        <artifactId>spring-cloud-contract-pact</artifactId>
-        <scope>test</scope>
-    </dependency>
-</dependencies>

-

Gradle.  -

dependencyManagement {
-    imports {
-        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
-    }
-}
-
-dependencies {
-    //...
-    testCompile("org.springframework.cloud:spring-cloud-starter-contract-stub-runner")
-    // Don't forget to add spring-cloud-contract-pact to the classpath!
-    testCompile("org.springframework.cloud:spring-cloud-contract-pact")
-}

-

Next, just pass the URL of the Pact Broker to repositoryRoot, prefixed -with pact:// protocol. E.g. pact://http://localhost:8085

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureStubRunner(stubsMode = StubRunnerProperties.StubsMode.REMOTE,
-		ids = "com.example:beer-api-producer-pact",
-		repositoryRoot = "pact://http://localhost:8085")
-public class BeerControllerTest {
-    //Inject the port of the running stub
-    @StubRunnerPort("beer-api-producer-pact") int producerPort;
-    //...
-}

With such a setup:

  • Pact files will be downloaded from the Pact Broker
  • Spring Cloud Contract will convert the Pact files into stub definitions
  • The stub servers will be started and fed with stubs

For more information about Pact support you can go to -the Section 10.7, “Using the Pact Stub Downloader” section.

3.8 How can I debug the request/response being sent by the generated tests client?

The generated tests all boil down to RestAssured in some form or fashion which relies on Apache HttpClient. HttpClient has a facility called wire logging which logs the entire request and response to HttpClient. Spring Boot has a logging common application property for doing this sort of thing, just add this to your application properties

logging.level.org.apache.http.wire=DEBUG

3.8.1 How can I debug the mapping/request/response being sent by WireMock?

Starting from version 1.2.0 we turn on WireMock logging to -info and the WireMock notifier to being verbose. Now you will -exactly know what request was received by WireMock server and which -matching response definition was picked.

To turn off this feature just bump WireMock logging to ERROR

logging.level.com.github.tomakehurst.wiremock=ERROR

3.8.2 How can I see what got registered in the HTTP server stub?

You can use the mappingsOutputFolder property on @AutoConfigureStubRunner, StubRunnerRule or -`StubRunnerExtension`to dump all mappings per artifact id. Also the port at which the given stub server -was started will be attached.

3.8.3 Can I reference text from file?

Yes! With version 1.2.0 we’ve added such a possibility. It’s enough to call file(…​) method in the -DSL and provide a path relative to where the contract lays. -If you’re using YAML just use the bodyFromFile property.

4. Spring Cloud Contract Verifier Setup

You can set up Spring Cloud Contract Verifier in the following ways:

4.1 Gradle Project

To learn how to set up the Gradle project for Spring Cloud Contract Verifier, read the -following sections:

4.1.1 Prerequisites

In order to use Spring Cloud Contract Verifier with WireMock, you muse use either a -Gradle or a Maven plugin.

[Warning]Warning

If you want to use Spock in your projects, you must add separately the -spock-core and spock-spring modules. Check Spock -docs for more information

4.1.2 Add Gradle Plugin with Dependencies

To add a Gradle plugin with dependencies, use code similar to this:

buildscript {
-	repositories {
-		mavenCentral()
-	}
-	dependencies {
-	    classpath "org.springframework.boot:spring-boot-gradle-plugin:${springboot_version}"
-		classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${verifier_version}"
-	}
-}
-
-apply plugin: 'groovy'
-apply plugin: 'spring-cloud-contract'
-
-dependencyManagement {
-	imports {
-		mavenBom "org.springframework.cloud:spring-cloud-contract-dependencies:${verifier_version}"
-	}
-}
-
-dependencies {
-	testCompile 'org.codehaus.groovy:groovy-all:2.4.6'
-	// example with adding Spock core and Spock Spring
-	testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
-	testCompile 'org.spockframework:spock-spring:1.0-groovy-2.4'
-	testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
-}

4.1.3 Gradle and Rest Assured 2.0

By default, Rest Assured 3.x is added to the classpath. However, to use Rest Assured 2.x -you can add it to the plugins classpath, as shown here:

buildscript {
-	repositories {
-		mavenCentral()
-	}
-	dependencies {
-	    classpath "org.springframework.boot:spring-boot-gradle-plugin:${springboot_version}"
-		classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${verifier_version}"
-		classpath "com.jayway.restassured:rest-assured:2.5.0"
-		classpath "com.jayway.restassured:spring-mock-mvc:2.5.0"
-	}
-}
-
-depenendencies {
-    // all dependencies
-    // you can exclude rest-assured from spring-cloud-contract-verifier
-    testCompile "com.jayway.restassured:rest-assured:2.5.0"
-    testCompile "com.jayway.restassured:spring-mock-mvc:2.5.0"
-}

That way, the plugin automatically sees that Rest Assured 2.x is present on the classpath -and modifies the imports accordingly.

4.1.4 Snapshot Versions for Gradle

Add the additional snapshot repository to your build.gradle to use snapshot versions, -which are automatically uploaded after every successful build, as shown here:

buildscript {
-	repositories {
-		mavenCentral()
-		mavenLocal()
-		maven { url "https://repo.spring.io/snapshot" }
-		maven { url "https://repo.spring.io/milestone" }
-		maven { url "https://repo.spring.io/release" }
-	}
-}

4.1.5 Add stubs

By default, Spring Cloud Contract Verifier is looking for stubs in the -src/test/resources/contracts directory.

The directory containing stub definitions is treated as a class name, and each stub -definition is treated as a single test. Spring Cloud Contract Verifier assumes that it -contains at least one level of directories that are to be used as the test class name. -If more than one level of nested directories is present, all except the last one is used -as the package name. For example, with following structure:

src/test/resources/contracts/myservice/shouldCreateUser.groovy
-src/test/resources/contracts/myservice/shouldReturnUser.groovy

Spring Cloud Contract Verifier creates a test class named defaultBasePackage.MyService -with two methods:

  • shouldCreateUser()
  • shouldReturnUser()

4.1.6 Run the Plugin

The plugin registers itself to be invoked before a check task. If you want it to be -part of your build process, you need to do nothing more. If you just want to generate -tests, invoke the generateContractTests task.

4.1.7 Default Setup

The default Gradle Plugin setup creates the following Gradle part of the build (in -pseudocode):

contracts {
-    testFramework ='JUNIT'
-    testMode = 'MockMvc'
-    generatedTestSourcesDir = project.file("${project.buildDir}/generated-test-sources/contracts")
-    generatedTestResourcesDir = project.file("${project.buildDir}/generated-test-resources/contracts")
-    contractsDslDir = "${project.rootDir}/src/test/resources/contracts"
-    basePackageForTests = 'org.springframework.cloud.verifier.tests'
-    stubsOutputDir = project.file("${project.buildDir}/stubs")
-
-    // the following properties are used when you want to provide where the JAR with contract lays
-    contractDependency {
-        stringNotation = ''
-    }
-    contractsPath = ''
-    contractsWorkOffline = false
-    contractRepository {
-        cacheDownloadedContracts(true)
-    }
-}
-
-tasks.create(type: Jar, name: 'verifierStubsJar', dependsOn: 'generateClientStubs') {
-    baseName = project.name
-    classifier = contracts.stubsSuffix
-    from contractVerifier.stubsOutputDir
-}
-
-project.artifacts {
-    archives task
-}
-
-tasks.create(type: Copy, name: 'copyContracts') {
-    from contracts.contractsDslDir
-    into contracts.stubsOutputDir
-}
-
-verifierStubsJar.dependsOn 'copyContracts'
-
-publishing {
-    publications {
-        stubs(MavenPublication) {
-            artifactId project.name
-            artifact verifierStubsJar
-        }
-    }
-}

4.1.8 Configure Plugin

To change the default configuration, add a contracts snippet to your Gradle config, as -shown here:

contracts {
-	testMode = 'MockMvc'
-	baseClassForTests = 'org.mycompany.tests'
-	generatedTestSourcesDir = project.file('src/generatedContract')
-}

4.1.9 Configuration Options

  • testMode: Defines the mode for acceptance tests. By default, the mode is MockMvc, -which is based on Spring’s MockMvc. It can also be changed to WebTestClient, JaxRsClient or to -Explicit for real HTTP calls.
  • imports: Creates an array with imports that should be included in generated tests -(for example ['org.myorg.Matchers']). By default, it creates an empty array.
  • staticImports: Creates an array with static imports that should be included in -generated tests(for example ['org.myorg.Matchers.*']). By default, it creates an empty -array.
  • basePackageForTests: Specifies the base package for all generated tests. If not set, -the value is picked from baseClassForTests’s package and from `packageWithBaseClasses. -If neither of these values are set, then the value is set to -org.springframework.cloud.contract.verifier.tests.
  • baseClassForTests: Creates a base class for all generated tests. By default, if you -use Spock classes, the class is spock.lang.Specification.
  • packageWithBaseClasses: Defines a package where all the base classes reside. This -setting takes precedence over baseClassForTests.
  • baseClassMappings: Explicitly maps a contract package to a FQN of a base class. This -setting takes precedence over packageWithBaseClasses and baseClassForTests.
  • ruleClassForTests: Specifies a rule that should be added to the generated test -classes.
  • ignoredFiles: Uses an Antmatcher to allow defining stub files for which processing -should be skipped. By default, it is an empty array.
  • contractsDslDir: Specifies the directory containing contracts written using the -GroovyDSL. By default, its value is $rootDir/src/test/resources/contracts.
  • generatedTestSourcesDir: Specifies the test source directory where tests generated -from the Groovy DSL should be placed. By default its value is -$buildDir/generated-test-sources/contracts.
  • generatedTestResourcesDir: Specifies the test resource directory where resources used by the tests generated -from the Groovy DSL should be placed. By default its value is -$buildDir/generated-test-resources/contracts.
  • stubsOutputDir: Specifies the directory where the generated WireMock stubs from -the Groovy DSL should be placed.
  • testFramework: Specifies the target test framework to be used. Currently, Spock, JUnit 4 (TestFramework.JUNIT) and -JUnit 5 are supported with JUnit 4 being the default framework.
  • contractsProperties: a map containing properties to be passed to Spring Cloud Contract -components. Those properties might be used by e.g. inbuilt or custom Stub Downloaders.

The following properties are used when you want to specify the location of the JAR -containing the contracts:

  • contractDependency: Specifies the Dependency that provides -groupid:artifactid:version:classifier coordinates. You can use the contractDependency -closure to set it up.
  • contractsPath: Specifies the path to the jar. If contract dependencies are -downloaded, the path defaults to groupid/artifactid where groupid is slash -separated. Otherwise, it scans contracts under the provided directory.
  • contractsMode: Specifies the mode of downloading contracts (whether the -JAR is available offline, remotely etc.)
  • deleteStubsAfterTest: If set to false will not remove any downloaded -contracts from temporary directories

Below you can find a list of experimental features you can turn on via the plugin:

  • convertToYaml: converts all DSLs to the declarative, YAML format. This can be extremely useful when you’re using external libraries in your Groovy DSLs. By turning this feature on (by setting it to true) you will not need to add the library dependency on the consumer side.
  • assertJsonSize: You can check the size of JSON arrays in the generated tests. This feature is disabled by default.

4.1.10 Single Base Class for All Tests

When using Spring Cloud Contract Verifier in default MockMvc, you need to create a base -specification for all generated acceptance tests. In this class, you need to point to an -endpoint, which should be verified.

abstract class BaseMockMvcSpec extends Specification {
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new PairIdController())
-	}
-
-	void isProperCorrelationId(Integer correlationId) {
-		assert correlationId == 123456
-	}
-
-	void isEmpty(String value) {
-		assert value == null
-	}
-
-}

If you use Explicit mode, you can use a base class to initialize the whole tested app -as you might see in regular integration tests. If you use the JAXRSCLIENT mode, this -base class should also contain a protected WebTarget webTarget field. Right now, the -only option to test the JAX-RS API is to start a web server.

4.1.11 Different Base Classes for Contracts

If your base classes differ between contracts, you can tell the Spring Cloud Contract -plugin which class should get extended by the autogenerated tests. You have two options:

  • Follow a convention by providing the packageWithBaseClasses
  • Provide explicit mapping via baseClassMappings

By Convention

The convention is such that if you have a contract under (for example) -src/test/resources/contract/foo/bar/baz/ and set the value of the -packageWithBaseClasses property to com.example.base, then Spring Cloud Contract -Verifier assumes that there is a BarBazBase class under the com.example.base package. -In other words, the system takes the last two parts of the package, if they exist, and -forms a class with a Base suffix. This rule takes precedence over baseClassForTests. -Here is an example of how it works in the contracts closure:

packageWithBaseClasses = 'com.example.base'

By Mapping

You can manually map a regular expression of the contract’s package to fully qualified -name of the base class for the matched contract. You have to provide a list called -baseClassMappings that consists baseClassMapping objects that takes a -contractPackageRegex to baseClassFQN mapping. Consider the following example:

baseClassForTests = "com.example.FooBase"
-baseClassMappings {
-	baseClassMapping('.*/com/.*', 'com.example.ComBase')
-	baseClassMapping('.*/bar/.*': 'com.example.BarBase')
-}

Let’s assume that you have contracts under - - src/test/resources/contract/com/ - - src/test/resources/contract/foo/

By providing the baseClassForTests, we have a fallback in case mapping did not succeed. -(You could also provide the packageWithBaseClasses as a fallback.) That way, the tests -generated from src/test/resources/contract/com/ contracts extend the -com.example.ComBase, whereas the rest of the tests extend com.example.FooBase.

4.1.12 Invoking Generated Tests

To ensure that the provider side is compliant with defined contracts, you need to invoke:

./gradlew generateContractTests test

4.1.13 Pushing stubs to SCM

If you’re using the SCM repository to keep the contracts and -stubs, you might want to automate the step of pushing stubs to -the repository. To do that, it’s enough to call the pushStubsToScm -task. Example:

$ ./gradlew pushStubsToScm

Under Section 10.6, “Using the SCM Stub Downloader” you can find all possible -configuration options that you can pass either via -the contractsProperties field e.g. contracts { contractsProperties = [foo:"bar"] }, -via contractsProperties method e.g. contracts { contractsProperties([foo:"bar"]) }, -a system property or an environment variable.

4.1.14 Spring Cloud Contract Verifier on the Consumer Side

In a consuming service, you need to configure the Spring Cloud Contract Verifier plugin -in exactly the same way as in case of provider. If you do not want to use Stub Runner -then you need to copy contracts stored in src/test/resources/contracts and generate -WireMock JSON stubs using:

./gradlew generateClientStubs
[Note]Note

The stubsOutputDir option has to be set for stub generation to work.

When present, JSON stubs can be used in automated tests of consuming a service.

@ContextConfiguration(loader == SpringApplicationContextLoader, classes == Application)
-class LoanApplicationServiceSpec extends Specification {
-
- @ClassRule
- @Shared
- WireMockClassRule wireMockRule == new WireMockClassRule()
-
- @Autowired
- LoanApplicationService sut
-
- def 'should successfully apply for loan'() {
-   given:
- 	LoanApplication application =
-			new LoanApplication(client: new Client(clientPesel: '12345678901'), amount: 123.123)
-   when:
-	LoanApplicationResult loanApplication == sut.loanApplication(application)
-   then:
-	loanApplication.loanApplicationStatus == LoanApplicationStatus.LOAN_APPLIED
-	loanApplication.rejectionReason == null
- }
-}

LoanApplication makes a call to FraudDetection service. This request is handled by a -WireMock server configured with stubs generated by Spring Cloud Contract Verifier.

4.2 Maven Project

To learn how to set up the Maven project for Spring Cloud Contract Verifier, read the -following sections:

4.2.1 Add maven plugin

Add the Spring Cloud Contract BOM in a fashion similar to this:

<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>${spring-cloud-release.version}</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

Next, add the Spring Cloud Contract Verifier Maven plugin:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-		<convertToYaml>true</convertToYaml>
-	</configuration>
-</plugin>

You can read more in the -Spring -Cloud Contract Maven Plugin Documentation (example for 2.0.0.RELEASE version).

4.2.2 Maven and Rest Assured 2.0

By default, Rest Assured 3.x is added to the classpath. However, you can use Rest -Assured 2.x by adding it to the plugins classpath, as shown here:

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <packageWithBaseClasses>com.example</packageWithBaseClasses>
-    </configuration>
-    <dependencies>
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-contract-verifier</artifactId>
-            <version>${spring-cloud-contract.version}</version>
-        </dependency>
-        <dependency>
-           <groupId>com.jayway.restassured</groupId>
-           <artifactId>rest-assured</artifactId>
-           <version>2.5.0</version>
-           <scope>compile</scope>
-        </dependency>
-        <dependency>
-           <groupId>com.jayway.restassured</groupId>
-           <artifactId>spring-mock-mvc</artifactId>
-           <version>2.5.0</version>
-           <scope>compile</scope>
-        </dependency>
-    </dependencies>
-</plugin>
-
-<dependencies>
-    <!-- all dependencies -->
-    <!-- you can exclude rest-assured from spring-cloud-contract-verifier -->
-    <dependency>
-       <groupId>com.jayway.restassured</groupId>
-       <artifactId>rest-assured</artifactId>
-       <version>2.5.0</version>
-       <scope>test</scope>
-    </dependency>
-    <dependency>
-       <groupId>com.jayway.restassured</groupId>
-       <artifactId>spring-mock-mvc</artifactId>
-       <version>2.5.0</version>
-       <scope>test</scope>
-    </dependency>
-</dependencies>

That way, the plugin automatically sees that Rest Assured 3.x is present on the classpath -and modifies the imports accordingly.

4.2.3 Snapshot versions for Maven

For Snapshot and Milestone versions, you have to add the following section to your -pom.xml, as shown here:

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

4.2.4 Add stubs

By default, Spring Cloud Contract Verifier is looking for stubs in the -src/test/resources/contracts directory. The directory containing stub definitions is -treated as a class name, and each stub definition is treated as a single test. We assume -that it contains at least one directory to be used as test class name. If there is more -than one level of nested directories, all except the last one is used as package name. -For example, with following structure:

src/test/resources/contracts/myservice/shouldCreateUser.groovy
-src/test/resources/contracts/myservice/shouldReturnUser.groovy

Spring Cloud Contract Verifier creates a test class named defaultBasePackage.MyService -with two methods

  • shouldCreateUser()
  • shouldReturnUser()

4.2.5 Run plugin

The plugin goal generateTests is assigned to be invoked in the phase called -generate-test-sources. If you want it to be part of your build process, you need not do -anything. If you just want to generate tests, invoke the generateTests goal.

4.2.6 Configure plugin

To change the default configuration, just add a configuration section to the plugin -definition or the execution definition, as shown here:

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <executions>
-        <execution>
-            <goals>
-                <goal>convert</goal>
-                <goal>generateStubs</goal>
-                <goal>generateTests</goal>
-            </goals>
-        </execution>
-    </executions>
-    <configuration>
-        <basePackageForTests>org.springframework.cloud.verifier.twitter.place</basePackageForTests>
-        <baseClassForTests>org.springframework.cloud.verifier.twitter.place.BaseMockMvcSpec</baseClassForTests>
-    </configuration>
-</plugin>

4.2.7 Configuration Options

  • testMode: Defines the mode for acceptance tests. By default, the mode is MockMvc, -which is based on Spring’s MockMvc. It can also be changed to WebTestClient, JaxRsClient or to -Explicit for real HTTP calls.
  • basePackageForTests: Specifies the base package for all generated tests. If not set, -the value is picked from baseClassForTests’s package and from `packageWithBaseClasses. -If neither of these values are set, then the value is set to -org.springframework.cloud.contract.verifier.tests.
  • ruleClassForTests: Specifies a rule that should be added to the generated test -classes.
  • baseClassForTests: Creates a base class for all generated tests. By default, if you -use Spock classes, the class is spock.lang.Specification.
  • contractsDirectory: Specifies a directory containing contracts written with the -GroovyDSL. The default directory is /src/test/resources/contracts.
  • generatedTestSourcesDir: Specifies the test source directory where tests generated -from the Groovy DSL should be placed. By default its value is -$buildDir/generated-test-sources/contracts.
  • generatedTestResourcesDir: Specifies the test resource directory where resources used by the tests generated
  • testFramework: Specifies the target test framework to be used. Currently, Spock, JUnit 4 (TestFramework.JUNIT) and -JUnit 5 are supported with JUnit 4 being the default framework.
  • packageWithBaseClasses: Defines a package where all the base classes reside. This -setting takes precedence over baseClassForTests. The convention is such that, if you -have a contract under (for example) src/test/resources/contract/foo/bar/baz/ and set -the value of the packageWithBaseClasses property to com.example.base, then Spring -Cloud Contract Verifier assumes that there is a BarBazBase class under the -com.example.base package. In other words, the system takes the last two parts of the -package, if they exist, and forms a class with a Base suffix.
  • baseClassMappings: Specifies a list of base class mappings that provide -contractPackageRegex, which is checked against the package where the contract is -located, and baseClassFQN, which maps to the fully qualified name of the base class for -the matched contract. For example, if you have a contract under -src/test/resources/contract/foo/bar/baz/ and map the property -.* → com.example.base.BaseClass, then the test class generated from these contracts -extends com.example.base.BaseClass. This setting takes precedence over -packageWithBaseClasses and baseClassForTests.
  • contractsProperties: a map containing properties to be passed to Spring Cloud Contract -components. Those properties might be used by e.g. inbuilt or custom Stub Downloaders.

If you want to download your contract definitions from a Maven repository, you can use -the following options:

  • contractDependency: The contract dependency that contains all the packaged contracts.
  • contractsPath: The path to the concrete contracts in the JAR with packaged contracts. -Defaults to groupid/artifactid where gropuid is slash separated.
  • contractsMode: Picks the mode in which stubs will be found and registered
  • deleteStubsAfterTest: If set to false will not remove any downloaded -contracts from temporary directories
  • contractsRepositoryUrl: URL to a repo with the artifacts that have contracts. If it is not provided, -use the current Maven ones.
  • contractsRepositoryUsername: The user name to be used to connect to the repo with contracts.
  • contractsRepositoryPassword: The password to be used to connect to the repo with contracts.
  • contractsRepositoryProxyHost: The proxy host to be used to connect to the repo with contracts.
  • contractsRepositoryProxyPort: The proxy port to be used to connect to the repo with contracts.

We cache only non-snapshot, explicitly provided versions (for example -+ or 1.0.0.BUILD-SNAPSHOT won’t get cached). By default, this feature is turned on.

Below you can find a list of experimental features you can turn on via the plugin:

  • convertToYaml: converts all DSLs to the declarative, YAML format. This can be extremely useful when you’re using external libraries in your Groovy DSLs. By turning this feature on (by setting it to true) you will not need to add the library dependency on the consumer side.
  • assertJsonSize: You can check the size of JSON arrays in the generated tests. This feature is disabled by default.

4.2.8 Single Base Class for All Tests

When using Spring Cloud Contract Verifier in default MockMvc, you need to create a base -specification for all generated acceptance tests. In this class, you need to point to an -endpoint, which should be verified.

package org.mycompany.tests
-
-import org.mycompany.ExampleSpringController
-import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc
-import spock.lang.Specification
-
-class MvcSpec extends Specification {
-  def setup() {
-   RestAssuredMockMvc.standaloneSetup(new ExampleSpringController())
-  }
-}

You can also setup the whole context if necessary.

import io.restassured.module.mockmvc.RestAssuredMockMvc;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.web.context.WebApplicationContext;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = SomeConfig.class, properties="some=property")
-public abstract class BaseTestClass {
-
-	@Autowired
-	WebApplicationContext context;
-
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.webAppContextSetup(this.context);
-	}
-}

If you use EXPLICIT mode, you can use a base class to initialize the whole tested app -similarly, as you might find in regular integration tests.

import io.restassured.RestAssured;
-import org.junit.Before;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.boot.web.server.LocalServerPort
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.web.context.WebApplicationContext;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = SomeConfig.class, properties="some=property")
-public abstract class BaseTestClass {
-
-	@LocalServerPort
-	int port;
-
-	@Before
-	public void setup() {
-		RestAssured.baseURI = "http://localhost:" + this.port;
-	}
-}

If you use the JAXRSCLIENT mode, this base class should also contain a protected WebTarget webTarget field. Right -now, the only option to test the JAX-RS API is to start a web server.

4.2.9 Different base classes for contracts

If your base classes differ between contracts, you can tell the Spring Cloud Contract -plugin which class should get extended by the autogenerated tests. You have two options:

  • Follow a convention by providing the packageWithBaseClasses
  • provide explicit mapping via baseClassMappings

By Convention

The convention is such that if you have a contract under (for example) -src/test/resources/contract/foo/bar/baz/ and set the value of the -packageWithBaseClasses property to com.example.base, then Spring Cloud Contract -Verifier assumes that there is a BarBazBase class under the com.example.base package. -In other words, the system takes the last two parts of the package, if they exist, and -forms a class with a Base suffix. This rule takes precedence over baseClassForTests. -Here is an example of how it works in the contracts closure:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<packageWithBaseClasses>hello</packageWithBaseClasses>
-	</configuration>
-</plugin>

By Mapping

You can manually map a regular expression of the contract’s package to fully qualified -name of the base class for the matched contract. You have to provide a list called -baseClassMappings that consists baseClassMapping objects that takes a -contractPackageRegex to baseClassFQN mapping. Consider the following example:

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<configuration>
-		<baseClassForTests>com.example.FooBase</baseClassForTests>
-		<baseClassMappings>
-			<baseClassMapping>
-				<contractPackageRegex>.*com.*</contractPackageRegex>
-				<baseClassFQN>com.example.TestBase</baseClassFQN>
-			</baseClassMapping>
-		</baseClassMappings>
-	</configuration>
-</plugin>

Assume that you have contracts under these two locations: -* src/test/resources/contract/com/ -* src/test/resources/contract/foo/

By providing the baseClassForTests, we have a fallback in case mapping did not succeed. -(You can also provide the packageWithBaseClasses as a fallback.) That way, the tests -generated from src/test/resources/contract/com/ contracts extend the -com.example.ComBase, whereas the rest of the tests extend com.example.FooBase.

4.2.10 Invoking generated tests

The Spring Cloud Contract Maven Plugin generates verification code in a directory called -/generated-test-sources/contractVerifier and attaches this directory to testCompile -goal.

For Groovy Spock code, use the following:

<plugin>
-	<groupId>org.codehaus.gmavenplus</groupId>
-	<artifactId>gmavenplus-plugin</artifactId>
-	<version>1.5</version>
-	<executions>
-		<execution>
-			<goals>
-				<goal>testCompile</goal>
-			</goals>
-		</execution>
-	</executions>
-	<configuration>
-		<testSources>
-			<testSource>
-				<directory>${project.basedir}/src/test/groovy</directory>
-				<includes>
-					<include>**/*.groovy</include>
-				</includes>
-			</testSource>
-			<testSource>
-				<directory>${project.build.directory}/generated-test-sources/contractVerifier</directory>
-				<includes>
-					<include>**/*.groovy</include>
-				</includes>
-			</testSource>
-		</testSources>
-	</configuration>
-</plugin>

To ensure that provider side is compliant with defined contracts, you need to invoke -mvn generateTest test.

4.2.11 Pushing stubs to SCM

If you’re using the SCM repository to keep the contracts and -stubs, you might want to automate the step of pushing stubs to -the repository. To do that, it’s enough to add the pushStubsToScm -goal. Example:

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <!-- Base class mappings etc. -->
-
-        <!-- We want to pick contracts from a Git repository -->
-        <contractsRepositoryUrl>git://https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs-contracts-git.git</contractsRepositoryUrl>
-
-        <!-- We reuse the contract dependency section to set up the path
-        to the folder that contains the contract definitions. In our case the
-        path will be /groupId/artifactId/version/contracts -->
-        <contractDependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>${project.artifactId}</artifactId>
-            <version>${project.version}</version>
-        </contractDependency>
-
-        <!-- The contracts mode can't be classpath -->
-        <contractsMode>REMOTE</contractsMode>
-    </configuration>
-    <executions>
-        <execution>
-            <phase>package</phase>
-            <goals>
-                <!-- By default we will not push the stubs back to SCM,
-                you have to explicitly add it as a goal -->
-                <goal>pushStubsToScm</goal>
-            </goals>
-        </execution>
-    </executions>
-</plugin>

Under Section 10.6, “Using the SCM Stub Downloader” you can find all possible -configuration options that you can pass either via -the <configuration><contractProperties> map, a system property -or an environment variable.

4.2.12 Maven Plugin and STS

If you see the following exception while using STS:

STS Exception

When you click on the error marker you should see something like this:

 plugin:1.1.0.M1:convert:default-convert:process-test-resources) org.apache.maven.plugin.PluginExecutionException: Execution default-convert of goal org.springframework.cloud:spring-
- cloud-contract-maven-plugin:1.1.0.M1:convert failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at
- org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331) at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362) at
-...
- org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: java.lang.NullPointerException at
- org.eclipse.m2e.core.internal.builder.plexusbuildapi.EclipseIncrementalBuildContext.hasDelta(EclipseIncrementalBuildContext.java:53) at
- org.sonatype.plexus.build.incremental.ThreadBuildContext.hasDelta(ThreadBuildContext.java:59) at

In order to fix this issue, provide the following section in your pom.xml:

<build>
-    <pluginManagement>
-        <plugins>
-            <!--This plugin's configuration is used to store Eclipse m2e settings
-                only. It has no influence on the Maven build itself. -->
-            <plugin>
-                <groupId>org.eclipse.m2e</groupId>
-                <artifactId>lifecycle-mapping</artifactId>
-                <version>1.0.0</version>
-                <configuration>
-                    <lifecycleMappingMetadata>
-                        <pluginExecutions>
-                             <pluginExecution>
-                                <pluginExecutionFilter>
-                                    <groupId>org.springframework.cloud</groupId>
-                                    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-                                    <versionRange>[1.0,)</versionRange>
-                                    <goals>
-                                        <goal>convert</goal>
-                                    </goals>
-                                </pluginExecutionFilter>
-                                <action>
-                                    <execute />
-                                </action>
-                             </pluginExecution>
-                        </pluginExecutions>
-                    </lifecycleMappingMetadata>
-                </configuration>
-            </plugin>
-        </plugins>
-    </pluginManagement>
-</build>

4.2.13 Maven Plugin with Spock Tests

You can select the Spock Framework for creating and executing the auto-generated contract -verification tests with both Maven and Gradle plugin. However, whereas with Gradle its really straightforward, -in Maven you will require some additional setup in order to make the tests compile and execute properly.

First of all, you will have to use a plugin, such as GMavenPlus plugin, -to add Groovy to your project. In GMavenPlus plugin, you will need to explicitly set test sources, including both the -path where your base test classes are defined and the path were the generated contract tests are added. -Please refer to the example below:

If you uphold to the Spock convention of ending the test class names with Spec, you will also need to adjust your Maven -Surefire plugin setup, like in the following example:

4.3 Stubs and Transitive Dependencies

The Maven and Gradle plugin that add the tasks that create the stubs jar for you. One -problem that arises is that, when reusing the stubs, you can mistakenly import all of -that stub’s dependencies. When building a Maven artifact, even though you have a couple -of different jars, all of them share one pom:

├── github-webhook-0.0.1.BUILD-20160903.075506-1-stubs.jar
-├── github-webhook-0.0.1.BUILD-20160903.075506-1-stubs.jar.sha1
-├── github-webhook-0.0.1.BUILD-20160903.075655-2-stubs.jar
-├── github-webhook-0.0.1.BUILD-20160903.075655-2-stubs.jar.sha1
-├── github-webhook-0.0.1.BUILD-SNAPSHOT.jar
-├── github-webhook-0.0.1.BUILD-SNAPSHOT.pom
-├── github-webhook-0.0.1.BUILD-SNAPSHOT-stubs.jar
-├── ...
-└── ...

There are three possibilities of working with those dependencies so as not to have any -issues with transitive dependencies:

  • Mark all application dependencies as optional
  • Create a separate artifactid for the stubs
  • Exclude dependencies on the consumer side

Mark all application dependencies as optional

If, in the github-webhook application, you mark all of your dependencies as optional, -when you include the github-webhook stubs in another application (or when that -dependency gets downloaded by Stub Runner) then, since all of the dependencies are -optional, they will not get downloaded.

Create a separate artifactid for the stubs

If you create a separate artifactid, then you can set it up in whatever way you wish. -For example, you might decide to have no dependencies at all.

Exclude dependencies on the consumer side

As a consumer, if you add the stub dependency to your classpath, you can explicitly -exclude the unwanted dependencies.

4.4 Scenarios

You can handle scenarios with Spring Cloud Contract Verifier. All you need to do is to -stick to the proper naming convention while creating your contracts. The convention -requires including an order number followed by an underscore. This will work regardles - of whether you’re working with YAML or Groovy. Example:

my_contracts_dir\
-  scenario1\
-    1_login.groovy
-    2_showCart.groovy
-    3_logout.groovy

Such a tree causes Spring Cloud Contract Verifier to generate WireMock’s scenario with a -name of scenario1 and the three following steps:

  1. login marked as Started pointing to…​
  2. showCart marked as Step1 pointing to…​
  3. logout marked as Step2 which will close the scenario.

More details about WireMock scenarios can be found at -http://wiremock.org/docs/stateful-behaviour/

Spring Cloud Contract Verifier also generates tests with a guaranteed order of execution.

4.5 Docker Project

We’re publishing a springcloud/spring-cloud-contract Docker image -that contains a project that will generate tests and execute them in EXPLICIT mode -against a running application.

[Tip]Tip

The EXPLICIT mode means that the tests generated from contracts will send -real requests and not the mocked ones.

4.5.1 Short intro to Maven, JARs and Binary storage

Since the Docker image can be used by non JVM projects, it’s good to -explain the basic terms behind Spring Cloud Contract packaging defaults.

Part of the following definitions were taken from the Maven Glossary

  • Project: Maven thinks in terms of projects. Everything that you -will build are projects. Those projects follow a well defined -“Project Object Model”. Projects can depend on other projects, -in which case the latter are called “dependencies”. A project may -consistent of several subprojects, however these subprojects are still -treated equally as projects.
  • Artifact: An artifact is something that is either produced or used -by a project. Examples of artifacts produced by Maven for a project -include: JARs, source and binary distributions. Each artifact -is uniquely identified by a group id and an artifact ID which is -unique within a group.
  • JAR: JAR stands for Java ARchive. It’s a format based on -the ZIP file format. Spring Cloud Contract packages the contracts and generated -stubs in a JAR file.
  • GroupId: A group ID is a universally unique identifier for a project. -While this is often just the project name (eg. commons-collections), -it is helpful to use a fully-qualified package name to distinguish it -from other projects with a similar name (eg. org.apache.maven). -Typically, when published to the Artifact Manager, the GroupId will get -slash separated and form part of the URL. E.g. for group id com.example -and artifact id application would be /com/example/application/.
  • Classifier: The Maven dependency notation looks as follows: -groupId:artifactId:version:classifier. The classifier is additional suffix -passed to the dependency. E.g. stubs, sources. The same dependency -e.g. com.example:application can produce multiple artifacts that -differ from each other with the classifier.
  • Artifact manager: When you generate binaries / sources / packages, you would -like them to be available for others to download / reference or reuse. In case -of the JVM world those artifacts would be JARs, for Ruby these are gems -and for Docker those would be Docker images. You can store those artifacts -in a manager. Examples of such managers can be Artifactory -or Nexus.

4.5.2 How it works

The image searches for contracts under the /contracts folder. -The output from running the tests will be available under -/spring-cloud-contract/build folder (it’s useful for debugging -purposes).

It’s enough for you to mount your contracts, pass the environment variables - and the image will:

  • generate the contract tests
  • execute the tests against the provided URL
  • generate the WireMock stubs
  • (optional - turned on by default) publish the stubs to a Artifact Manager

Environment Variables

The Docker image requires some environment variables to point to -your running application, to the Artifact manager instance etc.

  • PROJECT_GROUP - your project’s group id. Defaults to com.example
  • PROJECT_VERSION - your project’s version. Defaults to 0.0.1-SNAPSHOT
  • PROJECT_NAME - artifact id. Defaults to example
  • REPO_WITH_BINARIES_URL - URL of your Artifact Manager. Defaults to http://localhost:8081/artifactory/libs-release-local -which is the default URL of Artifactory running locally
  • REPO_WITH_BINARIES_USERNAME - (optional) username when the Artifact Manager is secured
  • REPO_WITH_BINARIES_PASSWORD - (optional) password when the Artifact Manager is secured
  • PUBLISH_ARTIFACTS - if set to true then will publish artifact to binary storage. Defaults to true.

These environment variables are used when contracts lay in an external repository. To enable -this feature you must set the EXTERNAL_CONTRACTS_ARTIFACT_ID environment variable.

  • EXTERNAL_CONTRACTS_GROUP_ID - group id of the project with contracts. Defaults to com.example
  • EXTERNAL_CONTRACTS_ARTIFACT_ID- artifact id of the project with contracts.
  • EXTERNAL_CONTRACTS_CLASSIFIER- classifier of the project with contracts. Empty by default
  • EXTERNAL_CONTRACTS_VERSION - version of the project with contracts. Defaults to +, equivalent to picking the latest
  • EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL - URL of your Artifact Manager. Defaults to value of REPO_WITH_BINARIES_URL env var. -If that’s not set, defaults to http://localhost:8081/artifactory/libs-release-local -which is the default URL of Artifactory running locally
  • EXTERNAL_CONTRACTS_PATH - path to contracts for the given project, inside the project with contracts. -Defaults to slash separated EXTERNAL_CONTRACTS_GROUP_ID concatenated with / and EXTERNAL_CONTRACTS_ARTIFACT_ID. E.g. -for group id foo.bar and artifact id baz, would result in foo/bar/baz contracts path.
  • EXTERNAL_CONTRACTS_WORK_OFFLINE - if set to true then will retrieve artifact with contracts -from the container’s .m2. Mount your local .m2 as a volume available at the container’s /root/.m2 path. -You must not set both EXTERNAL_CONTRACTS_WORK_OFFLINE and EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL.

These environment variables are used when tests are executed:

  • APPLICATION_BASE_URL - url against which tests should be executed. -Remember that it has to be accessible from the Docker container (e.g. localhost -will not work)
  • APPLICATION_USERNAME - (optional) username for basic authentication to your application
  • APPLICATION_PASSWORD - (optional) password for basic authentication to your application

4.5.3 Example of usage

Let’s take a look at a simple MVC application

$ git clone https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs
-$ cd bookstore

The contracts are available under /contracts folder.

4.5.4 Server side (nodejs)

Since we want to run tests, we could just execute:

$ npm test

however, for learning purposes, let’s split it into pieces:

# Stop docker infra (nodejs, artifactory)
-$ ./stop_infra.sh
-# Start docker infra (nodejs, artifactory)
-$ ./setup_infra.sh
-
-# Kill & Run app
-$ pkill -f "node app"
-$ nohup node app &
-
-# Prepare environment variables
-$ SC_CONTRACT_DOCKER_VERSION="..."
-$ APP_IP="192.168.0.100"
-$ APP_PORT="3000"
-$ ARTIFACTORY_PORT="8081"
-$ APPLICATION_BASE_URL="http://${APP_IP}:${APP_PORT}"
-$ ARTIFACTORY_URL="http://${APP_IP}:${ARTIFACTORY_PORT}/artifactory/libs-release-local"
-$ CURRENT_DIR="$( pwd )"
-$ CURRENT_FOLDER_NAME=${PWD##*/}
-$ PROJECT_VERSION="0.0.1.RELEASE"
-
-# Execute contract tests
-$ docker run  --rm -e "APPLICATION_BASE_URL=${APPLICATION_BASE_URL}" -e "PUBLISH_ARTIFACTS=true" -e "PROJECT_NAME=${CURRENT_FOLDER_NAME}" -e "REPO_WITH_BINARIES_URL=${ARTIFACTORY_URL}" -e "PROJECT_VERSION=${PROJECT_VERSION}" -v "${CURRENT_DIR}/contracts/:/contracts:ro" -v "${CURRENT_DIR}/node_modules/spring-cloud-contract/output:/spring-cloud-contract-output/" springcloud/spring-cloud-contract:"${SC_CONTRACT_DOCKER_VERSION}"
-
-# Kill app
-$ pkill -f "node app"

What will happen is that via bash scripts:

  • infrastructure will be set up (MongoDb, Artifactory). -In real life scenario you would just run the NodeJS application -with mocked database. In this example we want to show how we can -benefit from Spring Cloud Contract in no time.
  • due to those constraints the contracts also represent the -stateful situation

    • first request is a POST that causes data to get inserted to the database
    • second request is a GET that returns a list of data with 1 previously inserted element
  • the NodeJS application will be started (on port 3000)
  • contract tests will be generated via Docker and tests -will be executed against the running application

    • the contracts will be taken from /contracts folder.
    • the output of the test execution is available under -node_modules/spring-cloud-contract/output.
  • the stubs will be uploaded to Artifactory. You can check them out -under http://localhost:8081/artifactory/libs-release-local/com/example/bookstore/0.0.1.RELEASE/ . -The stubs will be here http://localhost:8081/artifactory/libs-release-local/com/example/bookstore/0.0.1.RELEASE/bookstore-0.0.1.RELEASE-stubs.jar.

To see how the client side looks like check out the Section 6.9, “Stub Runner Docker” section.

5. Spring Cloud Contract Verifier Messaging

Spring Cloud Contract Verifier lets you verify applications that use messaging as a -means of communication. All of the integrations shown in this document work with Spring, -but you can also create one of your own and use that.

5.1 Integrations

You can use one of the following four integration configurations:

  • Apache Camel
  • Spring Integration
  • Spring Cloud Stream
  • Spring AMQP

Since we use Spring Boot, if you have added one of these libraries to the classpath, all -the messaging configuration is automatically set up.

[Important]Important

Remember to put @AutoConfigureMessageVerifier on the base class of your -generated tests. Otherwise, messaging part of Spring Cloud Contract Verifier does not -work.

[Important]Important

If you want to use Spring Cloud Stream, remember to add a dependency on -org.springframework.cloud:spring-cloud-stream-test-support, as shown here:

Maven.  -

<dependency>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-stream-test-support</artifactId>
-    <scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-stream-test-support"

-

5.2 Manual Integration Testing

The main interface used by the tests is -org.springframework.cloud.contract.verifier.messaging.MessageVerifier. -It defines how to send and receive messages. You can create your own implementation to -achieve the same goal.

In a test, you can inject a ContractVerifierMessageExchange to send and receive -messages that follow the contract. Then add @AutoConfigureMessageVerifier to your test. -Here’s an example:

@RunWith(SpringTestRunner.class)
-@SpringBootTest
-@AutoConfigureMessageVerifier
-public static class MessagingContractTests {
-
-  @Autowired
-  private MessageVerifier verifier;
-  ...
-}
[Note]Note

If your tests require stubs as well, then @AutoConfigureStubRunner includes the -messaging configuration, so you only need the one annotation.

5.3 Publisher-Side Test Generation

Having the input or outputMessage sections in your DSL results in creation of tests -on the publisher’s side. By default, JUnit 4 tests are created. However, there is also a -possibility to create JUnit 5 or Spock tests.

There are 3 main scenarios that we should take into consideration:

  • Scenario 1: There is no input message that produces an output message. The output -message is triggered by a component inside the application (for example, scheduler).
  • Scenario 2: The input message triggers an output message.
  • Scenario 3: The input message is consumed and there is no output message.
[Important]Important

The destination passed to messageFrom or sentTo can have different -meanings for different messaging implementations. For Stream and Integration it is -first resolved as a destination of a channel. Then, if there is no such destination -it is resolved as a channel name. For Camel, that’s a certain component (for example, -jms).

5.3.1 Scenario 1: No Input Message

For the given contract:

Groovy DSL.  -

			def contractDsl = Contract.make {
-				label 'some_label'
-				input {
-					triggeredBy('bookReturnedTriggered()')
-				}
-				outputMessage {
-					sentTo('activemq:output')
-					body('''{ "bookName" : "foo" }''')
-					headers {
-						header('BOOK-NAME', 'foo')
-						messagingContentType(applicationJson())
-					}
-				}
-			}

-

YAML.  -

label: some_label
-input:
-  triggeredBy: bookReturnedTriggered
-outputMessage:
-  sentTo: activemq:output
-  body:
-    bookName: foo
-  headers:
-    BOOK-NAME: foo
-    contentType: application/json

-

The following JUnit test is created:

					'''
- // when:
-  bookReturnedTriggered();
-
- // then:
-  ContractVerifierMessage response = contractVerifierMessaging.receive("activemq:output");
-  assertThat(response).isNotNull();
-  assertThat(response.getHeader("BOOK-NAME")).isNotNull();
-  assertThat(response.getHeader("BOOK-NAME").toString()).isEqualTo("foo");
-  assertThat(response.getHeader("contentType")).isNotNull();
-  assertThat(response.getHeader("contentType").toString()).isEqualTo("application/json");
- // and:
-  DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.getPayload()));
-  assertThatJson(parsedJson).field("bookName").isEqualTo("foo");
-'''

And the following Spock test would be created:

					'''
- when:
-  bookReturnedTriggered()
-
- then:
-  ContractVerifierMessage response = contractVerifierMessaging.receive('activemq:output')
-  assert response != null
-  response.getHeader('BOOK-NAME')?.toString()  == 'foo'
-  response.getHeader('contentType')?.toString()  == 'application/json'
- and:
-  DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.payload))
-  assertThatJson(parsedJson).field("bookName").isEqualTo("foo")
-
-'''

5.3.2 Scenario 2: Output Triggered by Input

For the given contract:

Groovy DSL.  -

			def contractDsl = Contract.make {
-				label 'some_label'
-				input {
-					messageFrom('jms:input')
-					messageBody([
-							bookName: 'foo'
-					])
-					messageHeaders {
-						header('sample', 'header')
-					}
-				}
-				outputMessage {
-					sentTo('jms:output')
-					body([
-							bookName: 'foo'
-					])
-					headers {
-						header('BOOK-NAME', 'foo')
-					}
-				}
-			}

-

YAML.  -

label: some_label
-input:
-  messageFrom: jms:input
-  messageBody:
-    bookName: 'foo'
-  messageHeaders:
-    sample: header
-outputMessage:
-  sentTo: jms:output
-  body:
-    bookName: foo
-  headers:
-    BOOK-NAME: foo

-

The following JUnit test is created:

					'''
-// given:
- ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-  "{\\"bookName\\":\\"foo\\"}"
-, headers()
-  .header("sample", "header"));
-
-// when:
- contractVerifierMessaging.send(inputMessage, "jms:input");
-
-// then:
- ContractVerifierMessage response = contractVerifierMessaging.receive("jms:output");
- assertThat(response).isNotNull();
- assertThat(response.getHeader("BOOK-NAME")).isNotNull();
- assertThat(response.getHeader("BOOK-NAME").toString()).isEqualTo("foo");
-// and:
- DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.getPayload()));
- assertThatJson(parsedJson).field("bookName").isEqualTo("foo");
-'''

And the following Spock test would be created:

					"""\
-given:
-   ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-    '''{"bookName":"foo"}''',
-    ['sample': 'header']
-  )
-
-when:
-   contractVerifierMessaging.send(inputMessage, 'jms:input')
-
-then:
-   ContractVerifierMessage response = contractVerifierMessaging.receive('jms:output')
-   assert response !- null
-   response.getHeader('BOOK-NAME')?.toString()  == 'foo'
-and:
-   DocumentContext parsedJson = JsonPath.parse(contractVerifierObjectMapper.writeValueAsString(response.payload))
-   assertThatJson(parsedJson).field("bookName").isEqualTo("foo")
-"""

5.3.3 Scenario 3: No Output Message

For the given contract:

Groovy DSL.  -

			def contractDsl = Contract.make {
-				label 'some_label'
-				input {
-					messageFrom('jms:delete')
-					messageBody([
-							bookName: 'foo'
-					])
-					messageHeaders {
-						header('sample', 'header')
-					}
-					assertThat('bookWasDeleted()')
-				}
-			}

-

YAML.  -

label: some_label
-input:
-  messageFrom: jms:delete
-  messageBody:
-    bookName: 'foo'
-  messageHeaders:
-    sample: header
-  assertThat: bookWasDeleted()

-

The following JUnit test is created:

					'''
-// given:
- ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-	"{\\"bookName\\":\\"foo\\"}"
-, headers()
-	.header("sample", "header"));
-
-// when:
- contractVerifierMessaging.send(inputMessage, "jms:delete");
-
-// then:
- bookWasDeleted();
-'''

And the following Spock test would be created:

					'''
-given:
-	 ContractVerifierMessage inputMessage = contractVerifierMessaging.create(
-		\'\'\'{"bookName":"foo"}\'\'\',
-		['sample': 'header']
-	)
-
-when:
-	 contractVerifierMessaging.send(inputMessage, 'jms:delete')
-
-then:
-	 noExceptionThrown()
-	 bookWasDeleted()
-'''

5.4 Consumer Stub Generation

Unlike the HTTP part, in messaging, we need to publish the Groovy DSL inside the JAR with -a stub. Then it is parsed on the consumer side and proper stubbed routes are created.

For more information, see Chapter 7, Stub Runner for Messaging section.

Maven.  -

<dependencies>
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
-	</dependency>
-
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
-		<scope>test</scope>
-	</dependency>
-	<dependency>
-		<groupId>org.springframework.cloud</groupId>
-		<artifactId>spring-cloud-stream-test-support</artifactId>
-		<scope>test</scope>
-	</dependency>
-</dependencies>
-
-<dependencyManagement>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-dependencies</artifactId>
-			<version>Greenwich.BUILD-SNAPSHOT</version>
-			<type>pom</type>
-			<scope>import</scope>
-		</dependency>
-	</dependencies>
-</dependencyManagement>

-

Gradle.  -

ext {
-	contractsDir = file("mappings")
-	stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
-}
-
-// Automatically added by plugin:
-// copyContracts - copies contracts to the output folder from which JAR will be created
-// verifierStubsJar - JAR with a provided stub suffix
-// the presented publication is also added by the plugin but you can modify it as you wish
-
-publishing {
-	publications {
-		stubs(MavenPublication) {
-			artifactId "${project.name}-stubs"
-			artifact verifierStubsJar
-		}
-	}
-}

-

6. Spring Cloud Contract Stub Runner

One of the issues that you might encounter while using Spring Cloud Contract Verifier is -passing the generated WireMock JSON stubs from the server side to the client side (or to -various clients). The same takes place in terms of client-side generation for messaging.

Copying the JSON files and setting the client side for messaging manually is out of the -question. That is why we introduced Spring Cloud Contract Stub Runner. It can -automatically download and run the stubs for you.

6.1 Snapshot versions

Add the additional snapshot repository to your build.gradle file to use snapshot -versions, which are automatically uploaded after every successful build:

Maven.  -

<repositories>
-	<repository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-	<repository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</repository>
-</repositories>
-<pluginRepositories>
-	<pluginRepository>
-		<id>spring-snapshots</id>
-		<name>Spring Snapshots</name>
-		<url>https://repo.spring.io/snapshot</url>
-		<snapshots>
-			<enabled>true</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-milestones</id>
-		<name>Spring Milestones</name>
-		<url>https://repo.spring.io/milestone</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-	<pluginRepository>
-		<id>spring-releases</id>
-		<name>Spring Releases</name>
-		<url>https://repo.spring.io/release</url>
-		<snapshots>
-			<enabled>false</enabled>
-		</snapshots>
-	</pluginRepository>
-</pluginRepositories>

-

Gradle.  -

buildscript {
-	repositories {
-		mavenCentral()
-		mavenLocal()
-		maven { url "https://repo.spring.io/snapshot" }
-		maven { url "https://repo.spring.io/milestone" }
-		maven { url "https://repo.spring.io/release" }
-	}

-

6.2 Publishing Stubs as JARs

The easiest approach would be to centralize the way stubs are kept. For example, you can -keep them as jars in a Maven repository.

[Tip]Tip

For both Maven and Gradle, the setup comes ready to work. However, you can customize -it if you want to.

Maven.  -

<!-- 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>
-
-<!-- Next add the assembly plugin to your build -->
-<!-- we want the assembly plugin to generate the JAR -->
-<plugin>
-	<groupId>org.apache.maven.plugins</groupId>
-	<artifactId>maven-assembly-plugin</artifactId>
-	<executions>
-		<execution>
-			<id>stub</id>
-			<phase>prepare-package</phase>
-			<goals>
-				<goal>single</goal>
-			</goals>
-			<inherited>false</inherited>
-			<configuration>
-				<attach>true</attach>
-				<descriptors>
-					${basedir}/src/assembly/stub.xml
-				</descriptors>
-			</configuration>
-		</execution>
-	</executions>
-</plugin>
-
-<!-- Finally setup your assembly. Below you can find the contents of src/main/assembly/stub.xml -->
-<assembly
-	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>stubs</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>src/main/java</directory>
-			<outputDirectory>/</outputDirectory>
-			<includes>
-				<include>**com/example/model/*.*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${project.build.directory}/classes</directory>
-			<outputDirectory>/</outputDirectory>
-			<includes>
-				<include>**com/example/model/*.*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${project.build.directory}/snippets/stubs</directory>
-			<outputDirectory>META-INF/${project.groupId}/${project.artifactId}/${project.version}/mappings</outputDirectory>
-			<includes>
-				<include>**/*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${basedir}/src/test/resources/contracts</directory>
-			<outputDirectory>META-INF/${project.groupId}/${project.artifactId}/${project.version}/contracts</outputDirectory>
-			<includes>
-				<include>**/*.groovy</include>
-			</includes>
-		</fileSet>
-	</fileSets>
-</assembly>

-

Gradle.  -

ext {
-	contractsDir = file("mappings")
-	stubsOutputDirRoot = file("${project.buildDir}/production/${project.name}-stubs/")
-}
-
-// Automatically added by plugin:
-// copyContracts - copies contracts to the output folder from which JAR will be created
-// verifierStubsJar - JAR with a provided stub suffix
-// the presented publication is also added by the plugin but you can modify it as you wish
-
-publishing {
-	publications {
-		stubs(MavenPublication) {
-			artifactId "${project.name}-stubs"
-			artifact verifierStubsJar
-		}
-	}
-}

-

6.3 Stub Runner Core

Runs stubs for service collaborators. Treating stubs as contracts of services allows to use stub-runner as an implementation of -Consumer Driven Contracts.

Stub Runner allows you to automatically download the stubs of the provided dependencies (or pick those from the classpath), start WireMock servers for them and feed them with proper stub definitions. -For messaging, special stub routes are defined.

6.3.1 Retrieving stubs

You can pick the following options of acquiring stubs

  • Aether based solution that downloads JARs with stubs from Artifactory / Nexus
  • Classpath scanning solution that searches classpath via pattern to retrieve stubs
  • Write your own implementation of the org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder for full customization

The latter example is described in the Custom Stub Runner section.

Stub downloading

You can control the stub downloading via the stubsMode switch. It picks value from the -StubRunnerProperties.StubsMode enum. You can use the following options

  • StubRunnerProperties.StubsMode.CLASSPATH (default value) - will pick stubs from the classpath
  • StubRunnerProperties.StubsMode.LOCAL - will pick stubs from a local storage (e.g. .m2)
  • StubRunnerProperties.StubsMode.REMOTE - will pick stubs from a remote location

Example:

@AutoConfigureStubRunner(repositoryRoot="https://foo.bar", ids = "com.example:beer-api-producer:+:stubs:8095", stubsMode = StubRunnerProperties.StubsMode.LOCAL)

Classpath scanning

If you set the stubsMode property to StubRunnerProperties.StubsMode.CLASSPATH -(or set nothing since CLASSPATH is the default value) then classpath will get scanned. -Let’s look at the following example:

@AutoConfigureStubRunner(ids = {
-    "com.example:beer-api-producer:+:stubs:8095",
-    "com.example.foo:bar:1.0.0:superstubs:8096"
-})

If you’ve added the dependencies to your classpath

Maven.  -

<dependency>
-    <groupId>com.example</groupId>
-    <artifactId>beer-api-producer-restdocs</artifactId>
-    <classifier>stubs</classifier>
-    <version>0.0.1-SNAPSHOT</version>
-    <scope>test</scope>
-    <exclusions>
-        <exclusion>
-            <groupId>*</groupId>
-            <artifactId>*</artifactId>
-        </exclusion>
-    </exclusions>
-</dependency>
-<dependency>
-    <groupId>com.example.foo</groupId>
-    <artifactId>bar</artifactId>
-    <classifier>superstubs</classifier>
-    <version>1.0.0</version>
-    <scope>test</scope>
-    <exclusions>
-        <exclusion>
-            <groupId>*</groupId>
-            <artifactId>*</artifactId>
-        </exclusion>
-    </exclusions>
-</dependency>

-

Gradle.  -

testCompile("com.example:beer-api-producer-restdocs:0.0.1-SNAPSHOT:stubs") {
-    transitive = false
-}
-testCompile("com.example.foo:bar:1.0.0:superstubs") {
-    transitive = false
-}

-

Then the following locations on your classpath will get scanned. For com.example:beer-api-producer-restdocs

  • /META-INF/com.example/beer-api-producer-restdocs/*/.*
  • /contracts/com.example/beer-api-producer-restdocs/*/.*
  • /mappings/com.example/beer-api-producer-restdocs/*/.*

and com.example.foo:bar

  • /META-INF/com.example.foo/bar/*/.*
  • /contracts/com.example.foo/bar/*/.*
  • /mappings/com.example.foo/bar/*/.*
[Tip]Tip

As you can see you have to explicitly provide the group and artifact ids when packaging the -producer stubs.

The producer would setup the contracts like this:

└── src
-    └── test
-        └── resources
-            └── contracts
-                └── com.example
-                    └── beer-api-producer-restdocs
-                        └── nested
-                            └── contract3.groovy

To achieve proper stub packaging.

Or using the Maven assembly plugin or -Gradle Jar task you have to create the following -structure in your stubs jar.

└── META-INF
-    └── com.example
-        └── beer-api-producer-restdocs
-            └── 2.0.0
-                ├── contracts
-                │   └── nested
-                │       └── contract2.groovy
-                └── mappings
-                    └── mapping.json

By maintaining this structure classpath gets scanned and you can profit from the messaging / -HTTP stubs without the need to download artifacts.

Configuring HTTP Server Stubs

Stub Runner has a notion of a HttpServerStub that abstracts the underlaying -concrete implementation of the HTTP server (e.g. WireMock is one of the implementations). -Sometimes, you need to perform some additional tuning of the stub servers, -that is concrete for the given implementation. To do that, Stub Runner gives you -the httpServerStubConfigurer property that is available in the annotation, -JUnit rule, and is accessible via system properties, where you can provide -your implementation of the org.springframework.cloud.contract.stubrunner.HttpServerStubConfigurer interface. The implementations can alter -the configuration files for the given HTTP server stub.

Spring Cloud Contract Stub Runner comes with an implementation that you -can extend, for WireMock - org.springframework.cloud.contract.stubrunner.provider.wiremock.WireMockHttpServerStubConfigurer. In the configure method -you can provide your own, custom configuration for the given stub. The use -case might be starting WireMock for the given artifact id, on an HTTPs port. Example:

WireMockHttpServerStubConfigurer implementation.  -

@CompileStatic
-static class HttpsForFraudDetection extends WireMockHttpServerStubConfigurer {
-
-	private static final Log log = LogFactory.getLog(HttpsForFraudDetection)
-
-	@Override
-	WireMockConfiguration configure(WireMockConfiguration httpStubConfiguration, HttpServerStubConfiguration httpServerStubConfiguration) {
-		if (httpServerStubConfiguration.stubConfiguration.artifactId == "fraudDetectionServer") {
-			int httpsPort = SocketUtils.findAvailableTcpPort()
-			log.info("Will set HTTPs port [" + httpsPort + "] for fraud detection server")
-			return httpStubConfiguration
-					.httpsPort(httpsPort)
-		}
-		return httpStubConfiguration
-	}
-}

-

You can then reuse it via the annotation

@AutoConfigureStubRunner(mappingsOutputFolder = "target/outputmappings/",
-		httpServerStubConfigurer = HttpsForFraudDetection)

Whenever an https port is found, it will take precedence over the http one.

6.3.2 Running stubs

Running using main app

You can set the following options to the main class:

-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'
-                                  (default: stubs)
---maxPort, --maxp <Integer>     Maximum port value to be assigned to
-                                  the WireMock instance. Defaults to
-                                  15000 (default: 15000)
---minPort, --minp <Integer>     Minimum port value to be assigned to
-                                  the WireMock instance. Defaults to
-                                  10000 (default: 10000)
--p, --password                  Password to user when connecting to
-                                  repository
---phost, --proxyHost            Proxy host to use for repository
-                                  requests
---pport, --proxyPort [Integer]  Proxy port to use for repository
-                                  requests
--r, --root                      Location of a Jar containing server
-                                  where you keep your stubs (e.g. http:
-                                  //nexus.
-                                  net/content/repositories/repository)
--s, --stubs                     Comma separated list of Ivy
-                                  representation of jars with stubs.
-                                  Eg. groupid:artifactid1,groupid2:
-                                  artifactid2:classifier
---sm, --stubsMode               Stubs mode to be used. Acceptable values
-                                  [CLASSPATH, LOCAL, REMOTE]
--u, --username                  Username to user when connecting to
-                                  repository

HTTP Stubs

Stubs are defined in JSON documents, whose syntax is defined in WireMock documentation

Example:

{
-    "request": {
-        "method": "GET",
-        "url": "/ping"
-    },
-    "response": {
-        "status": 200,
-        "body": "pong",
-        "headers": {
-            "Content-Type": "text/plain"
-        }
-    }
-}

Viewing registered mappings

Every stubbed collaborator exposes list of defined mappings under __/admin/ endpoint.

You can also use the mappingsOutputFolder property to dump the mappings to files. - For annotation based approach it would look like this

@AutoConfigureStubRunner(ids="a.b.c:loanIssuance,a.b.c:fraudDetectionServer",
-mappingsOutputFolder = "target/outputmappings/")

and for the JUnit approach like this:

@ClassRule @Shared StubRunnerRule rule = new StubRunnerRule()
-			.repoRoot("http://some_url")
-			.downloadStub("a.b.c", "loanIssuance")
-			.downloadStub("a.b.c:fraudDetectionServer")
-			.withMappingsOutputFolder("target/outputmappings")

Then if you check out the folder target/outputmappings you would see the following structure

.
-├── fraudDetectionServer_13705
-└── loanIssuance_12255

That means that there were two stubs registered. fraudDetectionServer was registered at port 13705 -and loanIssuance at port 12255. If we take a look at one of the files we would see (for WireMock) -mappings available for the given server:

[{
-  "id" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7",
-  "request" : {
-    "url" : "/name",
-    "method" : "GET"
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "fraudDetectionServer"
-  },
-  "uuid" : "f9152eb9-bf77-4c38-8289-90be7d10d0d7"
-},
-...
-]

Messaging Stubs

Depending on the provided Stub Runner dependency and the DSL the messaging routes are automatically set up.

6.4 Stub Runner JUnit Rule and Stub Runner JUnit5 Extension

Stub Runner comes with a JUnit rule thanks to which you can very easily download and run stubs for given group and artifact id:

@ClassRule
-public static StubRunnerRule rule = new StubRunnerRule().repoRoot(repoRoot())
-		.stubsMode(StubRunnerProperties.StubsMode.REMOTE)
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs",
-				"loanIssuance")
-		.downloadStub(
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer");
-
-@BeforeClass
-@AfterClass
-public static void setupProps() {
-	System.clearProperty("stubrunner.repository.root");
-	System.clearProperty("stubrunner.classifier");
-}

There’s also a StubRunnerExtension available for JUnit 5. StubRunnerRule and StubRunnerExtension work in a very -similar fashion. After the rule/ extension is executed, Stub Runner connects to your Maven repository and for the given list of dependencies tries to:

  • download them
  • cache them locally
  • unzip them to a temporary folder
  • start a WireMock server for each Maven dependency on a random port from the provided range of ports / provided port
  • feed the WireMock server with all JSON files that are valid WireMock definitions
  • can also send messages (remember to pass an implementation of MessageVerifier interface)

Stub Runner uses Eclipse Aether mechanism to download the Maven dependencies. -Check their docs for more information.

Since the StubRunnerRule and StubRunnerExtension implement the StubFinder they allow you to find the started stubs:

package org.springframework.cloud.contract.stubrunner;
-
-import java.net.URL;
-import java.util.Collection;
-import java.util.Map;
-
-import org.springframework.cloud.contract.spec.Contract;
-
-/**
- * Contract for finding registered stubs.
- *
- * @author Marcin Grzejszczak
- */
-public interface StubFinder extends StubTrigger {
-
-	/**
-	 * For the given groupId and artifactId tries to find the matching URL of the running
-	 * stub.
-	 * @param groupId - might be null. In that case a search only via artifactId takes
-	 * place
-	 * @param artifactId - artifact id of the stub
-	 * @return URL of a running stub or throws exception if not found
-	 * @throws StubNotFoundException in case of not finding a stub
-	 */
-	URL findStubUrl(String groupId, String artifactId) throws StubNotFoundException;
-
-	/**
-	 * For the given Ivy notation {@code [groupId]:artifactId:[version]:[classifier]}
-	 * tries to find the matching URL of the running stub. You can also pass only
-	 * {@code artifactId}.
-	 * @param ivyNotation - Ivy representation of the Maven artifact
-	 * @return URL of a running stub or throws exception if not found
-	 * @throws StubNotFoundException in case of not finding a stub
-	 */
-	URL findStubUrl(String ivyNotation) throws StubNotFoundException;
-
-	/**
-	 * @return all running stubs
-	 */
-	RunningStubs findAllRunningStubs();
-
-	/**
-	 * @return the list of Contracts
-	 */
-	Map<StubConfiguration, Collection<Contract>> getContracts();
-
-}

Example of usage in Spock tests:

@ClassRule
-@Shared
-StubRunnerRule rule = new StubRunnerRule()
-		.stubsMode(StubRunnerProperties.StubsMode.REMOTE)
-		.repoRoot(StubRunnerRuleSpec.getResource("/m2repo/repository").toURI().toString())
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs", "loanIssuance")
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")
-		.withMappingsOutputFolder("target/outputmappingsforrule")
-
-
-def 'should start WireMock servers'() {
-	expect: 'WireMocks are running'
-		rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance') != null
-		rule.findStubUrl('loanIssuance') != null
-		rule.findStubUrl('loanIssuance') == rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance')
-		rule.findStubUrl('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer') != null
-	and:
-		rule.findAllRunningStubs().isPresent('loanIssuance')
-		rule.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs', 'fraudDetectionServer')
-		rule.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer')
-	and: 'Stubs were registered'
-		"${rule.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
-		"${rule.findStubUrl('fraudDetectionServer').toString()}/name".toURL().text == 'fraudDetectionServer'
-}
-
-def 'should output mappings to output folder'() {
-	when:
-		def url = rule.findStubUrl('fraudDetectionServer')
-	then:
-		new File("target/outputmappingsforrule", "fraudDetectionServer_${url.port}").exists()
-}

Example of usage in JUnit tests:

	@Test
-	public void should_start_wiremock_servers() throws Exception {
-		// expect: 'WireMocks are running'
-		then(rule.findStubUrl("org.springframework.cloud.contract.verifier.stubs",
-				"loanIssuance")).isNotNull();
-		then(rule.findStubUrl("loanIssuance")).isNotNull();
-		then(rule.findStubUrl("loanIssuance")).isEqualTo(rule.findStubUrl(
-				"org.springframework.cloud.contract.verifier.stubs", "loanIssuance"));
-		then(rule.findStubUrl(
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer"))
-						.isNotNull();
-		// and:
-		then(rule.findAllRunningStubs().isPresent("loanIssuance")).isTrue();
-		then(rule.findAllRunningStubs().isPresent(
-				"org.springframework.cloud.contract.verifier.stubs",
-				"fraudDetectionServer")).isTrue();
-		then(rule.findAllRunningStubs().isPresent(
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer"))
-						.isTrue();
-		// and: 'Stubs were registered'
-		then(httpGet(rule.findStubUrl("loanIssuance").toString() + "/name"))
-				.isEqualTo("loanIssuance");
-		then(httpGet(rule.findStubUrl("fraudDetectionServer").toString() + "/name"))
-				.isEqualTo("fraudDetectionServer");
-	}
-
-	private String httpGet(String url) throws Exception {
-		try (InputStream stream = URI.create(url).toURL().openStream()) {
-			return StreamUtils.copyToString(stream, Charset.forName("UTF-8"));
-		}
-	}
-
-}

JUnit 5 Extension example:

// Visible for Junit
-@RegisterExtension
-static StubRunnerExtension stubRunnerExtension = new StubRunnerExtension()
-		.repoRoot(repoRoot()).stubsMode(StubRunnerProperties.StubsMode.REMOTE)
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs",
-				"loanIssuance")
-		.downloadStub(
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")
-		.withMappingsOutputFolder("target/outputmappingsforrule");
-
-@BeforeAll
-@AfterAll
-static void setupProps() {
-	System.clearProperty("stubrunner.repository.root");
-	System.clearProperty("stubrunner.classifier");
-}
-
-private static String repoRoot() {
-	try {
-		return StubRunnerRuleJUnitTest.class.getResource("/m2repo/repository/")
-				.toURI().toString();
-	}
-	catch (Exception e) {
-		return "";
-	}
-}

Check the Common properties for JUnit and Spring for more information on how to apply global configuration of Stub Runner.

[Important]Important

To use the JUnit rule or JUnit 5 extension together with messaging, you have to provide an implementation of the -MessageVerifier interface to the rule builder (e.g. rule.messageVerifier(new MyMessageVerifier())). -If you don’t do this, then whenever you try to send a message an exception will be thrown.

6.4.1 Maven settings

The stub downloader honors Maven settings for a different local repository folder. -Authentication details for repositories and profiles are currently not taken into account, so you need to specify it using the properties mentioned above.

6.4.2 Providing fixed ports

You can also run your stubs on fixed ports. You can do it in two different ways. One is to pass it in the properties, and the other via fluent API of -JUnit rule.

6.4.3 Fluent API

When using the StubRunnerRule or StubRunnerExtension you can add a stub to download and then pass the port for the last downloaded stub.

@ClassRule
-public static StubRunnerRule rule = new StubRunnerRule().repoRoot(repoRoot())
-		.stubsMode(StubRunnerProperties.StubsMode.REMOTE)
-		.downloadStub("org.springframework.cloud.contract.verifier.stubs",
-				"loanIssuance")
-		.withPort(12345).downloadStub(
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer:12346");
-
-@BeforeClass
-@AfterClass
-public static void setupProps() {
-	System.clearProperty("stubrunner.repository.root");
-	System.clearProperty("stubrunner.classifier");
-}

You can see that for this example the following test is valid:

then(rule.findStubUrl("loanIssuance"))
-		.isEqualTo(URI.create("http://localhost:12345").toURL());
-then(rule.findStubUrl("fraudDetectionServer"))
-		.isEqualTo(URI.create("http://localhost:12346").toURL());

6.4.4 Stub Runner with Spring

Sets up Spring configuration of the Stub Runner project.

By providing a list of stubs inside your configuration file the Stub Runner automatically downloads -and registers in WireMock the selected stubs.

If you want to find the URL of your stubbed dependency you can autowire the StubFinder interface and use -its methods as presented below:

@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
-@SpringBootTest(properties = [" stubrunner.cloud.enabled=false",
-		'foo=${stubrunner.runningstubs.fraudDetectionServer.port}',
-		'fooWithGroup=${stubrunner.runningstubs.org.springframework.cloud.contract.verifier.stubs.fraudDetectionServer.port}'])
-@AutoConfigureStubRunner(mappingsOutputFolder = "target/outputmappings/",
-		httpServerStubConfigurer = HttpsForFraudDetection)
-@ActiveProfiles("test")
-class StubRunnerConfigurationSpec extends Specification {
-
-	@Autowired
-	StubFinder stubFinder
-	@Autowired
-	Environment environment
-	@StubRunnerPort("fraudDetectionServer")
-	int fraudDetectionServerPort
-	@StubRunnerPort("org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer")
-	int fraudDetectionServerPortWithGroupId
-	@Value('${foo}')
-	Integer foo
-
-	@BeforeClass
-	@AfterClass
-	void setupProps() {
-		System.clearProperty("stubrunner.repository.root")
-		System.clearProperty("stubrunner.classifier")
-	}
-
-	def 'should start WireMock servers'() {
-		expect: 'WireMocks are running'
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance') != null
-			stubFinder.findStubUrl('loanIssuance') != null
-			stubFinder.findStubUrl('loanIssuance') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs', 'loanIssuance')
-			stubFinder.findStubUrl('loanIssuance') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance')
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT') == stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT:stubs')
-			stubFinder.findStubUrl('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer') != null
-		and:
-			stubFinder.findAllRunningStubs().isPresent('loanIssuance')
-			stubFinder.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs', 'fraudDetectionServer')
-			stubFinder.findAllRunningStubs().isPresent('org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer')
-		and: 'Stubs were registered'
-			"${stubFinder.findStubUrl('loanIssuance').toString()}/name".toURL().text == 'loanIssuance'
-			"${stubFinder.findStubUrl('fraudDetectionServer').toString()}/name".toURL().text == 'fraudDetectionServer'
-		and: 'Fraud Detection is an HTTPS endpoint'
-			stubFinder.findStubUrl('fraudDetectionServer').toString().startsWith("https")
-	}
-
-	def 'should throw an exception when stub is not found'() {
-		when:
-			stubFinder.findStubUrl('nonExistingService')
-		then:
-			thrown(StubNotFoundException)
-		when:
-			stubFinder.findStubUrl('nonExistingGroupId', 'nonExistingArtifactId')
-		then:
-			thrown(StubNotFoundException)
-	}
-
-	def 'should register started servers as environment variables'() {
-		expect:
-			environment.getProperty("stubrunner.runningstubs.loanIssuance.port") != null
-			stubFinder.findAllRunningStubs().getPort("loanIssuance") == (environment.getProperty("stubrunner.runningstubs.loanIssuance.port") as Integer)
-		and:
-			environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") != null
-			stubFinder.findAllRunningStubs().getPort("fraudDetectionServer") == (environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") as Integer)
-		and:
-			environment.getProperty("stubrunner.runningstubs.fraudDetectionServer.port") != null
-			stubFinder.findAllRunningStubs().getPort("fraudDetectionServer") == (environment.getProperty("stubrunner.runningstubs.org.springframework.cloud.contract.verifier.stubs.fraudDetectionServer.port") as Integer)
-	}
-
-	def 'should be able to interpolate a running stub in the passed test property'() {
-		given:
-			int fraudPort = stubFinder.findAllRunningStubs().getPort("fraudDetectionServer")
-		expect:
-			fraudPort > 0
-			environment.getProperty("foo", Integer) == fraudPort
-			environment.getProperty("fooWithGroup", Integer) == fraudPort
-			foo == fraudPort
-	}
-
-	@Issue("#573")
-	def 'should be able to retrieve the port of a running stub via an annotation'() {
-		given:
-			int fraudPort = stubFinder.findAllRunningStubs().getPort("fraudDetectionServer")
-		expect:
-			fraudPort > 0
-			fraudDetectionServerPort == fraudPort
-			fraudDetectionServerPortWithGroupId == fraudPort
-	}
-
-	def 'should dump all mappings to a file'() {
-		when:
-			def url = stubFinder.findStubUrl("fraudDetectionServer")
-		then:
-			new File("target/outputmappings/", "fraudDetectionServer_${url.port}").exists()
-	}
-
-	@Configuration
-	@EnableAutoConfiguration
-	static class Config {}
-
-	@CompileStatic
-	static class HttpsForFraudDetection extends WireMockHttpServerStubConfigurer {
-
-		private static final Log log = LogFactory.getLog(HttpsForFraudDetection)
-
-		@Override
-		WireMockConfiguration configure(WireMockConfiguration httpStubConfiguration, HttpServerStubConfiguration httpServerStubConfiguration) {
-			if (httpServerStubConfiguration.stubConfiguration.artifactId == "fraudDetectionServer") {
-				int httpsPort = SocketUtils.findAvailableTcpPort()
-				log.info("Will set HTTPs port [" + httpsPort + "] for fraud detection server")
-				return httpStubConfiguration
-						.httpsPort(httpsPort)
-			}
-			return httpStubConfiguration
-		}
-	}
-}

for the following configuration file:

stubrunner:
-  repositoryRoot: classpath:m2repo/repository/
-  ids:
-    - org.springframework.cloud.contract.verifier.stubs:loanIssuance
-    - org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer
-    - org.springframework.cloud.contract.verifier.stubs:bootService
-  stubs-mode: remote

Instead of using the properties you can also use the properties inside the @AutoConfigureStubRunner. -Below you can find an example of achieving the same result by setting values on the annotation.

@AutoConfigureStubRunner(
-		ids = ["org.springframework.cloud.contract.verifier.stubs:loanIssuance",
-				"org.springframework.cloud.contract.verifier.stubs:fraudDetectionServer",
-				"org.springframework.cloud.contract.verifier.stubs:bootService"],
-		stubsMode = StubRunnerProperties.StubsMode.REMOTE,
-		repositoryRoot = "classpath:m2repo/repository/")

Stub Runner Spring registers environment variables in the following manner -for every registered WireMock server. Example for Stub Runner ids - com.example:foo, com.example:bar.

  • stubrunner.runningstubs.foo.port
  • stubrunner.runningstubs.com.example.foo.port
  • stubrunner.runningstubs.bar.port
  • stubrunner.runningstubs.com.example.bar.port

Which you can reference in your code.

You can also use the @StubRunnerPort annotation to inject the port of a running stub. -Value of the annotation can be the groupid:artifactid or just the artifactid. Example for Stub Runner ids -com.example:foo, com.example:bar.

@StubRunnerPort("foo")
-int fooPort;
-@StubRunnerPort("com.example:bar")
-int barPort;

6.5 Stub Runner Spring Cloud

Stub Runner can integrate with Spring Cloud.

For real life examples you can check the

6.5.1 Stubbing Service Discovery

The most important feature of Stub Runner Spring Cloud is the fact that it’s stubbing

  • DiscoveryClient
  • Ribbon ServerList

that means that regardless of the fact whether you’re using Zookeeper, Consul, Eureka or anything else, you don’t need that in your tests. -We’re starting WireMock instances of your dependencies and we’re telling your application whenever you’re using Feign, load balanced RestTemplate -or DiscoveryClient directly, to call those stubbed servers instead of calling the real Service Discovery tool.

For example this test will pass

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'
-	and: 'Stubs can be reached via load service discovery'
-		restTemplate.getForObject('http://loanIssuance/name', String) == 'loanIssuance'
-		restTemplate.getForObject('http://someNameThatShouldMapFraudDetectionServer/name', String) == 'fraudDetectionServer'
-}

for the following configuration file

stubrunner:
-  idsToServiceIds:
-    ivyNotation: someValueInsideYourCode
-    fraudDetectionServer: someNameThatShouldMapFraudDetectionServer

Test profiles and service discovery

In your integration tests you typically don’t want to call neither a discovery service (e.g. Eureka) -or Config Server. That’s why you create an additional test configuration in which you want to disable -these features.

Due to certain limitations of spring-cloud-commons to achieve this you have disable these properties -via a static block like presented below (example for Eureka)

    //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");
-    }

6.5.2 Additional Configuration

You can match the artifactId of the stub with the name of your app by using the stubrunner.idsToServiceIds: map. -You can disable Stub Runner Ribbon support by providing: stubrunner.cloud.ribbon.enabled equal to false -You can disable Stub Runner support by providing: stubrunner.cloud.enabled equal to false

[Tip]Tip

By default all service discovery will be stubbed. That means that regardless of the fact if you have -an existing DiscoveryClient its results will be ignored. However, if you want to reuse it, just set - stubrunner.cloud.delegate.enabled to true and then your existing DiscoveryClient results will be - merged with the stubbed ones.

The default Maven configuration used by Stub Runner can be tweaked either -via the following system properties or environment variables

  • maven.repo.local - path to the custom maven local repository location
  • org.apache.maven.user-settings - path to custom maven user settings location
  • org.apache.maven.global-settings - path to maven global settings location

6.6 Stub Runner Boot Application

Spring Cloud Contract Stub Runner Boot is a Spring Boot application that exposes REST endpoints to -trigger the messaging labels and to access started WireMock servers.

One of the use-cases is to run some smoke (end to end) tests on a deployed application. -You can check out the Spring Cloud Pipelines -project for more information.

6.6.1 How to use it?

Stub Runner Server

Just add the

compile "org.springframework.cloud:spring-cloud-starter-stub-runner"

Annotate a class with @EnableStubRunnerServer, build a fat-jar and you’re ready to go!

For the properties check the Stub Runner Spring section.

Stub Runner Server Fat Jar

You can download a standalone JAR from Maven (e.g. for version 2.0.1.RELEASE), as follows:

$ wget -O stub-runner.jar 'https://search.maven.org/remotecontent?filepath=org/springframework/cloud/spring-cloud-contract-stub-runner-boot/2.0.1.RELEASE/spring-cloud-contract-stub-runner-boot-2.0.1.RELEASE.jar'
-$ java -jar stub-runner.jar --stubrunner.ids=... --stubrunner.repositoryRoot=...

Spring Cloud CLI

Starting from 1.4.0.RELEASE version of the Spring Cloud CLI -project you can start Stub Runner Boot by executing spring cloud stubrunner.

In order to pass the configuration just create a stubrunner.yml file in the current working directory -or a subdirectory called config or in ~/.spring-cloud. The file could look like this -(example for running stubs installed locally)

stubrunner.yml.  -

stubrunner:
-  stubsMode: LOCAL
-  ids:
-    - com.example:beer-api-producer:+:9876

-

and then just call spring cloud stubrunner from your terminal window to start -the Stub Runner server. It will be available at port 8750.

6.6.2 Endpoints

HTTP

  • GET /stubs - returns a list of all running stubs in ivy:integer notation
  • GET /stubs/{ivy} - returns a port for the given ivy notation (when calling the endpoint ivy can also be artifactId only)

Messaging

For Messaging

  • GET /triggers - returns a list of all running labels in ivy : [ label1, label2 …​] notation
  • POST /triggers/{label} - executes a trigger with label
  • POST /triggers/{ivy}/{label} - executes a trigger with label for the given ivy notation (when calling the endpoint ivy can also be artifactId only)

6.6.3 Example

@ContextConfiguration(classes = StubRunnerBoot, loader = SpringBootContextLoader)
-@SpringBootTest(properties = "spring.cloud.zookeeper.enabled=false")
-@ActiveProfiles("test")
-class StubRunnerBootSpec extends Specification {
-
-	@Autowired
-	StubRunning stubRunning
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning),
-				new TriggerController(stubRunning))
-	}
-
-	def 'should return a list of running stub servers in "full ivy:port" notation'() {
-		when:
-			String response = RestAssuredMockMvc.get('/stubs').body.asString()
-		then:
-			def root = new JsonSlurper().parseText(response)
-			root.'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs' instanceof Integer
-	}
-
-	def 'should return a port on which a [#stubId] stub is running'() {
-		when:
-			def response = RestAssuredMockMvc.get("/stubs/${stubId}")
-		then:
-			response.statusCode == 200
-			Integer.valueOf(response.body.asString()) > 0
-		where:
-			stubId << ['org.springframework.cloud.contract.verifier.stubs:bootService:+:stubs',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService:+',
-					   'org.springframework.cloud.contract.verifier.stubs:bootService',
-					   'bootService']
-	}
-
-	def 'should return 404 when missing stub was called'() {
-		when:
-			def response = RestAssuredMockMvc.get("/stubs/a:b:c:d")
-		then:
-			response.statusCode == 404
-	}
-
-	def 'should return a list of messaging labels that can be triggered when version and classifier are passed'() {
-		when:
-			String response = RestAssuredMockMvc.get('/triggers').body.asString()
-		then:
-			def root = new JsonSlurper().parseText(response)
-			root.'org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs'?.containsAll(["delete_book", "return_book_1", "return_book_2"])
-	}
-
-	def 'should trigger a messaging label'() {
-		given:
-			StubRunning stubRunning = Mock()
-			RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning), new TriggerController(stubRunning))
-		when:
-			def response = RestAssuredMockMvc.post("/triggers/delete_book")
-		then:
-			response.statusCode == 200
-		and:
-			1 * stubRunning.trigger('delete_book')
-	}
-
-	def 'should trigger a messaging label for a stub with [#stubId] ivy notation'() {
-		given:
-			StubRunning stubRunning = Mock()
-			RestAssuredMockMvc.standaloneSetup(new HttpStubsController(stubRunning), new TriggerController(stubRunning))
-		when:
-			def response = RestAssuredMockMvc.post("/triggers/$stubId/delete_book")
-		then:
-			response.statusCode == 200
-		and:
-			1 * stubRunning.trigger(stubId, 'delete_book')
-		where:
-			stubId << ['org.springframework.cloud.contract.verifier.stubs:bootService:stubs', 'org.springframework.cloud.contract.verifier.stubs:bootService', 'bootService']
-	}
-
-	def 'should throw exception when trigger is missing'() {
-		when:
-			RestAssuredMockMvc.post("/triggers/missing_label")
-		then:
-			Exception e = thrown(Exception)
-			e.message.contains("Exception occurred while trying to return [missing_label] label.")
-			e.message.contains("Available labels are")
-			e.message.contains("org.springframework.cloud.contract.verifier.stubs:loanIssuance:0.0.1-SNAPSHOT:stubs=[]")
-			e.message.contains("org.springframework.cloud.contract.verifier.stubs:bootService:0.0.1-SNAPSHOT:stubs=")
-	}
-
-}

6.6.4 Stub Runner Boot with Service Discovery

One of the possibilities of using Stub Runner Boot is to use it as a feed of stubs for "smoke-tests". What does it mean? - Let’s assume that you don’t want to deploy 50 microservice to a test environment in order - to check if your application is working fine. You’ve already executed a suite of tests during the build process - but you would also like to ensure that the packaging of your application is fine. What you can do - is to deploy your application to an environment, start it and run a couple of tests on it to see if - it’s working fine. We can call those tests smoke-tests since their idea is to check only a handful - of testing scenarios.

The problem with this approach is such that if you’re doing microservices most likely you’re - using a service discovery tool. Stub Runner Boot allows you to solve this issue by starting the - required stubs and register them in a service discovery tool. Let’s take a look at an example of - such a setup with Eureka. Let’s assume that Eureka was already running.

@SpringBootApplication
-@EnableStubRunnerServer
-@EnableEurekaClient
-@AutoConfigureStubRunner
-public class StubRunnerBootEurekaExample {
-
-	public static void main(String[] args) {
-		SpringApplication.run(StubRunnerBootEurekaExample.class, args);
-	}
-
-}

As you can see we want to start a Stub Runner Boot server @EnableStubRunnerServer, enable Eureka client @EnableEurekaClient -and we want to have the stub runner feature turned on @AutoConfigureStubRunner.

Now let’s assume that we want to start this application so that the stubs get automatically registered. - We can do it by running the app java -jar ${SYSTEM_PROPS} stub-runner-boot-eureka-example.jar where - ${SYSTEM_PROPS} would contain the following list of properties

* -Dstubrunner.repositoryRoot=https://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)
-*
-* (1) - we tell Stub Runner where all the stubs reside (2) - we don't want the default
-* behaviour where the discovery service is stubbed. That's why the stub registration will
-* be picked (3) - we provide a list of stubs to download (4) - we provide a list of

That way your deployed application can send requests to started WireMock servers via the service -discovery. Most likely points 1-3 could be set by default in application.yml cause they are not -likely to change. That way you can provide only the list of stubs to download whenever you start -the Stub Runner Boot.

6.7 Stubs Per Consumer

There are cases in which 2 consumers of the same endpoint want to have 2 different responses.

[Tip]Tip

This approach also allows you to immediately know which consumer is using which part of your API. -You can remove part of a response that your API produces and you can see which of your autogenerated tests -fails. If none fails then you can safely delete that part of the response cause nobody is using it.

Let’s look at the following example for contract defined for the producer called producer. -There are 2 consumers: foo-consumer and bar-consumer.

Consumer foo-service

request {
-   url '/foo'
-   method GET()
-}
-response {
-    status OK()
-    body(
-       foo: "foo"
-    }
-}

Consumer bar-service

request {
-   url '/foo'
-   method GET()
-}
-response {
-    status OK()
-    body(
-       bar: "bar"
-    }
-}

You can’t produce for the same request 2 different responses. That’s why you can properly package the -contracts and then profit from the stubsPerConsumer feature.

On the producer side the consumers can have a folder that contains contracts related only to them. -By setting the stubrunner.stubs-per-consumer flag to true we no longer register all stubs but only those that -correspond to the consumer application’s name. In other words we’ll scan the path of every stub and -if it contains the subfolder with name of the consumer in the path only then will it get registered.

On the foo producer side the contracts would look like this

.
-└── contracts
-    ├── bar-consumer
-    │   ├── bookReturnedForBar.groovy
-    │   └── shouldCallBar.groovy
-    └── foo-consumer
-        ├── bookReturnedForFoo.groovy
-        └── shouldCallFoo.groovy

Being the bar-consumer consumer you can either set the spring.application.name or the stubrunner.consumer-name to bar-consumer -Or set the test as follows:

@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/",
-		stubsMode = StubRunnerProperties.StubsMode.REMOTE,
-		stubsPerConsumer = true)
-class StubRunnerStubsPerConsumerSpec extends Specification {
-...
-}

Then only the stubs registered under a path that contains the bar-consumer in its name (i.e. those from the -src/test/resources/contracts/bar-consumer/some/contracts/…​ folder) will be allowed to be referenced.

Or set the consumer name explicitly

@ContextConfiguration(classes = Config, loader = SpringBootContextLoader)
-@SpringBootTest
-@AutoConfigureStubRunner(ids = "org.springframework.cloud.contract.verifier.stubs:producerWithMultipleConsumers",
-		repositoryRoot = "classpath:m2repo/repository/",
-		consumerName = "foo-consumer",
-		stubsMode = StubRunnerProperties.StubsMode.REMOTE,
-		stubsPerConsumer = true)
-class StubRunnerStubsPerConsumerWithConsumerNameSpec extends Specification {
-...
-}

Then only the stubs registered under a path that contains the foo-consumer in its name (i.e. those from the -src/test/resources/contracts/foo-consumer/some/contracts/…​ folder) will be allowed to be referenced.

You can check out issue 224 for more -information about the reasons behind this change.

6.8 Common

This section briefly describes common properties, including:

6.8.1 Common Properties for JUnit and Spring

You can set repetitive properties by using system properties or Spring configuration -properties. Here are their names with their default values:

Property nameDefault valueDescription

stubrunner.minPort

10000

Minimum value of a port for a started WireMock with stubs.

stubrunner.maxPort

15000

Maximum value of a port for a started WireMock with stubs.

stubrunner.repositoryRoot

 

Maven repo URL. If blank, then call the local maven repo.

stubrunner.classifier

stubs

Default classifier for the stub artifacts.

stubrunner.stubsMode

CLASSPATH

The way you want to fetch and register the stubs

stubrunner.ids

 

Array of Ivy notation stubs to download.

stubrunner.username

 

Optional username to access the tool that stores the JARs with -stubs.

stubrunner.password

 

Optional password to access the tool that stores the JARs with -stubs.

stubrunner.stubsPerConsumer

false

Set to true if you want to use different stubs for -each consumer instead of registering all stubs for every consumer.

stubrunner.consumerName

 

If you want to use a stub for each consumer and want to -override the consumer name just change this value.

6.8.2 Stub Runner Stubs IDs

You can provide the stubs to download via the stubrunner.ids system property. They -follow this pattern:

groupId:artifactId:version:classifier:port

Note that version, classifier and port are optional.

  • If you do not provide the port, a random one will be picked.
  • If you do not provide the classifier, the default is used. (Note that you can -pass an empty classifier this way: groupId:artifactId:version:).
  • If you do not provide the version, then the + will be passed and the latest one is -downloaded.

port means the port of the WireMock server.

[Important]Important

Starting with version 1.0.4, you can provide a range of versions that you -would like the Stub Runner to take into consideration. You can read more about the -Aether versioning -ranges here.

6.9 Stub Runner Docker

We’re publishing a spring-cloud/spring-cloud-contract-stub-runner Docker image -that will start the standalone version of Stub Runner.

If you want to learn more about the basics of Maven, artifact ids, -group ids, classifiers and Artifact Managers, just click here Section 4.5, “Docker Project”.

6.9.1 How to use it

Just execute the docker image. You can pass any of the Section 6.8.1, “Common Properties for JUnit and Spring” -as environment variables. The convention is that all the -letters should be upper case. The camel case notation should -and the dot (.) should be separated via underscore (_). E.g. - the stubrunner.repositoryRoot property should be represented - as a STUBRUNNER_REPOSITORY_ROOT environment variable.

6.9.2 Example of client side usage in a non JVM project

We’d like to use the stubs created in this Section 4.5.4, “Server side (nodejs)” step. -Let’s assume that we want to run the stubs on port 9876. The NodeJS code -is available here:

$ git clone https://github.com/spring-cloud-samples/spring-cloud-contract-nodejs
-$ cd bookstore

Let’s run the Stub Runner Boot application with the stubs.

# Provide the Spring Cloud Contract Docker version
-$ SC_CONTRACT_DOCKER_VERSION="..."
-# The IP at which the app is running and Docker container can reach it
-$ APP_IP="192.168.0.100"
-# Spring Cloud Contract Stub Runner properties
-$ STUBRUNNER_PORT="8083"
-# Stub coordinates 'groupId:artifactId:version:classifier:port'
-$ STUBRUNNER_IDS="com.example:bookstore:0.0.1.RELEASE:stubs:9876"
-$ STUBRUNNER_REPOSITORY_ROOT="http://${APP_IP}:8081/artifactory/libs-release-local"
-# Run the docker with Stub Runner Boot
-$ docker run  --rm -e "STUBRUNNER_IDS=${STUBRUNNER_IDS}" -e "STUBRUNNER_REPOSITORY_ROOT=${STUBRUNNER_REPOSITORY_ROOT}" -e "STUBRUNNER_STUBS_MODE=REMOTE" -p "${STUBRUNNER_PORT}:${STUBRUNNER_PORT}" -p "9876:9876" springcloud/spring-cloud-contract-stub-runner:"${SC_CONTRACT_DOCKER_VERSION}"

What’s happening is that

  • a standalone Stub Runner application got started
  • it downloaded the stub with coordinates com.example:bookstore:0.0.1.RELEASE:stubs on port 9876
  • it got downloaded from Artifactory running at http://192.168.0.100:8081/artifactory/libs-release-local
  • after a while Stub Runner will be running on port 8083
  • and the stubs will be running at port 9876

On the server side we built a stateful stub. Let’s use curl to assert -that the stubs are setup properly.

# let's execute the first request (no response is returned)
-$ curl -H "Content-Type:application/json" -X POST --data '{ "title" : "Title", "genre" : "Genre", "description" : "Description", "author" : "Author", "publisher" : "Publisher", "pages" : 100, "image_url" : "https://d213dhlpdb53mu.cloudfront.net/assets/pivotal-square-logo-41418bd391196c3022f3cd9f3959b3f6d7764c47873d858583384e759c7db435.svg", "buy_url" : "https://pivotal.io" }' http://localhost:9876/api/books
-# Now time for the second request
-$ curl -X GET http://localhost:9876/api/books
-# You will receive contents of the JSON
[Important]Important

If you want use the stubs that you have built locally, on your host, -then you should pass the environment variable -e STUBRUNNER_STUBS_MODE=LOCAL and mount -the volume of your local m2 -v "${HOME}/.m2/:/root/.m2:ro"

7. Stub Runner for Messaging

Stub Runner can run the published stubs in memory. It can integrate with the following -frameworks:

  • Spring Integration
  • Spring Cloud Stream
  • Apache Camel
  • Spring AMQP

It also provides entry points to integrate with any other solution on the market.

[Important]Important

If you have multiple frameworks on the classpath Stub Runner will need to -define which one should be used. Let’s assume that you have both AMQP, Spring Cloud Stream and Spring Integration -on the classpath. Then you need to set stubrunner.stream.enabled=false and stubrunner.integration.enabled=false. -That way the only remaining framework is Spring AMQP.

7.1 Stub triggering

To trigger a message, use the StubTrigger interface:

package org.springframework.cloud.contract.stubrunner;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * Contract for triggering stub messages.
- *
- * @author Marcin Grzejszczak
- */
-public interface StubTrigger {
-
-	/**
-	 * Triggers an event by a given label for a given {@code groupid:artifactid} notation.
-	 * You can use only {@code artifactId} too.
-	 *
-	 * Feature related to messaging.
-	 * @param ivyNotation ivy notation of a stub
-	 * @param labelName name of the label to trigger
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger(String ivyNotation, String labelName);
-
-	/**
-	 * Triggers an event by a given label.
-	 *
-	 * Feature related to messaging.
-	 * @param labelName name of the label to trigger
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger(String labelName);
-
-	/**
-	 * Triggers all possible events.
-	 *
-	 * Feature related to messaging.
-	 * @return true - if managed to run a trigger
-	 */
-	boolean trigger();
-
-	/**
-	 * Feature related to messaging.
-	 * @return a mapping of ivy notation of a dependency to all the labels it has.
-	 */
-	Map<String, Collection<String>> labels();
-
-}

For convenience, the StubFinder interface extends StubTrigger, so you only need one -or the other in your tests.

StubTrigger gives you the following options to trigger a message:

7.1.1 Trigger by Label

stubFinder.trigger('return_book_1')

7.1.2 Trigger by Group and Artifact Ids

stubFinder.trigger('org.springframework.cloud.contract.verifier.stubs:streamService', 'return_book_1')

7.1.3 Trigger by Artifact Ids

stubFinder.trigger('streamService', 'return_book_1')

7.1.4 Trigger All Messages

stubFinder.trigger()

7.2 Stub Runner Camel

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to integrate with Apache Camel. -For the provided artifacts it will automatically download the stubs and register the required -routes.

7.2.1 Adding it to the project

It’s enough to have both Apache Camel and Spring Cloud Contract Stub Runner on classpath. -Remember to annotate your test class with @AutoConfigureStubRunner.

7.2.2 Disabling the functionality

If you need to disable this functionality just pass stubrunner.camel.enabled=false property.

7.2.3 Examples

Stubs structure

Let us assume that we have the following Maven repository with a deployed stubs for the -camelService application.

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── camelService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── camelService-0.0.1-SNAPSHOT.pom
-                            │   ├── camelService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

And the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Let’s consider the following contracts (let' number it with 1):

Contract.make {
-	label 'return_book_1'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('jms:output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and number 2

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('jms:input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('jms:output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			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 = 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.

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.

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 -stubrunner.integration.enabled=false property.

Assume that you have the following Maven repository with deployed stubs for the -integrationService application:

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── integrationService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── integrationService-0.0.1-SNAPSHOT.pom
-                            │   ├── integrationService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

Further assume the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Consider the following contracts (numbered 1):

Contract.make {
-	label 'return_book_1'
-	input {
-		triggeredBy('bookReturnedTriggered()')
-	}
-	outputMessage {
-		sentTo('output')
-		body('''{ "bookName" : "foo" }''')
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

Now consider 2:

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('input')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

and the following Spring Integration Route:

<?xml version="1.0" encoding="UTF-8"?>
-<beans:beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-			 xmlns:beans="http://www.springframework.org/schema/beans"
-			 xmlns="http://www.springframework.org/schema/integration"
-			 xsi:schemaLocation="http://www.springframework.org/schema/beans
-			https://www.springframework.org/schema/beans/spring-beans.xsd
-			http://www.springframework.org/schema/integration
-			https://www.springframework.org/schema/integration/spring-integration.xsd">
-
-
-	<!-- REQUIRED FOR TESTING -->
-	<bridge input-channel="output"
-			output-channel="outputTest"/>
-
-	<channel id="outputTest">
-		<queue/>
-	</channel>
-
-</beans:beans>

These examples lend themselves to three scenarios:

Scenario 1 (no input message)

To trigger a message via the return_book_1 label, use the StubTigger interface, as -follows:

stubFinder.trigger('return_book_1')

To listen to the output of the message sent to output:

Message<?> receivedMessage = messaging.receive('outputTest')

The received message would pass the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input)

Since the route is set for you, you can send a message to the output -destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'input')

To listen to the output of the message sent to output:

Message<?> receivedMessage = messaging.receive('outputTest')

The received message passes the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 3 (input with no output)

Since the route is set for you, you can send a message to the input destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')

7.4 Stub Runner Stream

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

[Warning]Warning

If Stub Runner’s integration with Stream the messageFrom or sentTo Strings -are resolved first as a destination of a channel and no such destination exists, the -destination is resolved as a channel name.

[Important]Important

If you want to use Spring Cloud Stream remember, to add a dependency on -org.springframework.cloud:spring-cloud-stream-test-support.

Maven.  -

<dependency>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-stream-test-support</artifactId>
-    <scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-stream-test-support"

-

7.4.1 Adding the Runner to the Project

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

7.4.2 Disabling the functionality

If you need to disable this functionality, set the stubrunner.stream.enabled=false -property.

Assume that you have the following Maven repository with a deployed stubs for the -streamService application:

└── .m2
-    └── repository
-        └── io
-            └── codearte
-                └── accurest
-                    └── stubs
-                        └── streamService
-                            ├── 0.0.1-SNAPSHOT
-                            │   ├── streamService-0.0.1-SNAPSHOT.pom
-                            │   ├── streamService-0.0.1-SNAPSHOT-stubs.jar
-                            │   └── maven-metadata-local.xml
-                            └── maven-metadata-local.xml

Further assume the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── repository
-    ├── accurest
-    │   ├── bookDeleted.groovy
-    │   ├── bookReturned1.groovy
-    │   └── bookReturned2.groovy
-    └── mappings

Consider the following contracts (numbered 1):

Contract.make {
-	label 'return_book_1'
-	input { triggeredBy('bookReturnedTriggered()') }
-	outputMessage {
-		sentTo('returnBook')
-		body('''{ "bookName" : "foo" }''')
-		headers { header('BOOK-NAME', 'foo') }
-	}
-}

Now consider 2:

Contract.make {
-	label 'return_book_2'
-	input {
-		messageFrom('bookStorage')
-		messageBody([
-				bookName: 'foo'
-		])
-		messageHeaders { header('sample', 'header') }
-	}
-	outputMessage {
-		sentTo('returnBook')
-		body([
-				bookName: 'foo'
-		])
-		headers { header('BOOK-NAME', 'foo') }
-	}
-}

Now consider the following Spring configuration:

stubrunner.repositoryRoot: classpath:m2repo/repository/
-stubrunner.ids: org.springframework.cloud.contract.verifier.stubs:streamService:0.0.1-SNAPSHOT:stubs
-stubrunner.stubs-mode: remote
-spring:
-  cloud:
-    stream:
-      bindings:
-        output:
-          destination: returnBook
-        input:
-          destination: bookStorage
-
-server:
-  port: 0
-
-debug: true

These examples lend themselves to three scenarios:

Scenario 1 (no input message)

To trigger a message via the return_book_1 label, use the StubTrigger interface as -follows:

stubFinder.trigger('return_book_1')

To listen to the output of the message sent to a channel whose destination is -returnBook:

Message<?> receivedMessage = messaging.receive('returnBook')

The received message passes the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 2 (output triggered by input)

Since the route is set for you, you can send a message to the bookStorage -destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'bookStorage')

To listen to the output of the message sent to returnBook:

Message<?> receivedMessage = messaging.receive('returnBook')

The received message passes the following assertions:

receivedMessage != null
-assertJsons(receivedMessage.payload)
-receivedMessage.headers.get('BOOK-NAME') == 'foo'

Scenario 3 (input with no output)

Since the route is set for you, you can send a message to the output -destination:

messaging.send(new BookReturned('foo'), [sample: 'header'], 'delete')

7.5 Stub Runner Spring AMQP

Spring Cloud Contract Verifier Stub Runner’s messaging module provides an easy way to -integrate with Spring AMQP’s Rabbit Template. For the provided artifacts, it -automatically downloads the stubs and registers the required routes.

The integration tries to work standalone (that is, without interaction with a running -RabbitMQ message broker). It expects a RabbitTemplate on the application context and -uses it as a spring boot test named @SpyBean. As a result, it can use the mockito spy -functionality to verify and inspect messages sent by the application.

On the message consumer side, the stub runner considers all @RabbitListener annotated -endpoints and all SimpleMessageListenerContainer objects on the application context.

As messages are usually sent to exchanges in AMQP, the message contract contains the -exchange name as the destination. Message listeners on the other side are bound to -queues. Bindings connect an exchange to a queue. If message contracts are triggered, the -Spring AMQP stub runner integration looks for bindings on the application context that -match this exchange. Then it collects the queues from the Spring exchanges and tries to -find message listeners bound to these queues. The message is triggered for all matching -message listeners.

If you need to work with routing keys, it’s enough to pass them via the amqp_receivedRoutingKey -messaging header.

7.5.1 Adding the Runner to the Project

You can have both Spring AMQP and Spring Cloud Contract Stub Runner on the classpath and -set the property stubrunner.amqp.enabled=true. Remember to annotate your test class -with @AutoConfigureStubRunner.

[Important]Important

If you already have Stream and Integration on the classpath, you need -to disable them explicitly by setting the stubrunner.stream.enabled=false and -stubrunner.integration.enabled=false properties.

Assume that you have the following Maven repository with a deployed stubs for the -spring-cloud-contract-amqp-test application.

└── .m2
-    └── repository
-        └── com
-            └── example
-                └── spring-cloud-contract-amqp-test
-                    ├── 0.4.0-SNAPSHOT
-                    │   ├── spring-cloud-contract-amqp-test-0.4.0-SNAPSHOT.pom
-                    │   ├── spring-cloud-contract-amqp-test-0.4.0-SNAPSHOT-stubs.jar
-                    │   └── maven-metadata-local.xml
-                    └── maven-metadata-local.xml

Further assume that the stubs contain the following structure:

├── META-INF
-│   └── MANIFEST.MF
-└── contracts
-    └── shouldProduceValidPersonData.groovy

Consider the following contract:

Contract.make {
-	// Human readable description
-	description 'Should produce valid person data'
-	// Label by means of which the output message can be triggered
-	label 'contract-test.person.created.event'
-	// input to the contract
-	input {
-		// the contract will be triggered by a method
-		triggeredBy('createPerson()')
-	}
-	// output message of the contract
-	outputMessage {
-		// destination to which the output message will be sent
-		sentTo 'contract-test.exchange'
-		headers {
-			header('contentType': 'application/json')
-			header('__TypeId__': 'org.springframework.cloud.contract.stubrunner.messaging.amqp.Person')
-		}
-		// the body of the output message
-		body([
-				id  : $(consumer(9), producer(regex("[0-9]+"))),
-				name: "me"
-		])
-	}
-}

Now consider the following Spring configuration:

stubrunner:
-  repositoryRoot: classpath:m2repo/repository/
-  ids: org.springframework.cloud.contract.verifier.stubs.amqp:spring-cloud-contract-amqp-test:0.4.0-SNAPSHOT:stubs
-  stubs-mode: remote
-  amqp:
-    enabled: true
-server:
-  port: 0

Triggering the message

To trigger a message using the contract above, use the StubTrigger interface as -follows:

stubTrigger.trigger("contract-test.person.created.event")

The message has a destination of contract-test.exchange, so the Spring AMQP stub runner -integration looks for bindings related to this exchange.

@Bean
-public Binding binding() {
-	return BindingBuilder.bind(new Queue("test.queue"))
-			.to(new DirectExchange("contract-test.exchange")).with("#");
-}

The binding definition binds the queue test.queue. As a result, the following listener -definition is matched and invoked with the contract message.

@Bean
-public SimpleMessageListenerContainer simpleMessageListenerContainer(
-		ConnectionFactory connectionFactory,
-		MessageListenerAdapter listenerAdapter) {
-	SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
-	container.setConnectionFactory(connectionFactory);
-	container.setQueueNames("test.queue");
-	container.setMessageListener(listenerAdapter);
-
-	return container;
-}

Also, the following annotated listener matches and is invoked:

@RabbitListener(bindings = @QueueBinding(value = @Queue("test.queue"), exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true")))
-public void handlePerson(Person person) {
-	this.person = person;
-}
[Note]Note

The message is directly handed over to the onMessage method of the -MessageListener associated with the matching SimpleMessageListenerContainer.

Spring AMQP Test Configuration

In order to avoid Spring AMQP trying to connect to a running broker during our tests -configure a mock ConnectionFactory.

To disable the mocked ConnectionFactory, set the following property: -stubrunner.amqp.mockConnection=false

stubrunner:
-  amqp:
-    mockConnection: false

8. Contract DSL

Spring Cloud Contract supports out of the box 2 types of DSL. One written in -Groovy and one written in YAML.

If you decide to write the contract in Groovy, do not be alarmed if you have not used Groovy -before. Knowledge of the language is not really needed, as the Contract DSL uses only a -tiny subset of it (only literals, method calls and closures). Also, the DSL is statically -typed, to make it programmer-readable without any knowledge of the DSL itself.

[Important]Important

Remember that, inside the Groovy contract file, you have to provide the fully -qualified name to the Contract class and make static imports, such as -org.springframework.cloud.spec.Contract.make { …​ }. You can also provide an import to -the Contract class: import org.springframework.cloud.spec.Contract and then call -Contract.make { …​ }.

[Tip]Tip

Spring Cloud Contract supports defining multiple contracts in a single file.

The following is a complete example of a Groovy contract definition:

The following is a complete example of a YAML contract definition:

description: Some description
-name: some name
-priority: 8
-ignored: true
-request:
-  url: /foo
-  queryParameters:
-    a: b
-    b: c
-  method: PUT
-  headers:
-    foo: bar
-    fooReq: baz
-  body:
-    foo: bar
-  matchers:
-    body:
-      - path: $.foo
-        type: by_regex
-        value: bar
-    headers:
-      - key: foo
-        regex: bar
-response:
-  status: 200
-  headers:
-    foo2: bar
-    foo3: foo33
-    fooRes: baz
-  body:
-    foo2: bar
-    foo3: baz
-    nullValue: null
-  matchers:
-    body:
-      - path: $.foo2
-        type: by_regex
-        value: bar
-      - path: $.foo3
-        type: by_command
-        value: executeMe($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-    headers:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        command: andMeToo($it)
[Tip]Tip

You can compile contracts to stubs mapping using standalone maven command: -mvn org.springframework.cloud:spring-cloud-contract-maven-plugin:convert

8.1 Limitations

[Warning]Warning

Spring Cloud Contract Verifier does not properly support XML. Please use JSON or -help us implement this feature.

[Warning]Warning

The support for verifying the size of JSON arrays is experimental. If you want -to turn it on, please set the value of the following system property to true: -spring.cloud.contract.verifier.assert.size. By default, this feature is set to false. -You can also provide the assertJsonSize property in the plugin configuration.

[Warning]Warning

Because JSON structure can have any form, it can be impossible to parse it -properly when using the Groovy DSL and the value(consumer(…​), producer(…​)) notation in GString. That -is why you should use the Groovy Map notation.

8.2 Common Top-Level elements

The following sections describe the most common top-level elements:

8.2.1 Description

You can add a description to your contract. The description is arbitrary text. The -following code shows an example:

Groovy DSL.  -

			org.springframework.cloud.contract.spec.Contract.make {
-				description('''
-given:
-	An input
-when:
-	Sth happens
-then:
-	Output
-''')
-			}

-

YAML.  -

description: Some description
-name: some name
-priority: 8
-ignored: true
-request:
-  url: /foo
-  queryParameters:
-    a: b
-    b: c
-  method: PUT
-  headers:
-    foo: bar
-    fooReq: baz
-  body:
-    foo: bar
-  matchers:
-    body:
-      - path: $.foo
-        type: by_regex
-        value: bar
-    headers:
-      - key: foo
-        regex: bar
-response:
-  status: 200
-  headers:
-    foo2: bar
-    foo3: foo33
-    fooRes: baz
-  body:
-    foo2: bar
-    foo3: baz
-    nullValue: null
-  matchers:
-    body:
-      - path: $.foo2
-        type: by_regex
-        value: bar
-      - path: $.foo3
-        type: by_command
-        value: executeMe($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-    headers:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        command: andMeToo($it)

-

8.2.2 Name

You can provide a name for your contract. Assume that you provided the following name: -should register a user. If you do so, the name of the autogenerated test is -validate_should_register_a_user. Also, the name of the stub in a WireMock stub is -should_register_a_user.json.

[Important]Important

You must ensure that the name does not contain any characters that make the -generated test not compile. Also, remember that, if you provide the same name for -multiple contracts, your autogenerated tests fail to compile and your generated stubs -override each other.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	name("some_special_name")
-}

-

YAML.  -

name: some name

-

8.2.3 Ignoring Contracts

If you want to ignore a contract, you can either set a value of ignored contracts in the -plugin configuration or set the ignored property on the contract itself:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	ignored()
-}

-

YAML.  -

ignored: true

-

8.2.4 Passing Values from Files

Starting with version 1.2.0, you can pass values from files. Assume that you have the -following resources in our project.

└── src
-    └── test
-        └── resources
-            └── contracts
-                ├── readFromFile.groovy
-                ├── request.json
-                └── response.json

Further assume that your contract is as follows:

Groovy DSL.  -

/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.springframework.cloud.contract.spec.Contract
-
-Contract.make {
-	request {
-		method('PUT')
-		headers {
-			contentType(applicationJson())
-		}
-		body(file("request.json"))
-		url("/1")
-	}
-	response {
-		status OK()
-		body(file("response.json"))
-		headers {
-			contentType(applicationJson())
-		}
-	}
-}

-

YAML.  -

request:
-  method: GET
-  url: /foo
-  bodyFromFile: request.json
-response:
-  status: 200
-  bodyFromFile: response.json

-

Further assume that the JSON files is as follows:

request.json

{
-  "status": "REQUEST"
-}

response.json

{
-  "status": "RESPONSE"
-}

When test or stub generation takes place, the contents of the file is passed to the body -of a request or a response. The name of the file needs to be a file with location -relative to the folder in which the contract lays.

If you need to pass the contents of a file in a binary form -it’s enough for you to use the fileAsBytes method in Groovy DSL or bodyFromFileAsBytes field in YAML.

Groovy DSL.  -

import org.springframework.cloud.contract.spec.Contract
-
-Contract.make {
-	request {
-		url("/1")
-		method(PUT())
-		headers {
-			contentType(applicationOctetStream())
-		}
-		body(fileAsBytes("request.pdf"))
-	}
-	response {
-		status 200
-		body(fileAsBytes("response.pdf"))
-		headers {
-			contentType(applicationOctetStream())
-		}
-	}
-}

-

YAML.  -

request:
-  url: /1
-  method: PUT
-  headers:
-    Content-Type: application/octet-stream
-  bodyFromFileAsBytes: request.pdf
-response:
-  status: 200
-  bodyFromFileAsBytes: response.pdf
-  headers:
-    Content-Type: application/octet-stream

-

[Important]Important

You should use this approach whenever you want to work with binary payloads both for HTTP and messaging.

8.2.5 HTTP Top-Level Elements

The following methods can be called in the top-level closure of a contract definition. -request and response are mandatory. priority is optional.

Groovy DSL.  -

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).
-	request {
-		method GET()
-		url "/foo"
-		//...
-	}
-
-	// Definition of HTTP response part of the contract
-	// (a service implementing this contract should respond
-	// with following response after receiving request
-	// specified in "request" part above).
-	response {
-		status 200
-		//...
-	}
-
-	// Contract priority, which can be used for overriding
-	// contracts (1 is highest). Priority is optional.
-	priority 1
-}

-

YAML.  -

priority: 8
-request:
-...
-response:
-...

-

[Important]Important

If you want to make your contract have a higher value of priority -you need to pass a lower number to the priority tag / method. E.g. priority with -value 5 has higher priority than priority with value 10.

8.3 Request

The HTTP protocol requires only method and url to be specified in a request. The -same information is mandatory in request definition of the Contract.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		// HTTP request method (GET/POST/PUT/DELETE).
-		method 'GET'
-
-		// Path component of request URL is specified as follows.
-		urlPath('/users')
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

method: PUT
-url: /foo

-

It is possible to specify an absolute rather than relative url, but using urlPath is -the recommended way, as doing so makes the tests host-independent.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'GET'
-
-		// Specifying `url` and `urlPath` in one contract is illegal.
-		url('http://localhost:8888/users')
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

request:
-  method: PUT
-  urlPath: /foo

-

request may contain query parameters.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-		method GET()
-
-		urlPath('/users') {
-
-			// Each parameter is specified in form
-			// `'paramName' : paramValue` where parameter value
-			// may be a simple literal or one of matcher functions,
-			// all of which are used in this example.
-			queryParameters {
-
-				// If a simple literal is used as value
-				// default matcher function is used (equalTo)
-				parameter 'limit': 100
-
-				// `equalTo` function simply compares passed value
-				// using identity operator (==).
-				parameter 'filter': equalTo("email")
-
-				// `containing` function matches strings
-				// that contains passed substring.
-				parameter 'gender': value(consumer(containing("[mf]")), producer('mf'))
-
-				// `matching` function tests parameter
-				// against passed regular expression.
-				parameter 'offset': value(consumer(matching("[0-9]+")), producer(123))
-
-				// `notMatching` functions tests if parameter
-				// does not match passed regular expression.
-				parameter 'loginStartsWith': value(consumer(notMatching(".{0,2}")), producer(3))
-			}
-		}
-
-		//...
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

request:
-...
-  queryParameters:
-    a: b
-    b: c
-  headers:
-    foo: bar
-    fooReq: baz
-  cookies:
-    foo: bar
-    fooReq: baz
-  body:
-    foo: bar
-  matchers:
-    body:
-      - path: $.foo
-        type: by_regex
-        value: bar
-    headers:
-      - key: foo
-        regex: bar
-response:
-  status: 200
-  fixedDelayMilliseconds: 1000
-  headers:
-    foo2: bar
-    foo3: foo33
-    fooRes: baz
-  body:
-    foo2: bar
-    foo3: baz
-    nullValue: null
-  matchers:
-    body:
-      - path: $.foo2
-        type: by_regex
-        value: bar
-      - path: $.foo3
-        type: by_command
-        value: executeMe($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-    headers:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        command: andMeToo($it)
-    cookies:
-      - key: foo2
-        regex: bar
-      - key: foo3
-        predefined:

-

request may contain additional request headers, as shown in the following example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-		method GET()
-		url "/foo"
-
-		// Each header is added in form `'Header-Name' : 'Header-Value'`.
-		// there are also some helper methods
-		headers {
-			header 'key': 'value'
-			contentType(applicationJson())
-		}
-
-		//...
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

request:
-...
-headers:
-  foo: bar
-  fooReq: baz

-

request may contain additional request cookies, as shown in the following example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-		method GET()
-		url "/foo"
-
-		// Each Cookies is added in form `'Cookie-Key' : 'Cookie-Value'`.
-		// there are also some helper methods
-		cookies {
-			cookie 'key': 'value'
-			cookie('another_key', 'another_value')
-		}
-
-		//...
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

request:
-...
-cookies:
-  foo: bar
-  fooReq: baz

-

request may contain a request body:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-		method GET()
-		url "/foo"
-
-		// Currently only JSON format of request body is supported.
-		// Format will be determined from a header or body's content.
-		body '''{ "login" : "john", "name": "John The Contract" }'''
-	}
-
-	response {
-		//...
-		status 200
-	}
-}

-

YAML.  -

request:
-...
-body:
-  foo: bar

-

request may contain multipart elements. To include multipart elements, use the -multipart method/section, as shown in the following examples

Groovy DSL.  -

-

YAML.  -

request:
-  method: PUT
-  url: /multipart
-  headers:
-    Content-Type: multipart/form-data;boundary=AaB03x
-  multipart:
-    params:
-      # key (parameter name), value (parameter value) pair
-      formParameter: '"formParameterValue"'
-      someBooleanParameter: true
-    named:
-      - paramName: file
-        fileName: filename.csv
-        fileContent: file content
-  matchers:
-    multipart:
-      params:
-        - key: formParameter
-          regex: ".+"
-        - key: someBooleanParameter
-          predefined: any_boolean
-      named:
-        - paramName: file
-          fileName:
-            predefined: non_empty
-          fileContent:
-            predefined: non_empty
-response:
-  status: 200

-

In the preceding example, we define parameters in either of two ways:

Groovy DSL

  • Directly, by using the map notation, where the value can be a dynamic property (such as -formParameter: $(consumer(…​), producer(…​))).
  • By using the named(…​) method that lets you set a named parameter. A named parameter -can set a name and content. You can call it either via a method with two arguments, -such as named("fileName", "fileContent"), or via a map notation, such as -named(name: "fileName", content: "fileContent").

YAML

  • The multipart parameters are set via multipart.params section
  • The named parameters (the fileName and fileContent for a given parameter name) -can be set via the multipart.named section. That section contains -the paramName (name of the parameter), fileName (name of the file), -fileContent (content of the file) fields
  • The dynamic bits can be set via the matchers.multipart section

    • for parameters use the params section that can accept -regex or a predefined regular expression
    • for named params use the named section where first you -define the parameter name via paramName and then you can pass the -parametrization of either fileName or fileContent via -regex or a predefined regular expression

From this contract, the generated test is as follows:

// given:
- MockMvcRequestSpecification request = given()
-   .header("Content-Type", "multipart/form-data;boundary=AaB03x")
-   .param("formParameter", "\"formParameterValue\"")
-   .param("someBooleanParameter", "true")
-   .multiPart("file", "filename.csv", "file content".getBytes());
-
-// when:
- ResponseOptions response = given().spec(request)
-   .put("/multipart");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);

The WireMock stub is as follows:

			'''
-{
-  "request" : {
-	"url" : "/multipart",
-	"method" : "PUT",
-	"headers" : {
-	  "Content-Type" : {
-		"matches" : "multipart/form-data;boundary=AaB03x.*"
-	  }
-	},
-	"bodyPatterns" : [ {
-		"matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"formParameter\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Transfer-Encoding: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n\\".+\\"\\r\\n--\\\\1.*"
-  		}, {
-    			"matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"someBooleanParameter\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Transfer-Encoding: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n(true|false)\\r\\n--\\\\1.*"
-  		}, {
-	  "matches" : ".*--(.*)\\r\\nContent-Disposition: form-data; name=\\"file\\"; filename=\\"[\\\\S\\\\s]+\\"\\r\\n(Content-Type: .*\\r\\n)?(Content-Transfer-Encoding: .*\\r\\n)?(Content-Length: \\\\d+\\r\\n)?\\r\\n[\\\\S\\\\s]+\\r\\n--\\\\1.*"
-	} ]
-  },
-  "response" : {
-	"status" : 200,
-	"transformers" : [ "response-template", "foo-transformer" ]
-  }
-}
-	'''

8.4 Response

The response must contain an HTTP status code and may contain other information. The -following code shows an example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		//...
-		method GET()
-		url "/foo"
-	}
-	response {
-		// Status code sent by the server
-		// in response to request specified above.
-		status OK()
-	}
-}

-

YAML.  -

response:
-...
-status: 200

-

Besides status, the response may contain headers, cookies and a body, both of which are -specified the same way as in the request (see the previous paragraph).

[Tip]Tip

Via the Groovy DSL you can reference the org.springframework.cloud.contract.spec.internal.HttpStatus -methods to provide a meaningful status instead of a digit. E.g. you can call -OK() for a status 200 or BAD_REQUEST() for 400.

8.5 Dynamic properties

The contract can contain some dynamic properties: timestamps, IDs, and so on. You do not -want to force the consumers to stub their clocks to always return the same value of time -so that it gets matched by the stub.

For Groovy DSL you can provide the dynamic parts in your contracts -in two ways: pass them directly in the body or set them in a separate section called -bodyMatchers.

[Note]Note

Before 2.0.0 these were set using testMatchers and stubMatchers, -check out the migration guide for more information.

For YAML you can only use the matchers section.

8.5.1 Dynamic properties inside the body

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

You can set the properties inside the body either with the value method or, if you use -the Groovy map notation, with $(). The following example shows how to set dynamic -properties with the value method:

value(consumer(...), producer(...))
-value(c(...), p(...))
-value(stub(...), test(...))
-value(client(...), server(...))

The following example shows how to set dynamic properties with $():

$(consumer(...), producer(...))
-$(c(...), p(...))
-$(stub(...), test(...))
-$(client(...), server(...))

Both approaches work equally well. stub and client methods are aliases over the consumer -method. Subsequent sections take a closer look at what you can do with those values.

8.5.2 Regular expressions

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

You can use regular expressions to write your requests in Contract DSL. Doing so is -particularly useful when you want to indicate that a given response should be provided -for requests that follow a given pattern. Also, you can use regular expressions when you -need to use patterns and not exact values both for your test and your server side tests.

The following example shows how to use regular expressions to write a request:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method('GET')
-		url $(consumer(~/\/[0-9]{2}/), producer('/12'))
-	}
-	response {
-		status OK()
-		body(
-				id: $(anyNumber()),
-				surname: $(
-						consumer('Kowalsky'),
-						producer(regex('[a-zA-Z]+'))
-				),
-				name: 'Jan',
-				created: $(consumer('2014-02-02 12:23:43'), producer(execute('currentDate(it)'))),
-				correlationId: value(consumer('5d1f9fef-e0dc-4f3d-a7e4-72d2220dd827'),
-						producer(regex('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}'))
-				)
-		)
-		headers {
-			header 'Content-Type': 'text/plain'
-		}
-	}
-}

You can also provide only one side of the communication with a regular expression. If you -do so, then the contract engine automatically provides the generated string that matches -the provided regular expression. The following code shows an example:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url value(consumer(regex('/foo/[0-9]{5}')))
-		body([
-				requestElement: $(consumer(regex('[0-9]{5}')))
-		])
-		headers {
-			header('header', $(consumer(regex('application\\/vnd\\.fraud\\.v1\\+json;.*'))))
-		}
-	}
-	response {
-		status OK()
-		body([
-				responseElement: $(producer(regex('[0-9]{7}')))
-		])
-		headers {
-			contentType("application/vnd.fraud.v1+json")
-		}
-	}
-}

In the preceding example, the opposite side of the communication has the respective data -generated for request and response.

Spring Cloud Contract comes with a series of predefined regular expressions that you can -use in your contracts, as shown in the following example:

protected static final Pattern TRUE_OR_FALSE = Pattern.compile(/(true|false)/)
-protected static final Pattern ALPHA_NUMERIC = Pattern.compile('[a-zA-Z0-9]+')
-protected static final Pattern ONLY_ALPHA_UNICODE = Pattern.compile(/[\p{L}]*/)
-protected static final Pattern NUMBER = Pattern.compile('-?(\\d*\\.\\d+|\\d+)')
-protected static final Pattern INTEGER = Pattern.compile('-?(\\d+)')
-protected static final Pattern POSITIVE_INT = Pattern.compile('([1-9]\\d*)')
-protected static final Pattern DOUBLE = Pattern.compile('-?(\\d*\\.\\d+)')
-protected static final Pattern HEX = Pattern.compile('[a-fA-F0-9]+')
-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])')
-protected static final Pattern HOSTNAME_PATTERN = Pattern.
-		compile('((http[s]?|ftp):/)/?([^:/\\s]+)(:[0-9]{1,5})?')
-protected static final Pattern EMAIL = Pattern.
-		compile('[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}')
-protected static final Pattern URL = UrlHelper.URL
-protected static final Pattern HTTPS_URL = UrlHelper.HTTPS_URL
-protected static final Pattern UUID = Pattern.
-		compile('[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}')
-protected static final Pattern ANY_DATE = Pattern.
-		compile('(\\d\\d\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])')
-protected static final Pattern ANY_DATE_TIME = Pattern.
-		compile('([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])')
-protected static final Pattern ANY_TIME = Pattern.
-		compile('(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])')
-protected static final Pattern NON_EMPTY = Pattern.compile(/[\S\s]+/)
-protected static final Pattern NON_BLANK = Pattern.compile(/^\s*\S[\S\s]*/)
-protected static final Pattern ISO8601_WITH_OFFSET = Pattern.
-		compile(/([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.\d{3})?(Z|[+-][01]\d:[0-5]\d)/)
-
-protected static Pattern anyOf(String... values) {
-	return Pattern.compile(values.collect({ "^$it\$" }).join("|"))
-}
-
-RegexProperty onlyAlphaUnicode() {
-	return new RegexProperty(ONLY_ALPHA_UNICODE).asString()
-}
-
-RegexProperty alphaNumeric() {
-	return new RegexProperty(ALPHA_NUMERIC).asString()
-}
-
-RegexProperty number() {
-	return new RegexProperty(NUMBER).asDouble()
-}
-
-RegexProperty positiveInt() {
-	return new RegexProperty(POSITIVE_INT).asInteger()
-}
-
-RegexProperty anyBoolean() {
-	return new RegexProperty(TRUE_OR_FALSE).asBooleanType()
-}
-
-RegexProperty anInteger() {
-	return new RegexProperty(INTEGER).asInteger()
-}
-
-RegexProperty aDouble() {
-	return new RegexProperty(DOUBLE).asDouble()
-}
-
-RegexProperty ipAddress() {
-	return new RegexProperty(IP_ADDRESS).asString()
-}
-
-RegexProperty hostname() {
-	return new RegexProperty(HOSTNAME_PATTERN).asString()
-}
-
-RegexProperty email() {
-	return new RegexProperty(EMAIL).asString()
-}
-
-RegexProperty url() {
-	return new RegexProperty(URL).asString()
-}
-
-RegexProperty httpsUrl() {
-	return new RegexProperty(HTTPS_URL).asString()
-}
-
-RegexProperty uuid() {
-	return new RegexProperty(UUID).asString()
-}
-
-RegexProperty isoDate() {
-	return new RegexProperty(ANY_DATE).asString()
-}
-
-RegexProperty isoDateTime() {
-	return new RegexProperty(ANY_DATE_TIME).asString()
-}
-
-RegexProperty isoTime() {
-	return new RegexProperty(ANY_TIME).asString()
-}
-
-RegexProperty iso8601WithOffset() {
-	return new RegexProperty(ISO8601_WITH_OFFSET).asString()
-}
-
-RegexProperty nonEmpty() {
-	return new RegexProperty(NON_EMPTY).asString()
-}
-
-RegexProperty nonBlank() {
-	return new RegexProperty(NON_BLANK).asString()
-}

In your contract, you can use it as shown in the following example:

Contract dslWithOptionalsInString = Contract.make {
-	priority 1
-	request {
-		method POST()
-		url '/users/password'
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
-				callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
-		)
-	}
-	response {
-		status 404
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				code: value(consumer("123123"), producer(optional("123123"))),
-				message: "User not found by email = [${value(producer(regex(email())), consumer('not.existing@user.com'))}]"
-		)
-	}
-}

To make matters even simpler you can use a set of predefined objects that will automatically assume that you want a regular expression to be passed. -All of those methods start with any prefix:

T anyAlphaUnicode()
-
-T anyAlphaNumeric()
-
-T anyNumber()
-
-T anyInteger()
-
-T anyPositiveInt()
-
-T anyDouble()
-
-T anyHex()
-
-T aBoolean()
-
-T anyIpAddress()
-
-T anyHostname()
-
-T anyEmail()
-
-T anyUrl()
-
-T anyHttpsUrl()
-
-T anyUuid()
-
-T anyDate()
-
-T anyDateTime()
-
-T anyTime()
-
-T anyIso8601WithOffset()
-
-T anyNonBlankString()
-
-T anyNonEmptyString()
-
-T anyOf(String... values)

and this is an example of how you can reference those methods:

Contract contractDsl = Contract.make {
-	label 'trigger_event'
-	input {
-		triggeredBy('toString()')
-	}
-	outputMessage {
-		sentTo 'topic.rateablequote'
-		body([
-				alpha            : $(anyAlphaUnicode()),
-				number           : $(anyNumber()),
-				anInteger        : $(anyInteger()),
-				positiveInt      : $(anyPositiveInt()),
-				aDouble          : $(anyDouble()),
-				aBoolean         : $(aBoolean()),
-				ip               : $(anyIpAddress()),
-				hostname         : $(anyHostname()),
-				email            : $(anyEmail()),
-				url              : $(anyUrl()),
-				httpsUrl         : $(anyHttpsUrl()),
-				uuid             : $(anyUuid()),
-				date             : $(anyDate()),
-				dateTime         : $(anyDateTime()),
-				time             : $(anyTime()),
-				iso8601WithOffset: $(anyIso8601WithOffset()),
-				nonBlankString   : $(anyNonBlankString()),
-				nonEmptyString   : $(anyNonEmptyString()),
-				anyOf            : $(anyOf('foo', 'bar'))
-		])
-	}
-}

8.5.3 Passing Optional Parameters

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

It is possible to provide optional parameters in your contract. However, you can provide -optional parameters only for the following:

  • STUB side of the Request
  • TEST side of the Response

The following example shows how to provide optional parameters:

org.springframework.cloud.contract.spec.Contract.make {
-	priority 1
-	request {
-		method 'POST'
-		url '/users/password'
-		headers {
-			contentType(applicationJson())
-		}
-		body(
-				email: $(consumer(optional(regex(email()))), producer('abc@abc.com')),
-				callback_url: $(consumer(regex(hostname())), producer('http://partners.com'))
-		)
-	}
-	response {
-		status 404
-		headers {
-			header 'Content-Type': 'application/json'
-		}
-		body(
-				code: value(consumer("123123"), producer(optional("123123")))
-		)
-	}
-}

By wrapping a part of the body with the optional() method, you create a regular -expression that must be present 0 or more times.

If you use Spock for, the following test would be generated from the previous example:

					"""
- given:
-  def request = given()
-    .header("Content-Type", "application/json")
-    .body('''{"email":"abc@abc.com","callback_url":"http://partners.com"}''')
-
- when:
-  def response = given().spec(request)
-    .post("/users/password")
-
- then:
-  response.statusCode == 404
-  response.header('Content-Type')  == 'application/json'
- and:
-  DocumentContext parsedJson = JsonPath.parse(response.body.asString())
-  assertThatJson(parsedJson).field("['code']").matches("(123123)?")
-"""

The following stub would also be generated:

					'''
-{
-  "request" : {
-	"url" : "/users/password",
-	"method" : "POST",
-	"bodyPatterns" : [ {
-	  "matchesJsonPath" : "$[?(@.['email'] =~ /([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,6})?/)]"
-	}, {
-	  "matchesJsonPath" : "$[?(@.['callback_url'] =~ /((http[s]?|ftp):\\\\/)\\\\/?([^:\\\\/\\\\s]+)(:[0-9]{1,5})?/)]"
-	} ],
-	"headers" : {
-	  "Content-Type" : {
-		"equalTo" : "application/json"
-	  }
-	}
-  },
-  "response" : {
-	"status" : 404,
-	"body" : "{\\"code\\":\\"123123\\",\\"message\\":\\"User not found by email == [not.existing@user.com]\\"}",
-	"headers" : {
-	  "Content-Type" : "application/json"
-	}
-  },
-  "priority" : 1
-}
-'''

8.5.4 Executing Custom Methods on the Server Side

[Important]Important

This section is valid only for Groovy DSL. Check out the -Section 8.5.7, “Dynamic Properties in the Matchers Sections” section for YAML examples of a similar feature.

You can define a method call that executes on the server side during the test. Such a -method can be added to the class defined as "baseClassForTests" in the configuration. The -following code shows an example of the contract portion of the test case:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'PUT'
-		url $(consumer(regex('^/api/[0-9]{2}$')), producer('/api/12'))
-		headers {
-			header 'Content-Type': 'application/json'
-		}
-		body '''\
-			[{
-				"text": "Gonna see you at Warsaw"
-			}]
-		'''
-	}
-	response {
-		body(
-				path: $(consumer('/api/12'), producer(regex('^/api/[0-9]{2}$'))),
-				correlationId: $(consumer('1223456'), producer(execute('isProperCorrelationId($it)')))
-		)
-		status OK()
-	}
-}

The following code shows the base class portion of the test case:

abstract class BaseMockMvcSpec extends Specification {
-
-	def setup() {
-		RestAssuredMockMvc.standaloneSetup(new PairIdController())
-	}
-
-	void isProperCorrelationId(Integer correlationId) {
-		assert correlationId == 123456
-	}
-
-	void isEmpty(String value) {
-		assert value == null
-	}
-
-}
[Important]Important

You cannot use both a String and execute to perform concatenation. For -example, calling header('Authorization', 'Bearer ' + execute('authToken()')) leads to -improper results. Instead, call header('Authorization', execute('authToken()')) and -ensure that the authToken() method returns everything you need.

The type of the object read from the JSON can be one of the following, depending on the -JSON path:

  • String: If you point to a String value in the JSON.
  • JSONArray: If you point to a List in the JSON.
  • Map: If you point to a Map in the JSON.
  • Number: If you point to Integer, Double etc. in the JSON.
  • Boolean: If you point to a Boolean in the JSON.

In the request part of the contract, you can specify that the body should be taken from -a method.

[Important]Important

You must provide both the consumer and the producer side. The execute part -is applied for the whole body - not for parts of it.

The following example shows how to read an object from JSON:

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		url '/something'
-		body(
-				$(c('foo'), p(execute('hashCode()')))
-		)
-	}
-	response {
-		status OK()
-	}
-}

The preceding example results in calling the hashCode() method in the request body. -It should resemble the following code:

// given:
- MockMvcRequestSpecification request = given()
-   .body(hashCode());
-
-// when:
- ResponseOptions response = given().spec(request)
-   .get("/something");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);

8.5.5 Referencing the Request from the Response

The best situation is to provide fixed values, but sometimes you need to reference a -request in your response.

If you’re writing contracts using Groovy DSL, you can use the fromRequest() method, which lets -you reference a bunch of elements from the HTTP request. You can use the following -options:

  • fromRequest().url(): Returns the request URL and query parameters.
  • fromRequest().query(String key): Returns the first query parameter with a given name.
  • fromRequest().query(String key, int index): Returns the nth query parameter with a -given name.
  • fromRequest().path(): Returns the full path.
  • fromRequest().path(int index): Returns the nth path element.
  • fromRequest().header(String key): Returns the first header with a given name.
  • fromRequest().header(String key, int index): Returns the nth header with a given name.
  • fromRequest().body(): Returns the full request body.
  • fromRequest().body(String jsonPath): Returns the element from the request that -matches the JSON Path.

If you’re using the YAML contract definition you have to use the -Handlebars {{{ }}} notation with custom, Spring Cloud Contract - functions to achieve this.

  • {{{ request.url }}}: Returns the request URL and query parameters.
  • {{{ request.query.key.[index] }}}: Returns the nth query parameter with a given name. -E.g. for key foo, first entry {{{ request.query.foo.[0] }}}
  • {{{ request.path }}}: Returns the full path.
  • {{{ request.path.[index] }}}: Returns the nth path element. E.g. -for first entry `{{{ request.path.[0] }}}
  • {{{ request.headers.key }}}: Returns the first header with a given name.
  • {{{ request.headers.key.[index] }}}: Returns the nth header with a given name.
  • {{{ request.body }}}: Returns the full request body.
  • {{{ jsonpath this 'your.json.path' }}}: Returns the element from the request that -matches the JSON Path. E.g. for json path $.foo - {{{ jsonpath this '$.foo' }}}

Consider the following contract:

Groovy DSL.  -

-

YAML.  -

request:
-  method: GET
-  url: /api/v1/xxxx
-  queryParameters:
-    foo:
-      - bar
-      - bar2
-  headers:
-    Authorization:
-      - secret
-      - secret2
-  body:
-    foo: bar
-    baz: 5
-response:
-  status: 200
-  headers:
-    Authorization: "foo {{{ request.headers.Authorization.0 }}} bar"
-  body:
-    url: "{{{ request.url }}}"
-    path: "{{{ request.path }}}"
-    pathIndex: "{{{ request.path.1 }}}"
-    param: "{{{ request.query.foo }}}"
-    paramIndex: "{{{ request.query.foo.1 }}}"
-    authorization: "{{{ request.headers.Authorization.0 }}}"
-    authorization2: "{{{ request.headers.Authorization.1 }}"
-    fullBody: "{{{ request.body }}}"
-    responseFoo: "{{{ jsonpath this '$.foo' }}}"
-    responseBaz: "{{{ jsonpath this '$.baz' }}}"
-    responseBaz2: "Bla bla {{{ jsonpath this '$.foo' }}} bla bla"

-

Running a JUnit test generation leads to a test that resembles the following example:

// given:
- MockMvcRequestSpecification request = given()
-   .header("Authorization", "secret")
-   .header("Authorization", "secret2")
-   .body("{\"foo\":\"bar\",\"baz\":5}");
-
-// when:
- ResponseOptions response = given().spec(request)
-   .queryParam("foo","bar")
-   .queryParam("foo","bar2")
-   .get("/api/v1/xxxx");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Authorization")).isEqualTo("foo secret bar");
-// and:
- DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
- assertThatJson(parsedJson).field("['fullBody']").isEqualTo("{\"foo\":\"bar\",\"baz\":5}");
- assertThatJson(parsedJson).field("['authorization']").isEqualTo("secret");
- assertThatJson(parsedJson).field("['authorization2']").isEqualTo("secret2");
- assertThatJson(parsedJson).field("['path']").isEqualTo("/api/v1/xxxx");
- assertThatJson(parsedJson).field("['param']").isEqualTo("bar");
- assertThatJson(parsedJson).field("['paramIndex']").isEqualTo("bar2");
- assertThatJson(parsedJson).field("['pathIndex']").isEqualTo("v1");
- assertThatJson(parsedJson).field("['responseBaz']").isEqualTo(5);
- assertThatJson(parsedJson).field("['responseFoo']").isEqualTo("bar");
- assertThatJson(parsedJson).field("['url']").isEqualTo("/api/v1/xxxx?foo=bar&foo=bar2");
- assertThatJson(parsedJson).field("['responseBaz2']").isEqualTo("Bla bla bar bla bla");

As you can see, elements from the request have been properly referenced in the response.

The generated WireMock stub should resemble the following example:

{
-  "request" : {
-    "urlPath" : "/api/v1/xxxx",
-    "method" : "POST",
-    "headers" : {
-      "Authorization" : {
-        "equalTo" : "secret2"
-      }
-    },
-    "queryParameters" : {
-      "foo" : {
-        "equalTo" : "bar2"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.['baz'] == 5)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['foo'] == 'bar')]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\"authorization\":\"{{{request.headers.Authorization.[0]}}}\",\"path\":\"{{{request.path}}}\",\"responseBaz\":{{{jsonpath this '$.baz'}}} ,\"param\":\"{{{request.query.foo.[0]}}}\",\"pathIndex\":\"{{{request.path.[1]}}}\",\"responseBaz2\":\"Bla bla {{{jsonpath this '$.foo'}}} bla bla\",\"responseFoo\":\"{{{jsonpath this '$.foo'}}}\",\"authorization2\":\"{{{request.headers.Authorization.[1]}}}\",\"fullBody\":\"{{{escapejsonbody}}}\",\"url\":\"{{{request.url}}}\",\"paramIndex\":\"{{{request.query.foo.[1]}}}\"}",
-    "headers" : {
-      "Authorization" : "{{{request.headers.Authorization.[0]}}};foo"
-    },
-    "transformers" : [ "response-template" ]
-  }
-}

Sending a request such as the one presented in the request part of the contract results -in sending the following response body:

{
-  "url" : "/api/v1/xxxx?foo=bar&foo=bar2",
-  "path" : "/api/v1/xxxx",
-  "pathIndex" : "v1",
-  "param" : "bar",
-  "paramIndex" : "bar2",
-  "authorization" : "secret",
-  "authorization2" : "secret2",
-  "fullBody" : "{\"foo\":\"bar\",\"baz\":5}",
-  "responseFoo" : "bar",
-  "responseBaz" : 5,
-  "responseBaz2" : "Bla bla bar bla bla"
-}
[Important]Important

This feature works only with WireMock having a version greater than or equal -to 2.5.1. The Spring Cloud Contract Verifier uses WireMock’s -response-template response transformer. It uses Handlebars to convert the Mustache {{{ }}} templates into -proper values. Additionally, it registers two helper functions:

  • escapejsonbody: Escapes the request body in a format that can be embedded in a JSON.
  • jsonpath: For a given parameter, find an object in the request body.

8.5.6 Registering Your Own WireMock Extension

WireMock lets you register custom extensions. By default, Spring Cloud Contract registers -the transformer, which lets you reference a request from a response. If you want to -provide your own extensions, you can register an implementation of the -org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockExtensions interface. -Since we use the spring.factories extension approach, you can create an entry in -META-INF/spring.factories file similar to the following:

org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockExtensions=\
-org.springframework.cloud.contract.stubrunner.provider.wiremock.TestWireMockExtensions
-org.springframework.cloud.contract.spec.ContractConverter=\
-org.springframework.cloud.contract.stubrunner.TestCustomYamlContractConverter

The following is an example of a custom extension:

TestWireMockExtensions.groovy.  -

/*
- * Copyright 2013-2019 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.cloud.contract.verifier.dsl.wiremock
-
-import com.github.tomakehurst.wiremock.extension.Extension
-
-/**
- * Extension that registers the default transformer and the custom one
- */
-class TestWireMockExtensions implements WireMockExtensions {
-	@Override
-	List<Extension> extensions() {
-		return [
-				new DefaultResponseTransformer(),
-				new CustomExtension()
-		]
-	}
-}
-
-class CustomExtension implements Extension {
-
-	@Override
-	String getName() {
-		return "foo-transformer"
-	}
-}

-

[Important]Important

Remember to override the applyGlobally() method and set it to false if you -want the transformation to be applied only for a mapping that explicitly requires it.

8.5.7 Dynamic Properties in the Matchers Sections

If you work with Pact, the following discussion may seem familiar. -Quite a few users are used to having a separation between the body and setting the -dynamic parts of a contract.

You can use the bodyMatchers section for two reasons:

  • Define the dynamic values that should end up in a stub. -You can set it in the request or inputMessage part of your contract.
  • Verify the result of your test. -This section is present in the response or outputMessage side of the -contract.

Currently, Spring Cloud Contract Verifier supports only JSON Path-based matchers with the -following matching possibilities:

Groovy DSL

  • For the stubs(in tests on the Consumer’s side):

    • byEquality(): The value taken from the consumer’s request via the provided JSON Path must be -equal to the value provided in the contract.
    • byRegex(…​): The value taken from the consumer’s request via the provided JSON Path must -match the regex. You can also pass the type of the expected matched value (e.g. asString(), asLong() etc.)
    • byDate(): The value taken from the consumer’s request via the provided JSON Path must -match the regex for an ISO Date value.
    • byTimestamp(): The value taken from the consumer’s request via the provided JSON Path must -match the regex for an ISO DateTime value.
    • byTime(): The value taken from the consumer’s request via the provided JSON Path must -match the regex for an ISO Time value.
  • For the verification(in generated tests on the Producer’s side):

    • byEquality(): The value taken from the producer’s response via the provided JSON Path must be -equal to the provided value in the contract.
    • byRegex(…​): The value taken from the producer’s response via the provided JSON Path must -match the regex.
    • byDate(): The value taken from the producer’s response via the provided JSON Path must match -the regex for an ISO Date value.
    • byTimestamp(): The value taken from the producer’s response via the provided JSON Path must -match the regex for an ISO DateTime value.
    • byTime(): The value taken from the producer’s response via the provided JSON Path must match -the regex for an ISO Time value.
    • byType(): The value taken from the producer’s response via the provided JSON Path needs to be -of the same type as the type defined in the body of the response in the contract. -byType can take a closure, in which you can set minOccurrence and maxOccurrence. For the request side, you should use the closure to assert size of the collection. -That way, you can assert the size of the flattened collection. To check the size of an -unflattened collection, use a custom method with the byCommand(…​) testMatcher.
    • byCommand(…​): The value taken from the producer’s response via the provided JSON Path is -passed as an input to the custom method that you provide. For example, -byCommand('foo($it)') results in calling a foo method to which the value matching the -JSON Path gets passed. The type of the object read from the JSON can be one of the -following, depending on the JSON path:

      • String: If you point to a String value.
      • JSONArray: If you point to a List.
      • Map: If you point to a Map.
      • Number: If you point to Integer, Double, or other kind of number.
      • Boolean: If you point to a Boolean.
    • byNull(): The value taken from the response via the provided JSON Path must be null

YAML. Please read the Groovy section for detailed explanation of -what the types mean

For YAML the structure of a matcher looks like this

- path: $.foo
-  type: by_regex
-  value: bar
-  regexType: as_string

Or if you want to use one of the predefined regular expressions -[only_alpha_unicode, number, any_boolean, ip_address, hostname, -email, url, uuid, iso_date, iso_date_time, iso_time, iso_8601_with_offset, non_empty, non_blank]:

- path: $.foo
-  type: by_regex
-  predefined: only_alpha_unicode

Below you can find the allowed list of `type`s.

  • For stubMatchers:

    • by_equality
    • by_regex
    • by_date
    • by_timestamp
    • by_time
    • by_type

      • there are 2 additional fields accepted: minOccurrence and maxOccurrence.
  • For testMatchers:

    • by_equality
    • by_regex
    • by_date
    • by_timestamp
    • by_time
    • by_type

      • there are 2 additional fields accepted: minOccurrence and maxOccurrence.
    • by_command
    • by_null

You can also define which type the regular expression corresponds to via the regexType field. Below you can find the allowed list of regular expression types:

  • as_integer
  • as_double
  • as_float,
  • as_long
  • as_short
  • as_boolean
  • as_string

Consider the following example:

Groovy DSL.  -

Contract contractDsl = Contract.make {
-	request {
-		method 'GET'
-		urlPath '/get'
-		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',
-				key                 : [
-						'complex.key': 'foo'
-				]
-		])
-		bodyMatchers {
-			jsonPath('$.duck', byRegex("[0-9]{3}").asInteger())
-			jsonPath('$.duck', byEquality())
-			jsonPath('$.alpha', byRegex(onlyAlphaUnicode()).asString())
-			jsonPath('$.alpha', byEquality())
-			jsonPath('$.number', byRegex(number()).asInteger())
-			jsonPath('$.aBoolean', byRegex(anyBoolean()).asBooleanType())
-			jsonPath('$.date', byDate())
-			jsonPath('$.dateTime', byTimestamp())
-			jsonPath('$.time', byTime())
-			jsonPath("\$.['key'].['complex.key']", byEquality())
-		}
-		headers {
-			contentType(applicationJson())
-		}
-	}
-	response {
-		status OK()
-		body([
-				duck                 : 123,
-				alpha                : 'abc',
-				number               : 123,
-				positiveInteger      : 1234567890,
-				negativeInteger      : -1234567890,
-				positiveDecimalNumber: 123.4567890,
-				negativeDecimalNumber: -123.4567890,
-				aBoolean             : true,
-				date                 : '2017-01-01',
-				dateTime             : '2017-01-01T01:23:45',
-				time                 : "01:02:34",
-				valueWithoutAMatcher : 'foo',
-				valueWithTypeMatch   : 'string',
-				valueWithMin         : [
-						1, 2, 3
-				],
-				valueWithMax         : [
-						1, 2, 3
-				],
-				valueWithMinMax      : [
-						1, 2, 3
-				],
-				valueWithMinEmpty    : [],
-				valueWithMaxEmpty    : [],
-				key                  : [
-						'complex.key': 'foo'
-				],
-				nullValue            : null
-		])
-		bodyMatchers {
-			// asserts the jsonpath value against manual regex
-			jsonPath('$.duck', byRegex("[0-9]{3}").asInteger())
-			// asserts the jsonpath value against the provided value
-			jsonPath('$.duck', byEquality())
-			// asserts the jsonpath value against some default regex
-			jsonPath('$.alpha', byRegex(onlyAlphaUnicode()).asString())
-			jsonPath('$.alpha', byEquality())
-			jsonPath('$.number', byRegex(number()).asInteger())
-			jsonPath('$.positiveInteger', byRegex(anInteger()).asInteger())
-			jsonPath('$.negativeInteger', byRegex(anInteger()).asInteger())
-			jsonPath('$.positiveDecimalNumber', byRegex(aDouble()).asDouble())
-			jsonPath('$.negativeDecimalNumber', byRegex(aDouble()).asDouble())
-			jsonPath('$.aBoolean', byRegex(anyBoolean()).asBooleanType())
-			// asserts vs inbuilt time related regex
-			jsonPath('$.date', byDate())
-			jsonPath('$.dateTime', byTimestamp())
-			jsonPath('$.time', byTime())
-			// asserts that the resulting type is the same as in response body
-			jsonPath('$.valueWithTypeMatch', byType())
-			jsonPath('$.valueWithMin', byType {
-				// results in verification of size of array (min 1)
-				minOccurrence(1)
-			})
-			jsonPath('$.valueWithMax', byType {
-				// results in verification of size of array (max 3)
-				maxOccurrence(3)
-			})
-			jsonPath('$.valueWithMinMax', byType {
-				// results in verification of size of array (min 1 & max 3)
-				minOccurrence(1)
-				maxOccurrence(3)
-			})
-			jsonPath('$.valueWithMinEmpty', byType {
-				// results in verification of size of array (min 0)
-				minOccurrence(0)
-			})
-			jsonPath('$.valueWithMaxEmpty', byType {
-				// results in verification of size of array (max 0)
-				maxOccurrence(0)
-			})
-			// will execute a method `assertThatValueIsANumber`
-			jsonPath('$.duck', byCommand('assertThatValueIsANumber($it)'))
-			jsonPath("\$.['key'].['complex.key']", byEquality())
-			jsonPath('$.nullValue', byNull())
-		}
-		headers {
-			contentType(applicationJson())
-			header('Some-Header', $(c('someValue'), p(regex('[a-zA-Z]{9}'))))
-		}
-	}
-}

-

YAML.  -

request:
-  method: GET
-  urlPath: /get/1
-  headers:
-    Content-Type: application/json
-  cookies:
-    foo: 2
-    bar: 3
-  queryParameters:
-    limit: 10
-    offset: 20
-    filter: 'email'
-    sort: name
-    search: 55
-    age: 99
-    name: John.Doe
-    email: 'bob@email.com'
-  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"
-    key:
-      "complex.key": 'foo'
-    nullValue: null
-    valueWithMin:
-      - 1
-      - 2
-      - 3
-    valueWithMax:
-      - 1
-      - 2
-      - 3
-    valueWithMinMax:
-      - 1
-      - 2
-      - 3
-    valueWithMinEmpty: []
-    valueWithMaxEmpty: []
-  matchers:
-    url:
-      regex: /get/[0-9]
-      # predefined:
-      # execute a method
-      #command: 'equals($it)'
-    queryParameters:
-      - key: limit
-        type: equal_to
-        value: 20
-      - key: offset
-        type: containing
-        value: 20
-      - key: sort
-        type: equal_to
-        value: name
-      - key: search
-        type: not_matching
-        value: '^[0-9]{2}$'
-      - key: age
-        type: not_matching
-        value: '^\\w*$'
-      - key: name
-        type: matching
-        value: 'John.*'
-      - key: hello
-        type: absent
-    cookies:
-      - key: foo
-        regex: '[0-9]'
-      - key: bar
-        command: 'equals($it)'
-    headers:
-      - key: Content-Type
-        regex: "application/json.*"
-    body:
-      - path: $.duck
-        type: by_regex
-        value: "[0-9]{3}"
-      - path: $.duck
-        type: by_equality
-      - path: $.alpha
-        type: by_regex
-        predefined: only_alpha_unicode
-      - path: $.alpha
-        type: by_equality
-      - path: $.number
-        type: by_regex
-        predefined: number
-      - path: $.aBoolean
-        type: by_regex
-        predefined: any_boolean
-      - path: $.date
-        type: by_date
-      - path: $.dateTime
-        type: by_timestamp
-      - path: $.time
-        type: by_time
-      - path: "$.['key'].['complex.key']"
-        type: by_equality
-      - path: $.nullvalue
-        type: by_null
-      - path: $.valueWithMin
-        type: by_type
-        minOccurrence: 1
-      - path: $.valueWithMax
-        type: by_type
-        maxOccurrence: 3
-      - path: $.valueWithMinMax
-        type: by_type
-        minOccurrence: 1
-        maxOccurrence: 3
-response:
-  status: 200
-  cookies:
-    foo: 1
-    bar: 2
-  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"
-    valueWithMin:
-      - 1
-      - 2
-      - 3
-    valueWithMax:
-      - 1
-      - 2
-      - 3
-    valueWithMinMax:
-      - 1
-      - 2
-      - 3
-    valueWithMinEmpty: []
-    valueWithMaxEmpty: []
-    key:
-      'complex.key': 'foo'
-    nulValue: null
-  matchers:
-    headers:
-      - key: Content-Type
-        regex: "application/json.*"
-    cookies:
-      - key: foo
-        regex: '[0-9]'
-      - key: bar
-        command: 'equals($it)'
-    body:
-      - path: $.duck
-        type: by_regex
-        value: "[0-9]{3}"
-      - path: $.duck
-        type: by_equality
-      - path: $.alpha
-        type: by_regex
-        predefined: only_alpha_unicode
-      - path: $.alpha
-        type: by_equality
-      - path: $.number
-        type: by_regex
-        predefined: number
-      - path: $.aBoolean
-        type: by_regex
-        predefined: any_boolean
-      - path: $.date
-        type: by_date
-      - path: $.dateTime
-        type: by_timestamp
-      - path: $.time
-        type: by_time
-      - path: $.valueWithTypeMatch
-        type: by_type
-      - path: $.valueWithMin
-        type: by_type
-        minOccurrence: 1
-      - path: $.valueWithMax
-        type: by_type
-        maxOccurrence: 3
-      - path: $.valueWithMinMax
-        type: by_type
-        minOccurrence: 1
-        maxOccurrence: 3
-      - path: $.valueWithMinEmpty
-        type: by_type
-        minOccurrence: 0
-      - path: $.valueWithMaxEmpty
-        type: by_type
-        maxOccurrence: 0
-      - path: $.duck
-        type: by_command
-        value: assertThatValueIsANumber($it)
-      - path: $.nullValue
-        type: by_null
-        value: null
-  headers:
-    Content-Type: application/json

-

In the preceding example, you can see the dynamic portions of the contract in the -matchers sections. For the request part, you can see that, for all fields but -valueWithoutAMatcher, the values of the regular expressions that the stub should -contain are explicitly set. For the valueWithoutAMatcher, the verification takes place -in the same way as without the use of matchers. In that case, the test performs an -equality check.

For the response side in the bodyMatchers section, we define the dynamic parts in a -similar manner. The only difference is that the byType matchers are also present. The -verifier engine checks four fields to verify whether the response from the test -has a value for which the JSON path matches the given field, is of the same type as the one -defined in the response body, and passes the following check (based on the method being called):

  • For $.valueWithTypeMatch, the engine checks whether the type is the same.
  • For $.valueWithMin, the engine check the type and asserts whether the size is greater -than or equal to the minimum occurrence.
  • For $.valueWithMax, the engine checks the type and asserts whether the size is -smaller than or equal to the maximum occurrence.
  • For $.valueWithMinMax, the engine checks the type and asserts whether the size is -between the min and maximum occurrence.

The resulting test would resemble the following example (note that an and section -separates the autogenerated assertions and the assertion from matchers):

// 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\",\"key\":{\"complex.key\":\"foo\"}}");
-
-// when:
- ResponseOptions response = given().spec(request)
-   .get("/get");
-
-// then:
- assertThat(response.statusCode()).isEqualTo(200);
- assertThat(response.header("Content-Type")).matches("application/json.*");
-// and:
- DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
- assertThatJson(parsedJson).field("['valueWithoutAMatcher']").isEqualTo("foo");
-// and:
- assertThat(parsedJson.read("$.duck", String.class)).matches("[0-9]{3}");
- assertThat(parsedJson.read("$.duck", Integer.class)).isEqualTo(123);
- assertThat(parsedJson.read("$.alpha", String.class)).matches("[\\p{L}]*");
- assertThat(parsedJson.read("$.alpha", String.class)).isEqualTo("abc");
- assertThat(parsedJson.read("$.number", String.class)).matches("-?(\\d*\\.\\d+|\\d+)");
- assertThat(parsedJson.read("$.aBoolean", String.class)).matches("(true|false)");
- assertThat(parsedJson.read("$.date", String.class)).matches("(\\d\\d\\d\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])");
- assertThat(parsedJson.read("$.dateTime", String.class)).matches("([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])");
- assertThat(parsedJson.read("$.time", String.class)).matches("(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])");
- assertThat((Object) parsedJson.read("$.valueWithTypeMatch")).isInstanceOf(java.lang.String.class);
- assertThat((Object) parsedJson.read("$.valueWithMin")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMin", java.util.Collection.class)).as("$.valueWithMin").hasSizeGreaterThanOrEqualTo(1);
- assertThat((Object) parsedJson.read("$.valueWithMax")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMax", java.util.Collection.class)).as("$.valueWithMax").hasSizeLessThanOrEqualTo(3);
- assertThat((Object) parsedJson.read("$.valueWithMinMax")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMinMax", java.util.Collection.class)).as("$.valueWithMinMax").hasSizeBetween(1, 3);
- assertThat((Object) parsedJson.read("$.valueWithMinEmpty")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMinEmpty", java.util.Collection.class)).as("$.valueWithMinEmpty").hasSizeGreaterThanOrEqualTo(0);
- assertThat((Object) parsedJson.read("$.valueWithMaxEmpty")).isInstanceOf(java.util.List.class);
- assertThat((java.lang.Iterable) parsedJson.read("$.valueWithMaxEmpty", java.util.Collection.class)).as("$.valueWithMaxEmpty").hasSizeLessThanOrEqualTo(0);
- assertThatValueIsANumber(parsedJson.read("$.duck"));
- assertThat(parsedJson.read("$.['key'].['complex.key']", String.class)).isEqualTo("foo");
[Important]Important

Notice that, for the byCommand method, the example calls the -assertThatValueIsANumber. This method must be defined in the test base class or be -statically imported to your tests. Notice that the byCommand call was converted to -assertThatValueIsANumber(parsedJson.read("$.duck"));. That means that the engine took -the method name and passed the proper JSON path as a parameter to it.

The resulting WireMock stub is in the following example:

					'''
-{
-  "request" : {
-    "urlPath" : "/get",
-    "method" : "POST",
-    "headers" : {
-      "Content-Type" : {
-        "matches" : "application/json.*"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$.['list'].['some'].['nested'][?(@.['anothervalue'] == 4)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['valueWithoutAMatcher'] == 'foo')]"
-    }, {
-      "matchesJsonPath" : "$[?(@.['valueWithTypeMatch'] == 'string')]"
-    }, {
-      "matchesJsonPath" : "$.['list'].['someother'].['nested'][?(@.['json'] == 'with value')]"
-    }, {
-      "matchesJsonPath" : "$.['list'].['someother'].['nested'][?(@.['anothervalue'] == 4)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.duck =~ /([0-9]{3})/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.duck == 123)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.alpha =~ /([\\\\p{L}]*)/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.alpha == 'abc')]"
-    }, {
-      "matchesJsonPath" : "$[?(@.number =~ /(-?(\\\\d*\\\\.\\\\d+|\\\\d+))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.aBoolean =~ /((true|false))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.date =~ /((\\\\d\\\\d\\\\d\\\\d)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.dateTime =~ /(([0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]))/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.time =~ /((2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]))/)]"
-    }, {
-      "matchesJsonPath" : "$.list.some.nested[?(@.json =~ /(.*)/)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.valueWithMin.size() >= 1)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.valueWithMax.size() <= 3)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.valueWithMinMax.size() >= 1 && @.valueWithMinMax.size() <= 3)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.valueWithOccurrence.size() >= 4 && @.valueWithOccurrence.size() <= 4)]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\\"date\\":\\"2017-01-01\\",\\"dateTime\\":\\"2017-01-01T01:23:45\\",\\"aBoolean\\":true,\\"valueWithMax\\":[1,2,3],\\"valueWithOccurrence\\":[1,2,3,4],\\"number\\":123,\\"duck\\":123,\\"alpha\\":\\"abc\\",\\"valueWithMin\\":[1,2,3],\\"time\\":\\"01:02:34\\",\\"valueWithTypeMatch\\":\\"string\\",\\"valueWithMinMax\\":[1,2,3],\\"valueWithoutAMatcher\\":\\"foo\\"}",
-    "headers" : {
-      "Content-Type" : "application/json"
-    },
-    "transformers" : [ "response-template" ]
-  }
-}
-'''
[Important]Important

If you use a matcher, then the part of the request and response that the -matcher addresses with the JSON Path gets removed from the assertion. In the case of -verifying a collection, you must create matchers for all the elements of the -collection.

Consider the following example:

Contract.make {
-    request {
-        method 'GET'
-        url("/foo")
-    }
-    response {
-        status OK()
-        body(events: [[
-                                 operation          : 'EXPORT',
-                                 eventId            : '16f1ed75-0bcc-4f0d-a04d-3121798faf99',
-                                 status             : 'OK'
-                         ], [
-                                 operation          : 'INPUT_PROCESSING',
-                                 eventId            : '3bb4ac82-6652-462f-b6d1-75e424a0024a',
-                                 status             : 'OK'
-                         ]
-                ]
-        )
-        bodyMatchers {
-            jsonPath('$.events[0].operation', byRegex('.+'))
-            jsonPath('$.events[0].eventId', byRegex('^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})$'))
-            jsonPath('$.events[0].status', byRegex('.+'))
-        }
-    }
-}

The preceding code leads to creating the following test (the code block shows only the assertion section):

and:
-	DocumentContext parsedJson = JsonPath.parse(response.body.asString())
-	assertThatJson(parsedJson).array("['events']").contains("['eventId']").isEqualTo("16f1ed75-0bcc-4f0d-a04d-3121798faf99")
-	assertThatJson(parsedJson).array("['events']").contains("['operation']").isEqualTo("EXPORT")
-	assertThatJson(parsedJson).array("['events']").contains("['operation']").isEqualTo("INPUT_PROCESSING")
-	assertThatJson(parsedJson).array("['events']").contains("['eventId']").isEqualTo("3bb4ac82-6652-462f-b6d1-75e424a0024a")
-	assertThatJson(parsedJson).array("['events']").contains("['status']").isEqualTo("OK")
-and:
-	assertThat(parsedJson.read("\$.events[0].operation", String.class)).matches(".+")
-	assertThat(parsedJson.read("\$.events[0].eventId", String.class)).matches("^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})\$")
-	assertThat(parsedJson.read("\$.events[0].status", String.class)).matches(".+")

As you can see, the assertion is malformed. Only the first element of the array got -asserted. In order to fix this, you should apply the assertion to the whole $.events -collection and assert it with the byCommand(…​) method.

8.6 JAX-RS Support

The Spring Cloud Contract Verifier supports the JAX-RS 2 Client API. The base class needs -to define protected WebTarget webTarget and server initialization. The only option for -testing JAX-RS API is to start a web server. Also, a request with a body needs to have a -content type set. Otherwise, the default of application/octet-stream gets used.

In order to use JAX-RS mode, use the following settings:

testMode == 'JAXRSCLIENT'

The following example shows a generated test API:

					'''
- // when:
-  Response response = webTarget
-    .path("/users")
-    .queryParam("limit", "10")
-    .queryParam("offset", "20")
-    .queryParam("filter", "email")
-    .queryParam("sort", "name")
-    .queryParam("search", "55")
-    .queryParam("age", "99")
-    .queryParam("name", "Denis.Stepanov")
-    .queryParam("email", "bob@email.com")
-    .request()
-    .method("GET");
-
-  String responseAsString = response.readEntity(String.class);
-
- // then:
-  assertThat(response.getStatus()).isEqualTo(200);
- // and:
-  DocumentContext parsedJson = JsonPath.parse(responseAsString);
-  assertThatJson(parsedJson).field("['property1']").isEqualTo("a");
-'''

8.7 Async Support

If you’re using asynchronous communication on the server side (your controllers are -returning Callable, DeferredResult, and so on), then, inside your contract, you must -provide an async() method in the response section. The following code shows an example:

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-    request {
-        method GET()
-        url '/get'
-    }
-    response {
-        status OK()
-        body 'Passed'
-        async()
-    }
-}

-

YAML.  -

response:
-    async: true

-

You can also use the fixedDelayMilliseconds method / property to add delay to your stubs.

Groovy DSL.  -

org.springframework.cloud.contract.spec.Contract.make {
-    request {
-        method GET()
-        url '/get'
-    }
-    response {
-        status 200
-        body 'Passed'
-        fixedDelayMilliseconds 1000
-    }
-}

-

YAML.  -

response:
-    fixedDelayMilliseconds: 1000

-

8.8 Working with Context Paths

Spring Cloud Contract supports context paths.

[Important]Important

The only change needed to fully support context paths is the switch on the -PRODUCER side. Also, the autogenerated tests must use EXPLICIT mode. The consumer -side remains untouched. In order for the generated test to pass, you must use EXPLICIT -mode.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <testMode>EXPLICIT</testMode>
-    </configuration>
-</plugin>

-

Gradle.  -

contracts {
-		testMode = 'EXPLICIT'
-}

-

That way, you generate a test that DOES NOT use MockMvc. It means that you generate -real requests and you need to setup your generated test’s base class to work on a real -socket.

Consider the following contract:

org.springframework.cloud.contract.spec.Contract.make {
-	request {
-		method 'GET'
-		url '/my-context-path/url'
-	}
-	response {
-		status OK()
-	}
-}

The following example shows how to set up a base class and Rest Assured:

import io.restassured.RestAssured;
-import org.junit.Before;
-import org.springframework.boot.web.server.LocalServerPort;
-import org.springframework.boot.test.context.SpringBootTest;
-
-@SpringBootTest(classes = ContextPathTestingBaseClass.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
-class ContextPathTestingBaseClass {
-
-	@LocalServerPort int port;
-
-	@Before
-	public void setup() {
-		RestAssured.baseURI = "http://localhost";
-		RestAssured.port = this.port;
-	}
-}

If you do it this way:

  • All of your requests in the autogenerated tests are sent to the real endpoint with your -context path included (for example, /my-context-path/url).
  • Your contracts reflect that you have a context path. Your generated stubs also have -that information (for example, in the stubs, you have to call /my-context-path/url).

8.9 Working with WebFlux

Spring Cloud Contract offers two ways of working with WebFlux.

8.9.1 WebFlux with WebTestClient

One of them is via the WebTestClient mode.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <testMode>WEBTESTCLIENT</testMode>
-    </configuration>
-</plugin>

-

Gradle.  -

contracts {
-		testMode = 'WEBTESTCLIENT'
-}

-

The following example shows how to set up a WebTestClient base class and RestAssured -for WebFlux:

import io.restassured.module.webtestclient.RestAssuredWebTestClient;
-import org.junit.Before;
-
-public abstract class BeerRestBase {
-
-	@Before
-	public void setup() {
-		RestAssuredWebTestClient.standaloneSetup(
-		new ProducerController(personToCheck -> personToCheck.age >= 20));
-	}
-}
-}

8.9.2 WebFlux with Explicit mode

Another way is with the EXPLICIT mode in your generated tests -to work with WebFlux.

Maven.  -

<plugin>
-    <groupId>org.springframework.cloud</groupId>
-    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
-    <version>${spring-cloud-contract.version}</version>
-    <extensions>true</extensions>
-    <configuration>
-        <testMode>EXPLICIT</testMode>
-    </configuration>
-</plugin>

-

Gradle.  -

contracts {
-		testMode = 'EXPLICIT'
-}

-

The following example shows how to set up a base class and Rest Assured for Web Flux:

@RunWith(SpringRunner.class)
-@SpringBootTest(classes = BeerRestBase.Config.class,
-		webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
-		properties = "server.port=0")
-public abstract class BeerRestBase {
-
-    // your tests go here
-
-    // in this config class you define all controllers and mocked services
-@Configuration
-@EnableAutoConfiguration
-static class Config {
-
-	@Bean
-	PersonCheckingService personCheckingService()  {
-		return personToCheck -> personToCheck.age >= 20;
-	}
-
-	@Bean
-	ProducerController producerController() {
-		return new ProducerController(personCheckingService());
-	}
-}
-
-}

8.10 XML Support for REST

For REST contracts, we also support XML request and response body. -The XML body has to be passed within the body element -as a String or GString. Also body matchers can be provided for -both request and response. In place of the jsonPath(…​) method, the org.springframework.cloud.contract.spec.internal.BodyMatchers.xPath -method should be used, with the desired xPath provided as the first argument -and the appropriate MatchingType as second. All the body matchers apart from byType() are supported.

Here is an example of a Groovy DSL contract with XML response body:

					Contract.make {
-						request {
-							method GET()
-							urlPath '/get'
-							headers {
-								contentType(applicationXml())
-							}
-						}
-						response {
-							status(OK())
-							headers {
-								contentType(applicationXml())
-							}
-							body """
-<test>
-<duck type='xtype'>123</duck>
-<alpha>abc</alpha>
-<list>
-<elem>abc</elem>
-<elem>def</elem>
-<elem>ghi</elem>
-</list>
-<number>123</number>
-<aBoolean>true</aBoolean>
-<date>2017-01-01</date>
-<dateTime>2017-01-01T01:23:45</dateTime>
-<time>01:02:34</time>
-<valueWithoutAMatcher>foo</valueWithoutAMatcher>
-<key><complex>foo</complex></key>
-</test>"""
-							bodyMatchers {
-								xPath('/test/duck/text()', byRegex("[0-9]{3}"))
-								xPath('/test/duck/text()', byCommand('test($it)'))
-								xPath('/test/duck/xxx', byNull())
-								xPath('/test/duck/text()', byEquality())
-								xPath('/test/alpha/text()', byRegex(onlyAlphaUnicode()))
-								xPath('/test/alpha/text()', byEquality())
-								xPath('/test/number/text()', byRegex(number()))
-								xPath('/test/date/text()', byDate())
-								xPath('/test/dateTime/text()', byTimestamp())
-								xPath('/test/time/text()', byTime())
-								xPath('/test/*/complex/text()', byEquality())
-								xPath('/test/duck/@type', byEquality())
-							}
-						}
-					}

And below is an example of a YAML contract with XML request and response bodies:

include::{verifier_core_path}/src/test/resources/yml/contract_rest_xml.yml

Here is an example of an automatically generated test for XML response body:

@Test
-public void validate_xmlMatches() throws Exception {
-	// given:
-	MockMvcRequestSpecification request = given()
-				.header("Content-Type", "application/xml");
-
-	// when:
-	ResponseOptions response = given().spec(request).get("/get");
-
-	// then:
-	assertThat(response.statusCode()).isEqualTo(200);
-	// and:
-	DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance()
-					.newDocumentBuilder();
-	Document parsedXml = documentBuilder.parse(new InputSource(
-				new StringReader(response.getBody().asString())));
-	// and:
-	assertThat(valueFromXPath(parsedXml, "/test/list/elem/text()")).isEqualTo("abc");
-	assertThat(valueFromXPath(parsedXml,"/test/list/elem[2]/text()")).isEqualTo("def");
-	assertThat(valueFromXPath(parsedXml, "/test/duck/text()")).matches("[0-9]{3}");
-	assertThat(nodeFromXPath(parsedXml, "/test/duck/xxx")).isNull();
-	assertThat(valueFromXPath(parsedXml, "/test/alpha/text()")).matches("[\\p{L}]*");
-	assertThat(valueFromXPath(parsedXml, "/test/*/complex/text()")).isEqualTo("foo");
-	assertThat(valueFromXPath(parsedXml, "/test/duck/@type")).isEqualTo("xtype");
-	}

8.11 Messaging Top-Level Elements

The DSL for messaging looks a little bit different than the one that focuses on HTTP. The -following sections explain the differences:

8.11.1 Output Triggered by a Method

The output message can be triggered by calling a method (such as a Scheduler when a was -started and a message was sent), as shown in the following example:

Groovy DSL.  -

def dsl = Contract.make {
-	// Human readable description
-	description 'Some description'
-	// Label by means of which the output message can be triggered
-	label 'some_label'
-	// input to the contract
-	input {
-		// the contract will be triggered by a method
-		triggeredBy('bookReturnedTriggered()')
-	}
-	// output message of the contract
-	outputMessage {
-		// destination to which the output message will be sent
-		sentTo('output')
-		// the body of the output message
-		body('''{ "bookName" : "foo" }''')
-		// the headers of the output message
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

-

YAML.  -

# Human readable description
-description: Some description
-# Label by means of which the output message can be triggered
-label: some_label
-input:
-  # the contract will be triggered by a method
-  triggeredBy: bookReturnedTriggered()
-# output message of the contract
-outputMessage:
-  # destination to which the output message will be sent
-  sentTo: output
-  # the body of the output message
-  body:
-    bookName: foo
-  # the headers of the output message
-  headers:
-    BOOK-NAME: foo

-

In the previous example case, the output message is sent to output if a method called -bookReturnedTriggered is executed. On the message publisher’s side, we generate a -test that calls that method to trigger the message. On the consumer side, you can use -the some_label to trigger the message.

8.11.2 Output Triggered by a Message

The output message can be triggered by receiving a message, as shown in the following -example:

Groovy DSL.  -

def dsl = Contract.make {
-	description 'Some Description'
-	label 'some_label'
-	// input is a message
-	input {
-		// the message was received from this destination
-		messageFrom('input')
-		// has the following body
-		messageBody([
-				bookName: 'foo'
-		])
-		// and the following headers
-		messageHeaders {
-			header('sample', 'header')
-		}
-	}
-	outputMessage {
-		sentTo('output')
-		body([
-				bookName: 'foo'
-		])
-		headers {
-			header('BOOK-NAME', 'foo')
-		}
-	}
-}

-

YAML.  -

# Human readable description
-description: Some description
-# Label by means of which the output message can be triggered
-label: some_label
-# input is a message
-input:
-  messageFrom: input
-  # has the following body
-  messageBody:
-    bookName: 'foo'
-  # and the following headers
-  messageHeaders:
-    sample: 'header'
-# output message of the contract
-outputMessage:
-  # destination to which the output message will be sent
-  sentTo: output
-  # the body of the output message
-  body:
-    bookName: foo
-  # the headers of the output message
-  headers:
-    BOOK-NAME: foo

-

In the preceding example, the output message is sent to output if a proper message is -received on the input destination. On the message publisher’s side, the engine -generates a test that sends the input message to the defined destination. On the -consumer side, you can either send a message to the input destination or use a label -(some_label in the example) to trigger the message.

8.11.3 Consumer/Producer

[Important]Important

This section is valid only for Groovy DSL.

In HTTP, you have a notion of client/stub and `server/test notation. You can also -use those paradigms in messaging. In addition, Spring Cloud Contract Verifier also -provides the consumer and producer methods, as presented in the following example -(note that you can use either $ or value methods to provide consumer and producer -parts):

					Contract.make {
-						label 'some_label'
-						input {
-							messageFrom value(consumer('jms:output'), producer('jms:input'))
-							messageBody([
-									bookName: 'foo'
-							])
-							messageHeaders {
-								header('sample', 'header')
-							}
-						}
-						outputMessage {
-							sentTo $(consumer('jms:input'), producer('jms:output'))
-							body([
-									bookName: 'foo'
-							])
-						}
-					}

8.11.4 Common

In the input or outputMessage section you can call assertThat with the name -of a method (e.g. assertThatMessageIsOnTheQueue()) that you have defined in the -base class or in a static import. Spring Cloud Contract will execute that method -in the generated test.

8.12 Multiple Contracts in One File

You can define multiple contracts in one file. Such a contract might resemble the -following example:

Groovy DSL.  -

import org.springframework.cloud.contract.spec.Contract
-
-[
-	Contract.make {
-		name("should post a user")
-		request {
-			method 'POST'
-			url('/users/1')
-		}
-		response {
-			status OK()
-		}
-	},
-	Contract.make {
-		request {
-			method 'POST'
-			url('/users/2')
-		}
-		response {
-			status OK()
-		}
-	}
-]

-

YAML.  -

---
-name: should post a user
-request:
-  method: POST
-  url: /users/1
-response:
-  status: 200
----
-request:
-  method: POST
-  url: /users/2
-response:
-  status: 200
----
-request:
-  method: POST
-  url: /users/3
-response:
-  status: 200

-

In the preceding example, one contract has the name field and the other does not. This -leads to generation of two tests that look more or less like this:

package org.springframework.cloud.contract.verifier.tests.com.hello;
-
-import com.example.TestBase;
-import com.jayway.jsonpath.DocumentContext;
-import com.jayway.jsonpath.JsonPath;
-import com.jayway.restassured.module.mockmvc.specification.MockMvcRequestSpecification;
-import com.jayway.restassured.response.ResponseOptions;
-import org.junit.Test;
-
-import static com.jayway.restassured.module.mockmvc.RestAssuredMockMvc.*;
-import static com.toomuchcoding.jsonassert.JsonAssertion.assertThatJson;
-import static org.assertj.core.api.Assertions.assertThat;
-
-public class V1Test extends TestBase {
-
-	@Test
-	public void validate_should_post_a_user() throws Exception {
-		// given:
-			MockMvcRequestSpecification request = given();
-
-		// when:
-			ResponseOptions response = given().spec(request)
-					.post("/users/1");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-	}
-
-	@Test
-	public void validate_withList_1() throws Exception {
-		// given:
-			MockMvcRequestSpecification request = given();
-
-		// when:
-			ResponseOptions response = given().spec(request)
-					.post("/users/2");
-
-		// then:
-			assertThat(response.statusCode()).isEqualTo(200);
-	}
-
-}

Notice that, for the contract that has the name field, the generated test method is named -validate_should_post_a_user. For the one that does not have the name, it is called -validate_withList_1. It corresponds to the name of the file WithList.groovy and the -index of the contract in the list.

The generated stubs is shown in the following example:

should post a user.json
-1_WithList.json

As you can see, the first file got the name parameter from the contract. The second -got the name of the contract file (WithList.groovy) prefixed with the index (in this -case, the contract had an index of 1 in the list of contracts in the file).

[Tip]Tip

As you can see, it is much better if you name your contracts because doing so makes -your tests far more meaningful.

8.13 Generating Spring REST Docs snippets from the contracts

When you want to include the requests and responses of your API using Spring REST Docs, -you only need to make some minor changes to your setup if you are using MockMvc and RestAssuredMockMvc. -Simply include the following dependencies if you haven’t already.

Maven.  -

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-starter-contract-verifier</artifactId>
-	<scope>test</scope>
-</dependency>
-<dependency>
-	<groupId>org.springframework.restdocs</groupId>
-	<artifactId>spring-restdocs-mockmvc</artifactId>
-	<optional>true</optional>
-</dependency>

-

Gradle.  -

testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
-testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc'

-

Next you need to make some changes to your base class like the following example.

package com.example.fraud;
-
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-import org.junit.runner.RunWith;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.restdocs.JUnitRestDocumentation;
-import org.springframework.test.context.junit4.SpringRunner;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = Application.class)
-public abstract class FraudBaseWithWebAppSetup {
-
-	private static final String OUTPUT = "target/generated-snippets";
-
-	@Rule
-	public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(OUTPUT);
-
-	@Rule
-	public TestName testName = new TestName();
-
-	@Autowired
-	private WebApplicationContext context;
-
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.mockMvc(MockMvcBuilders.webAppContextSetup(this.context)
-				.apply(documentationConfiguration(this.restDocumentation))
-				.alwaysDo(document(
-						getClass().getSimpleName() + "_" + testName.getMethodName()))
-				.build());
-	}
-
-	protected void assertThatRejectionReasonIsNull(Object rejectionReason) {
-		assert rejectionReason == null;
-	}
-
-}

In case you are using the standalone setup, you can set up RestAssuredMockMvc like this:

package com.example.fraud;
-
-import io.restassured.module.mockmvc.RestAssuredMockMvc;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.rules.TestName;
-
-import org.springframework.restdocs.JUnitRestDocumentation;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
-import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
-
-public abstract class FraudBaseWithStandaloneSetup {
-
-	private static final String OUTPUT = "target/generated-snippets";
-
-	@Rule
-	public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(OUTPUT);
-
-	@Rule
-	public TestName testName = new TestName();
-
-	@Before
-	public void setup() {
-		RestAssuredMockMvc.standaloneSetup(MockMvcBuilders
-				.standaloneSetup(new FraudDetectionController())
-				.apply(documentationConfiguration(this.restDocumentation))
-				.alwaysDo(document(
-						getClass().getSimpleName() + "_" + testName.getMethodName())));
-	}
-
-}
[Tip]Tip

You don’t need to specify the output directory for the generated snippets since version 1.2.0.RELEASE of Spring REST Docs.

9. Customization

[Important]Important

This section is valid only for Groovy DSL

You can customize the Spring Cloud Contract Verifier by extending the DSL, as shown in -the remainder of this section.

9.1 Extending the DSL

You can provide your own functions to the DSL. The key requirement for this feature is to -maintain the static compatibility. Later in this document, you can see examples of:

  • Creating a JAR with reusable classes.
  • Referencing of these classes in the DSLs.

You can find the full example -here.

9.1.1 Common JAR

The following examples show three classes that can be reused in the DSLs.

PatternUtils contains functions used by both the consumer and the producer.

package com.example;
-
-import java.util.regex.Pattern;
-
-/**
- * If you want to use {@link Pattern} directly in your tests
- * then you can create a class resembling this one. It can
- * contain all the {@link Pattern} you want to use in the DSL.
- *
- * <pre>
- * {@code
- * request {
- *     body(
- *         [ age: $(c(PatternUtils.oldEnough()))]
- *     )
- * }
- * </pre>
- *
- * Notice that we're using both {@code $()} for dynamic values
- * and {@code c()} for the consumer side.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class PatternUtils {
-
-	public static String tooYoung() {
-		//remove::start[]
-		return "[0-1][0-9]";
-		//remove::end[return]
-	}
-
-	public static Pattern oldEnough() {
-		//remove::start[]
-		return Pattern.compile("[2-9][0-9]");
-		//remove::end[return]
-	}
-
-	/**
-	 * Makes little sense but it's just an example ;)
-	 */
-	public static Pattern ok() {
-		//remove::start[]
-		return Pattern.compile("OK");
-		//remove::end[return]
-	}
-}
-//end::impl[]

ConsumerUtils contains functions used by the consumer.

package com.example;
-
-import org.springframework.cloud.contract.spec.internal.ClientDslProperty;
-
-/**
- * DSL Properties passed to the DSL from the consumer's perspective.
- * That means that on the input side {@code Request} for HTTP
- * or {@code Input} for messaging you can have a regular expression.
- * On the {@code Response} for HTTP or {@code Output} for messaging
- * you have to have a concrete value.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class ConsumerUtils {
-	/**
-	 * Consumer side property. By using the {@link ClientDslProperty}
-	 * you can omit most of boilerplate code from the perspective
-	 * of dynamic values. Example
-	 *
-	 * <pre>
-	 * {@code
-	 * request {
-	 *     body(
-	 *         [ age: $(ConsumerUtils.oldEnough())]
-	 *     )
-	 * }
-	 * </pre>
-	 *
-	 * That way it's in the implementation that we decide what value we will pass to the consumer
-	 * and which one to the producer.
-	 *
-	 * @author Marcin Grzejszczak
-	 */
-	public static ClientDslProperty oldEnough() {
-		//remove::start[]
-		// this example is not the best one and
-		// theoretically you could just pass the regex instead of `ServerDslProperty` but
-		// it's just to show some new tricks :)
-		return new ClientDslProperty(PatternUtils.oldEnough(), 40);
-		//remove::end[return]
-	}
-
-}
-//end::impl[]

ProducerUtils contains functions used by the producer.

package com.example;
-
-import org.springframework.cloud.contract.spec.internal.ServerDslProperty;
-
-/**
- * DSL Properties passed to the DSL from the producer's perspective.
- * That means that on the input side {@code Request} for HTTP
- * or {@code Input} for messaging you have to have a concrete value.
- * On the {@code Response} for HTTP or {@code Output} for messaging
- * you can have a regular expression.
- *
- * @author Marcin Grzejszczak
- */
-//tag::impl[]
-public class ProducerUtils {
-
-	/**
-	 * Producer side property. By using the {@link ProducerUtils}
-	 * you can omit most of boilerplate code from the perspective
-	 * of dynamic values. Example
-	 *
-	 * <pre>
-	 * {@code
-	 * response {
-	 *     body(
-	 *         [ status: $(ProducerUtils.ok())]
-	 *     )
-	 * }
-	 * </pre>
-	 *
-	 * That way it's in the implementation that we decide what value we will pass to the consumer
-	 * and which one to the producer.
-	 */
-	public static ServerDslProperty ok() {
-		// this example is not the best one and
-		// theoretically you could just pass the regex instead of `ServerDslProperty` but
-		// it's just to show some new tricks :)
-		return new ServerDslProperty( PatternUtils.ok(), "OK");
-	}
-}
-//end::impl[]

9.1.2 Adding the Dependency to the Project

In order for the plugins and IDE to be able to reference the common JAR classes, you need -to pass the dependency to your project.

9.1.3 Test the Dependency in the Project’s Dependencies

First, add the common jar dependency as a test dependency. Because your contracts files -are available on the test resources path, the common jar classes automatically become -visible in your Groovy files. The following examples show how to test the dependency:

Maven.  -

<dependency>
-	<groupId>com.example</groupId>
-	<artifactId>beer-common</artifactId>
-	<version>${project.version}</version>
-	<scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile("com.example:beer-common:0.0.1.BUILD-SNAPSHOT")

-

9.1.4 Test a Dependency in the Plugin’s Dependencies

Now, you must add the dependency for the plugin to reuse at runtime, as shown in the -following example:

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example</packageWithBaseClasses>
-		<baseClassMappings>
-			<baseClassMapping>
-				<contractPackageRegex>.*intoxication.*</contractPackageRegex>
-				<baseClassFQN>com.example.intoxication.BeerIntoxicationBase</baseClassFQN>
-			</baseClassMapping>
-		</baseClassMappings>
-	</configuration>
-	<dependencies>
-		<dependency>
-			<groupId>com.example</groupId>
-			<artifactId>beer-common</artifactId>
-			<version>${project.version}</version>
-			<scope>compile</scope>
-		</dependency>
-	</dependencies>
-</plugin>

-

Gradle.  -

classpath "com.example:beer-common:0.0.1.BUILD-SNAPSHOT"

-

9.1.5 Referencing classes in DSLs

You can now reference your classes in your DSL, as shown in the following example:

package contracts.beer.rest
-
-import com.example.ConsumerUtils
-import com.example.ProducerUtils
-import org.springframework.cloud.contract.spec.Contract
-
-Contract.make {
-	description("""
-Represents a successful scenario of getting a beer
-
-```
-given:
-	client is old enough
-when:
-	he applies for a beer
-then:
-	we'll grant him the beer
-```
-
-""")
-	request {
-		method 'POST'
-		url '/check'
-		body(
-				age: $(ConsumerUtils.oldEnough())
-		)
-		headers {
-			contentType(applicationJson())
-		}
-	}
-	response {
-		status 200
-		body("""
-			{
-				"status": "${value(ProducerUtils.ok())}"
-			}
-			""")
-		headers {
-			contentType(applicationJson())
-		}
-	}
-}
[Important]Important

You can set the Spring Cloud Contract plugin up by setting convertToYaml to true. That way you will NOT have to add the dependency with the extended functionality to the consumer side, since the consumer side will be using YAML contracts instead of Groovy ones.

10. Using the Pluggable Architecture

You may encounter cases where you have your contracts have been defined in other formats, -such as YAML, RAML or PACT. In those cases, you still want to benefit from the automatic -generation of tests and stubs. You can add your own implementation for generating both -tests and stubs. Also, you can customize the way tests are generated (for example, you -can generate tests for other languages) and the way stubs are generated (for example, you -can generate stubs for other HTTP server implementations).

10.1 Custom Contract Converter

The ContractConverter interface lets you register your own implementation of a contract -structure converter. The following code listing shows the ContractConverter interface:

package org.springframework.cloud.contract.spec
-
-/**
- * Converter to be used to convert FROM {@link File} TO {@link Contract}
- * and from {@link Contract} to {@code T}
- *
- * @param <T >     - type to which we want to convert the contract
- *
- * @author Marcin Grzejszczak
- * @since 1.1.0
- */
-interface ContractConverter<T> extends ContractStorer<T> {
-
-	/**
-	 * Should this file be accepted by the converter. Can use the file extension
-	 * to check if the conversion is possible.
-	 *
-	 * @param file - file to be considered for conversion
-	 * @return - {@code true} if the given implementation can convert the file
-	 */
-	boolean isAccepted(File file)
-
-	/**
-	 * Converts the given {@link File} to its {@link Contract} representation
-	 *
-	 * @param file - file to convert
-	 * @return - {@link Contract} representation of the file
-	 */
-	Collection<Contract> convertFrom(File file)
-
-	/**
-	 * Converts the given {@link Contract} to a {@link T} representation
-	 *
-	 * @param contract - the parsed contract
-	 * @return - {@link T} the type to which we do the conversion
-	 */
-	T convertTo(Collection<Contract> contract)
-}

Your implementation must define the condition on which it should start the -conversion. Also, you must define how to perform that conversion in both directions.

[Important]Important

Once you create your implementation, you must create a -/META-INF/spring.factories file in which you provide the fully qualified name of your -implementation.

The following example shows a typical spring.factories file:

org.springframework.cloud.contract.spec.ContractConverter=\
-org.springframework.cloud.contract.verifier.converter.YamlContractConverter

10.1.1 Pact Converter

Spring Cloud Contract includes support for Pact representation of -contracts up until v4. Instead of using the Groovy DSL, you can use Pact files. In this section, we -present how to add Pact support for your project. Note however that not all functionality is supported. -Starting with v3 you can combine multiple matcher for the same element; -you can use matchers for the body, headers, request and path; and you can use value generators. -Spring Cloud Contract currently only supports multiple matchers that are combined using the AND rule logic. -Next to that the request and path matchers are skipped during the conversion. -When using a date, time or datetime value generator with a given format, -the given format will be skipped and the ISO format will be used.

In order to properly support the Spring Cloud Contract way of doing messaging -with Pact you’ll have to provide some additional meta data entries. Below you can find a list of such entries:

  • to define the destination to which a message gets sent, you have to -set a metaData entry in the Pact file, with key sentTo equal to the destination to which a message is to be sent. E.g. "metaData": { "sentTo": "activemq:output" }

10.1.2 Pact Contract

Consider following example of a Pact contract, which is a file under the -src/test/resources/contracts folder.

{
-  "provider": {
-    "name": "Provider"
-  },
-  "consumer": {
-    "name": "Consumer"
-  },
-  "interactions": [
-    {
-      "description": "",
-      "request": {
-        "method": "PUT",
-        "path": "/fraudcheck",
-        "headers": {
-          "Content-Type": "application/vnd.fraud.v1+json"
-        },
-        "body": {
-          "clientId": "1234567890",
-          "loanAmount": 99999
-        },
-        "generators": {
-          "body": {
-            "$.clientId": {
-              "type": "Regex",
-              "regex": "[0-9]{10}"
-            }
-          }
-        },
-        "matchingRules": {
-          "header": {
-            "Content-Type": {
-              "matchers": [
-                {
-                  "match": "regex",
-                  "regex": "application/vnd\\.fraud\\.v1\\+json.*"
-                }
-              ],
-              "combine": "AND"
-            }
-          },
-          "body": {
-            "$.clientId": {
-              "matchers": [
-                {
-                  "match": "regex",
-                  "regex": "[0-9]{10}"
-                }
-              ],
-              "combine": "AND"
-            }
-          }
-        }
-      },
-      "response": {
-        "status": 200,
-        "headers": {
-          "Content-Type": "application/vnd.fraud.v1+json;charset=UTF-8"
-        },
-        "body": {
-          "fraudCheckStatus": "FRAUD",
-          "rejectionReason": "Amount too high"
-        },
-        "matchingRules": {
-          "header": {
-            "Content-Type": {
-              "matchers": [
-                {
-                  "match": "regex",
-                  "regex": "application/vnd\\.fraud\\.v1\\+json.*"
-                }
-              ],
-              "combine": "AND"
-            }
-          },
-          "body": {
-            "$.fraudCheckStatus": {
-              "matchers": [
-                {
-                  "match": "regex",
-                  "regex": "FRAUD"
-                }
-              ],
-              "combine": "AND"
-            }
-          }
-        }
-      }
-    }
-  ],
-  "metadata": {
-    "pact-specification": {
-      "version": "3.0.0"
-    },
-    "pact-jvm": {
-      "version": "3.5.13"
-    }
-  }
-}

The remainder of this section about using Pact refers to the preceding file.

10.1.3 Pact for Producers

On the producer side, you must add two additional dependencies to your plugin -configuration. One is the Spring Cloud Contract Pact support, and the other represents -the current Pact version that you use.

Maven.  -

<plugin>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-maven-plugin</artifactId>
-	<version>${spring-cloud-contract.version}</version>
-	<extensions>true</extensions>
-	<configuration>
-		<packageWithBaseClasses>com.example.fraud</packageWithBaseClasses>
-	</configuration>
-	<dependencies>
-		<dependency>
-			<groupId>org.springframework.cloud</groupId>
-			<artifactId>spring-cloud-contract-pact</artifactId>
-			<version>${spring-cloud-contract.version}</version>
-		</dependency>
-	</dependencies>
-</plugin>

-

Gradle.  -

classpath "org.springframework.cloud:spring-cloud-contract-pact:${findProperty('verifierVersion') ?: verifierVersion}"

-

When you execute the build of your application, a test will be generated. The generated -test might be as follows:

@Test
-public void validate_shouldMarkClientAsFraud() throws Exception {
-	// given:
-		MockMvcRequestSpecification request = given()
-				.header("Content-Type", "application/vnd.fraud.v1+json")
-				.body("{\"clientId\":\"1234567890\",\"loanAmount\":99999}");
-
-	// when:
-		ResponseOptions response = given().spec(request)
-				.put("/fraudcheck");
-
-	// then:
-		assertThat(response.statusCode()).isEqualTo(200);
-		assertThat(response.header("Content-Type")).matches("application/vnd\\.fraud\\.v1\\+json.*");
-	// and:
-		DocumentContext parsedJson = JsonPath.parse(response.getBody().asString());
-		assertThatJson(parsedJson).field("['rejectionReason']").isEqualTo("Amount too high");
-	// and:
-		assertThat(parsedJson.read("$.fraudCheckStatus", String.class)).matches("FRAUD");
-}

The corresponding generated stub might be as follows:

{
-  "id" : "996ae5ae-6834-4db6-8fac-358ca187ab62",
-  "uuid" : "996ae5ae-6834-4db6-8fac-358ca187ab62",
-  "request" : {
-    "url" : "/fraudcheck",
-    "method" : "PUT",
-    "headers" : {
-      "Content-Type" : {
-        "matches" : "application/vnd\\.fraud\\.v1\\+json.*"
-      }
-    },
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$[?(@.['loanAmount'] == 99999)]"
-    }, {
-      "matchesJsonPath" : "$[?(@.clientId =~ /([0-9]{10})/)]"
-    } ]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "{\"fraudCheckStatus\":\"FRAUD\",\"rejectionReason\":\"Amount too high\"}",
-    "headers" : {
-      "Content-Type" : "application/vnd.fraud.v1+json;charset=UTF-8"
-    },
-    "transformers" : [ "response-template" ]
-  },
-}

10.1.4 Pact for Consumers

On the producer side, you must add two additional dependencies to your project -dependencies. One is the Spring Cloud Contract Pact support, and the other represents the -current Pact version that you use.

Maven.  -

<dependency>
-	<groupId>org.springframework.cloud</groupId>
-	<artifactId>spring-cloud-contract-pact</artifactId>
-	<scope>test</scope>
-</dependency>

-

Gradle.  -

testCompile "org.springframework.cloud:spring-cloud-contract-pact"

-

10.2 Using the Custom Test Generator

If you want to generate tests for languages other than Java or you are not happy with the -way the verifier builds Java tests, you can register your own implementation.

The SingleTestGenerator interface lets you register your own implementation. The -following code listing shows the SingleTestGenerator interface:

package org.springframework.cloud.contract.verifier.builder
-
-
-import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties
-import org.springframework.cloud.contract.verifier.file.ContractMetadata
-
-/**
- * Builds a single test.
- *
- * @since 1.1.0
- */
-trait SingleTestGenerator {
-
-	/**
-	 * Creates contents of a single test class in which all test scenarios from
-	 * the contract metadata should be placed.
-	 *
-	 * @param properties - properties passed to the plugin
-	 * @param listOfFiles - list of parsed contracts with additional metadata
-	 * @param className - the name of the generated test class
-	 * @param classPackage - the name of the package in which the test class should be stored
-	 * @param includedDirectoryRelativePath - relative path to the included directory
-	 * @return contents of a single test class
-	 * @deprecated use{@link SingleTestGenerator#buildClass(ContractVerifierConfigProperties, Collection, String, GeneratedClassData)}
-	 */
-	@Deprecated
-	abstract String buildClass(ContractVerifierConfigProperties properties,
-			Collection<ContractMetadata> listOfFiles, String className, String classPackage, String includedDirectoryRelativePath)
-
-	/**
-	 * Creates contents of a single test class in which all test scenarios from
-	 * the contract metadata should be placed.
-	 *
-	 * @param properties - properties passed to the plugin
-	 * @param listOfFiles - list of parsed contracts with additional metadata
-	 * @param generatedClassData - information about the generated class
-	 * @param includedDirectoryRelativePath - relative path to the included directory
-	 * @return contents of a single test class
-	 */
-	String buildClass(ContractVerifierConfigProperties properties,
-			Collection<ContractMetadata> listOfFiles, String includedDirectoryRelativePath, GeneratedClassData generatedClassData) {
-		String className = generatedClassData.className
-		String classPackage = generatedClassData.classPackage
-		String path = includedDirectoryRelativePath
-		return buildClass(properties, listOfFiles, className, classPackage, path)
-	}
-
-	/**
-	 * Extension that should be appended to the generated test class. E.g. {@code .java} or {@code .php}
-	 *
-	 * @param properties - properties passed to the plugin
-	 */
-	abstract String fileExtension(ContractVerifierConfigProperties properties)
-
-	static class GeneratedClassData {
-		public final String className
-		public final String classPackage
-		public final java.nio.file.Path testClassPath
-
-		GeneratedClassData(String className, String classPackage,
-				java.nio.file.Path testClassPath) {
-			this.className = className
-			this.classPackage = classPackage
-			this.testClassPath = testClassPath
-		}
-	}
-}

Again, you must provide a spring.factories file, such as the one shown in the following -example:

org.springframework.cloud.contract.verifier.builder.SingleTestGenerator=/
-com.example.MyGenerator

10.3 Using the Custom Stub Generator

If you want to generate stubs for stub servers other than WireMock, you can plug in your -own implementation of the StubGenerator interface. The following code listing shows the -StubGenerator interface:

package org.springframework.cloud.contract.verifier.converter
-
-import groovy.transform.CompileStatic
-
-import org.springframework.cloud.contract.spec.Contract
-import org.springframework.cloud.contract.verifier.file.ContractMetadata
-
-/**
- * Converts contracts into their stub representation.
- *
- * @since 1.1.0
- */
-@CompileStatic
-interface StubGenerator {
-
-	/**
-	 * @return {@code true} if the converter can handle the file to convert it into a stub.
-	 */
-	boolean canHandleFileName(String fileName)
-
-	/**
-	 * @return the collection of converted contracts into stubs. One contract can
-	 * result in multiple stubs.
-	 */
-	Map<Contract, String> convertContents(String rootName, ContractMetadata content)
-
-	/**
-	 * @return the name of the converted stub file. If you have multiple contracts
-	 * in a single file then a prefix will be added to the generated file. If you
-	 * provide the {@link Contract#name} field then that field will override the
-	 * generated file name.
-	 *
-	 * Example: name of file with 2 contracts is {@code foo.groovy}, it will be
-	 * converted by the implementation to {@code foo.json}. The recursive file
-	 * converter will create two files {@code 0_foo.json} and {@code 1_foo.json}
-	 */
-	String generateOutputFileNameForInput(String inputFileName)
-}

Again, you must provide a spring.factories file, such as the one shown in the following -example:

# Stub converters
-org.springframework.cloud.contract.verifier.converter.StubGenerator=\
-org.springframework.cloud.contract.verifier.wiremock.DslToWireMockClientConverter

The default implementation is the WireMock stub generation.

[Tip]Tip

You can provide multiple stub generator implementations. For example, from a single -DSL, you can produce both WireMock stubs and Pact files.

10.4 Using the Custom Stub Runner

If you decide to use a custom stub generation, you also need a custom way of running -stubs with your different stub provider.

Assume that you use Moco to build your stubs and that -you have written a stub generator and placed your stubs in a JAR file.

In order for Stub Runner to know how to run your stubs, you have to define a custom -HTTP Stub server implementation, which might resemble the following example:

package org.springframework.cloud.contract.stubrunner.provider.moco
-
-import com.github.dreamhead.moco.bootstrap.arg.HttpArgs
-import com.github.dreamhead.moco.runner.JsonRunner
-import com.github.dreamhead.moco.runner.RunnerSetting
-import groovy.util.logging.Commons
-
-import org.springframework.cloud.contract.stubrunner.HttpServerStub
-import org.springframework.util.SocketUtils
-
-@Commons
-class MocoHttpServerStub implements HttpServerStub {
-
-	private boolean started
-	private JsonRunner runner
-	private int port
-
-	@Override
-	int port() {
-		if (!isRunning()) {
-			return -1
-		}
-		return port
-	}
-
-	@Override
-	boolean isRunning() {
-		return started
-	}
-
-	@Override
-	HttpServerStub start() {
-		return start(SocketUtils.findAvailableTcpPort())
-	}
-
-	@Override
-	HttpServerStub start(int port) {
-		this.port = port
-		return this
-	}
-
-	@Override
-	HttpServerStub stop() {
-		if (!isRunning()) {
-			return this
-		}
-		this.runner.stop()
-		return this
-	}
-
-	@Override
-	HttpServerStub registerMappings(Collection<File> stubFiles) {
-		List<RunnerSetting> settings = stubFiles.findAll { it.name.endsWith("json") }
-			.collect {
-			log.info("Trying to parse [${it.name}]")
-			try {
-				return RunnerSetting.aRunnerSetting().withStream(it.newInputStream()).
-					build()
-			}
-			catch (Exception e) {
-				log.warn("Exception occurred while trying to parse file [${it.name}]", e)
-				return null
-			}
-		}.findAll { it }
-		this.runner = JsonRunner.newJsonRunnerWithSetting(settings,
-			HttpArgs.httpArgs().withPort(this.port).build())
-		this.runner.run()
-		this.started = true
-		return this
-	}
-
-	@Override
-	String registeredMappings() {
-		return ""
-	}
-
-	@Override
-	boolean isAccepted(File file) {
-		return file.name.endsWith(".json")
-	}
-}

Then, you can register it in your spring.factories file, as shown in the following -example:

org.springframework.cloud.contract.stubrunner.HttpServerStub=\
-org.springframework.cloud.contract.stubrunner.provider.moco.MocoHttpServerStub

Now you can run stubs with Moco.

[Important]Important

If you do not provide any implementation, then the default (WireMock) -implementation is used. If you provide more than one, the first one on the list is used.

10.5 Using the Custom Stub Downloader

You can customize the way your stubs are downloaded by creating an implementation of the -StubDownloaderBuilder interface, as shown in the following example:

package com.example;
-
-class CustomStubDownloaderBuilder implements StubDownloaderBuilder {
-
-	@Override
-	public StubDownloader build(final StubRunnerOptions stubRunnerOptions) {
-		return new StubDownloader() {
-			@Override
-			public Map.Entry<StubConfiguration, File> downloadAndUnpackStubJar(
-					StubConfiguration config) {
-				File unpackedStubs = retrieveStubs();
-				return new AbstractMap.SimpleEntry<>(
-						new StubConfiguration(config.getGroupId(), config.getArtifactId(), version,
-								config.getClassifier()), unpackedStubs);
-			}
-
-			File retrieveStubs() {
-			    // here goes your custom logic to provide a folder where all the stubs reside
-			}
-}

Then you can register it in your spring.factories file, as shown in the following -example:

# Example of a custom Stub Downloader Provider
-org.springframework.cloud.contract.stubrunner.StubDownloaderBuilder=\
-com.example.CustomStubDownloaderBuilder

Now you can pick a folder with the source of your stubs.

[Important]Important

If you do not provide any implementation, then the default is used (scan classpath). -If you provide the stubsMode = StubRunnerProperties.StubsMode.LOCAL or -, stubsMode = StubRunnerProperties.StubsMode.REMOTE then the Aether implementation will be used -If you provide more than one, then the first one on the list is used.

10.6 Using the SCM Stub Downloader

Whenever the repositoryRoot starts with a SCM protocol -(currently we support only git://), the stub downloader will try -to clone the repository and use it as a source of contracts -to generate tests or stubs.

Either via environment variables, system properties, properties set -inside the plugin or contracts repository configuration you can -tweak the downloader’s behaviour. Below you can find the list of -properties

Table 10.1. SCM Stub Downloader properties

Type of a property

Name of the property

Description

* git.branch (plugin prop)

* stubrunner.properties.git.branch (system prop)

* STUBRUNNER_PROPERTIES_GIT_BRANCH (env prop)

master

Which branch to checkout

* git.username (plugin prop)

* stubrunner.properties.git.username (system prop)

* STUBRUNNER_PROPERTIES_GIT_USERNAME (env prop)

 

Git clone username

* git.password (plugin prop)

* stubrunner.properties.git.password (system prop)

* STUBRUNNER_PROPERTIES_GIT_PASSWORD (env prop)

 

Git clone password

* git.no-of-attempts (plugin prop)

* stubrunner.properties.git.no-of-attempts (system prop)

* STUBRUNNER_PROPERTIES_GIT_NO_OF_ATTEMPTS (env prop)

10

Number of attempts to push the commits to origin

* git.wait-between-attempts (Plugin prop)

* stubrunner.properties.git.wait-between-attempts (system prop)

* STUBRUNNER_PROPERTIES_GIT_WAIT_BETWEEN_ATTEMPTS (env prop)

1000

Number of millis to wait between attempts to push the commits to origin


10.7 Using the Pact Stub Downloader

Whenever the repositoryRoot starts with a Pact protocol -(starts with pact://), the stub downloader will try -to fetch the Pact contract definitions from the Pact Broker. -Whatever is set after pact:// will be parsed as the Pact Broker URL.

Either via environment variables, system properties, properties set -inside the plugin or contracts repository configuration you can -tweak the downloader’s behaviour. Below you can find the list of -properties

Table 10.2. SCM Stub Downloader properties

Name of a property

Default

Description

* pactbroker.host (plugin prop)

* stubrunner.properties.pactbroker.host (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_HOST (env prop)

Host from URL passed to repositoryRoot

What is the URL of Pact Broker

* pactbroker.port (plugin prop)

* stubrunner.properties.pactbroker.port (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PORT (env prop)

Port from URL passed to repositoryRoot

What is the port of Pact Broker

* pactbroker.protocol (plugin prop)

* stubrunner.properties.pactbroker.protocol (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROTOCOL (env prop)

Protocol from URL passed to repositoryRoot

What is the protocol of Pact Broker

* pactbroker.tags (plugin prop)

* stubrunner.properties.pactbroker.tags (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_TAGS (env prop)

Version of the stub, or latest if version is +

What tags should be used to fetch the stub

* pactbroker.auth.scheme (plugin prop)

* stubrunner.properties.pactbroker.auth.scheme (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_SCHEME (env prop)

Basic

What kind of authentication should be used to connect to the Pact Broker

* pactbroker.auth.username (plugin prop)

* stubrunner.properties.pactbroker.auth.username (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_USERNAME (env prop)

The username passed to contractsRepositoryUsername (maven) or contractRepository.username (gradle)

Username used to connect to the Pact Broker

* pactbroker.auth.password (plugin prop)

* stubrunner.properties.pactbroker.auth.password (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_AUTH_PASSWORD (env prop)

The password passed to contractsRepositoryPassword (maven) or contractRepository.password (gradle)

Password used to connect to the Pact Broker

* pactbroker.provider-name-with-group-id (plugin prop)

* stubrunner.properties.pactbroker.provider-name-with-group-id (system prop)

* STUBRUNNER_PROPERTIES_PACTBROKER_PROVIDER_NAME_WITH_GROUP_ID (env prop)

false

When true, the provider name will be a combination of groupId:artifactId. If false, just artifactId is used


11. Spring Cloud Contract WireMock

The Spring Cloud Contract WireMock modules let you use WireMock in a -Spring Boot application. Check out the -samples -for more details.

If you have a Spring Boot application that uses Tomcat as an embedded server (which is -the default with spring-boot-starter-web), you can add -spring-cloud-starter-contract-stub-runner to your classpath and add @AutoConfigureWireMock in -order to be able to use Wiremock in your tests. Wiremock runs as a stub server and you -can register stub behavior using a Java API or via static JSON declarations as part of -your test. The following code shows an example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-@AutoConfigureWireMock(port = 0)
-public class WiremockForDocsTests {
-
-	// A service that calls out over HTTP
-	@Autowired
-	private Service service;
-
-	@Before
-	public void setup() {
-		this.service.setBase("http://localhost:"
-				+ this.environment.getProperty("wiremock.server.port"));
-	}
-
-	// Using the WireMock APIs in the normal way:
-	@Test
-	public void contextLoads() throws Exception {
-		// Stubbing WireMock
-		stubFor(get(urlEqualTo("/resource")).willReturn(aResponse()
-				.withHeader("Content-Type", "text/plain").withBody("Hello World!")));
-		// We're asserting if WireMock responded properly
-		assertThat(this.service.go()).isEqualTo("Hello World!");
-	}
-
-}

To start the stub server on a different port use (for example), -@AutoConfigureWireMock(port=9999). For a random port, use a value of 0. The stub -server port can be bound in the test application context with the "wiremock.server.port" -property. Using @AutoConfigureWireMock adds a bean of type WiremockConfiguration to -your test application context, where it will be cached in between methods and classes -having the same context, the same as for Spring integration tests. Also you can inject a bean of type WireMockServer into your test.

11.1 Registering Stubs Automatically

If you use @AutoConfigureWireMock, it registers WireMock JSON stubs from the file -system or classpath (by default, from file:src/test/resources/mappings). You can -customize the locations using the stubs attribute in the annotation, which can be an -Ant-style resource pattern or a directory. In the case of a directory, */.json is -appended. The following code shows an example:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureWireMock(stubs="classpath:/stubs")
-public class WiremockImportApplicationTests {
-
-	@Autowired
-	private Service service;
-
-	@Test
-	public void contextLoads() throws Exception {
-		assertThat(this.service.go()).isEqualTo("Hello World!");
-	}
-
-}
[Note]Note

Actually, WireMock always loads mappings from src/test/resources/mappings as -well as the custom locations in the stubs attribute. To change this behavior, you can -also specify a files root as described in the next section of this document.

If you’re using Spring Cloud Contract’s default stub jars, then your -stubs are stored under /META-INF/group-id/artifact-id/versions/mappings/ folder. If you want to register all stubs from that location, from all embedded JARs, then it’s enough to use the following syntax.

@AutoConfigureWireMock(port = 0, stubs = "classpath*:/META-INF/**/mappings/**/*.json")

11.2 Using Files to Specify the Stub Bodies

WireMock can read response bodies from files on the classpath or the file system. In that -case, you can see in the JSON DSL that the response has a bodyFileName instead of a -(literal) body. The files are resolved relative to a root directory (by default, -src/test/resources/__files). To customize this location you can set the files -attribute in the @AutoConfigureWireMock annotation to the location of the parent -directory (in other words, __files is a subdirectory). You can use Spring resource -notation to refer to file:…​ or classpath:…​ locations. Generic URLs are not -supported. A list of values can be given, in which case WireMock resolves the first file -that exists when it needs to find a response body.

[Note]Note

When you configure the files root, it also affects the -automatic loading of stubs, because they come from the root location -in a subdirectory called "mappings". The value of files has no -effect on the stubs loaded explicitly from the stubs attribute.

11.3 Alternative: Using JUnit Rules

For a more conventional WireMock experience, you can use JUnit @Rules to start and stop -the server. To do so, use the WireMockSpring convenience class to obtain an Options -instance, as shown in the following example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-public class WiremockForDocsClassRuleTests {
-
-	// Start WireMock on some dynamic port
-	// for some reason `dynamicPort()` is not working properly
-	@ClassRule
-	public static WireMockClassRule wiremock = new WireMockClassRule(
-			WireMockSpring.options().dynamicPort());
-
-	// A service that calls out over HTTP to wiremock's port
-	@Autowired
-	private Service service;
-
-	@Before
-	public void setup() {
-		this.service.setBase("http://localhost:" + wiremock.port());
-	}
-
-	// Using the WireMock APIs in the normal way:
-	@Test
-	public void contextLoads() throws Exception {
-		// Stubbing WireMock
-		wiremock.stubFor(get(urlEqualTo("/resource")).willReturn(aResponse()
-				.withHeader("Content-Type", "text/plain").withBody("Hello World!")));
-		// We're asserting if WireMock responded properly
-		assertThat(this.service.go()).isEqualTo("Hello World!");
-	}
-
-}

The @ClassRule means that the server shuts down after all the methods in this class -have been run.

11.4 Relaxed SSL Validation for Rest Template

WireMock lets you stub a "secure" server with an "https" URL protocol. If your -application wants to contact that stub server in an integration test, it will find that -the SSL certificates are not valid (the usual problem with self-installed certificates). -The best option is often to re-configure the client to use "http". If that’s not an -option, you can ask Spring to configure an HTTP client that ignores SSL validation errors -(do so only for tests, of course).

To make this work with minimum fuss, you need to be using the Spring Boot -RestTemplateBuilder in your app, as shown in the following example:

@Bean
-public RestTemplate restTemplate(RestTemplateBuilder builder) {
-	return builder.build();
-}

You need RestTemplateBuilder because the builder is passed through callbacks to -initialize it, so the SSL validation can be set up in the client at that point. This -happens automatically in your test if you are using the @AutoConfigureWireMock -annotation or the stub runner. If you use the JUnit @Rule approach, you need to add the -@AutoConfigureHttpClient annotation as well, as shown in the following example:

@RunWith(SpringRunner.class)
-@SpringBootTest("app.baseUrl=https://localhost:6443")
-@AutoConfigureHttpClient
-public class WiremockHttpsServerApplicationTests {
-
-	@ClassRule
-	public static WireMockClassRule wiremock = new WireMockClassRule(
-			WireMockSpring.options().httpsPort(6443));
-...
-}

If you are using spring-boot-starter-test, you have the Apache HTTP client on the -classpath and it is selected by the RestTemplateBuilder and configured to ignore SSL -errors. If you use the default java.net client, you do not need the annotation (but it -won’t do any harm). There is no support currently for other clients, but it may be added -in future releases.

To disable the custom RestTemplateBuilder, set the wiremock.rest-template-ssl-enabled -property to false.

11.5 WireMock and Spring MVC Mocks

Spring Cloud Contract provides a convenience class that can load JSON WireMock stubs into -a Spring MockRestServiceServer. The following code shows an example:

@RunWith(SpringRunner.class)
-@SpringBootTest(webEnvironment = WebEnvironment.NONE)
-public class WiremockForDocsMockServerApplicationTests {
-
-	@Autowired
-	private RestTemplate restTemplate;
-
-	@Autowired
-	private Service service;
-
-	@Test
-	public void contextLoads() throws Exception {
-		// will read stubs classpath
-		MockRestServiceServer server = WireMockRestServiceServer.with(this.restTemplate)
-				.baseUrl("https://example.org").stubs("classpath:/stubs/resource.json")
-				.build();
-		// We're asserting if WireMock responded properly
-		assertThat(this.service.go()).isEqualTo("Hello World");
-		server.verify();
-	}
-
-}

The baseUrl value is prepended to all mock calls, and the stubs() method takes a stub -path resource pattern as an argument. In the preceding example, the stub defined at -/stubs/resource.json is loaded into the mock server. If the RestTemplate is asked to -visit https://example.org/, it gets the responses as being declared at that URL. More -than one stub pattern can be specified, and each one can be a directory (for a recursive -list of all ".json"), a fixed filename (as in the example above), or an Ant-style -pattern. The JSON format is the normal WireMock format, which you can read about in the -WireMock website.

Currently, the Spring Cloud Contract Verifier supports Tomcat, Jetty, and Undertow as -Spring Boot embedded servers, and Wiremock itself has "native" support for a particular -version of Jetty (currently 9.2). To use the native Jetty, you need to add the native -Wiremock dependencies and exclude the Spring Boot container (if there is one).

11.6 Customization of WireMock configuration

You can register a bean of org.springframework.cloud.contract.wiremock.WireMockConfigurationCustomizer type -in order to customize the WireMock configuration (e.g. add custom transformers). -Example:

		@Bean
-		WireMockConfigurationCustomizer optionsCustomizer() {
-			return new WireMockConfigurationCustomizer() {
-				@Override
-				public void customize(WireMockConfiguration options) {
-// perform your customization here
-				}
-			};
-		}

11.7 Generating Stubs using REST Docs

Spring REST Docs can be used to generate -documentation (for example in Asciidoctor format) for an HTTP API with Spring MockMvc -or WebTestClient or Rest Assured. At the same time that you generate documentation for your API, you can also -generate WireMock stubs by using Spring Cloud Contract WireMock. To do so, write your -normal REST Docs test cases and use @AutoConfigureRestDocs to have stubs be -automatically generated in the REST Docs output directory. The following code shows an -example using MockMvc:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureRestDocs(outputDir = "target/snippets")
-@AutoConfigureMockMvc
-public class ApplicationTests {
-
-	@Autowired
-	private MockMvc mockMvc;
-
-	@Test
-	public void contextLoads() throws Exception {
-		mockMvc.perform(get("/resource"))
-				.andExpect(content().string("Hello World"))
-				.andDo(document("resource"));
-	}
-}

This test generates a WireMock stub at "target/snippets/stubs/resource.json". It matches -all GET requests to the "/resource" path. The same example with WebTestClient (used -for testing Spring WebFlux applications) would look like this:

@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureRestDocs(outputDir = "target/snippets")
-@AutoConfigureWebTestClient
-public class ApplicationTests {
-
-	@Autowired
-	private WebTestClient client;
-
-	@Test
-	public void contextLoads() throws Exception {
-		client.get().uri("/resource").exchange()
-				.expectBody(String.class).isEqualTo("Hello World")
- 				.consumeWith(document("resource"));
-	}
-}

Without any additional configuration, these tests create a stub with a request matcher -for the HTTP method and all headers except "host" and "content-length". To match the -request more precisely (for example, to match the body of a POST or PUT), we need to -explicitly create a request matcher. Doing so has two effects:

  • Creating a stub that matches only in the way you specify.
  • Asserting that the request in the test case also matches the same conditions.

The main entry point for this feature is WireMockRestDocs.verify(), which can be used -as a substitute for the document() convenience method, as shown in the following -example:

import static org.springframework.cloud.contract.wiremock.restdocs.WireMockRestDocs.verify;
@RunWith(SpringRunner.class)
-@SpringBootTest
-@AutoConfigureRestDocs(outputDir = "target/snippets")
-@AutoConfigureMockMvc
-public class ApplicationTests {
-
-	@Autowired
-	private MockMvc mockMvc;
-
-	@Test
-	public void contextLoads() throws Exception {
-		mockMvc.perform(post("/resource")
-                .content("{\"id\":\"123456\",\"message\":\"Hello World\"}"))
-				.andExpect(status().isOk())
-				.andDo(verify().jsonPath("$.id")
-                        .stub("resource"));
-	}
-}

This contract specifies that any valid POST with an "id" field receives the response -defined in this test. You can chain together calls to .jsonPath() to add additional -matchers. If JSON Path is unfamiliar, The JayWay -documentation can help you get up to speed. The WebTestClient version of this test -has a similar verify() static helper that you insert in the same place.

Instead of the jsonPath and contentType convenience methods, you can also use the -WireMock APIs to verify that the request matches the created stub, as shown in the -following example:

@Test
-public void contextLoads() throws Exception {
-	mockMvc.perform(post("/resource")
-               .content("{\"id\":\"123456\",\"message\":\"Hello World\"}"))
-			.andExpect(status().isOk())
-			.andDo(verify()
-					.wiremock(WireMock.post(
-						urlPathEquals("/resource"))
-						.withRequestBody(matchingJsonPath("$.id"))
-                       .stub("post-resource"));
-}

The WireMock API is rich. You can match headers, query parameters, and request body by -regex as well as by JSON path. These features can be used to create stubs with a wider -range of parameters. The above example generates a stub resembling the following example:

post-resource.json.  -

{
-  "request" : {
-    "url" : "/resource",
-    "method" : "POST",
-    "bodyPatterns" : [ {
-      "matchesJsonPath" : "$.id"
-    }]
-  },
-  "response" : {
-    "status" : 200,
-    "body" : "Hello World",
-    "headers" : {
-      "X-Application-Context" : "application:-1",
-      "Content-Type" : "text/plain"
-    }
-  }
-}

-

[Note]Note

You can use either the wiremock() method or the jsonPath() and contentType() -methods to create request matchers, but you can’t use both approaches.

On the consumer side, you can make the resource.json generated earlier in this section -available on the classpath (by -<<publishing-stubs-as-jars], for example). After that, you can create a stub using WireMock in a -number of different ways, including by using -@AutoConfigureWireMock(stubs="classpath:resource.json"), as described earlier in this -document.

11.8 Generating Contracts by Using REST Docs

You can also generate Spring Cloud Contract DSL files and documentation with Spring REST -Docs. If you do so in combination with Spring Cloud WireMock, you get both the contracts -and the stubs.

Why would you want to use this feature? Some people in the community asked questions -about a situation in which they would like to move to DSL-based contract definition, -but they already have a lot of Spring MVC tests. Using this feature lets you generate -the contract files that you can later modify and move to folders (defined in your -configuration) so that the plugin finds them.

[Tip]Tip

You might wonder why this functionality is in the WireMock module. The functionality -is there because it makes sense to generate both the contracts and the stubs.

Consider the following test:

		this.mockMvc
-				.perform(post("/foo").accept(MediaType.APPLICATION_PDF)
-						.accept(MediaType.APPLICATION_JSON)
-						.contentType(MediaType.APPLICATION_JSON)
-						.content("{\"foo\": 23, \"bar\" : \"baz\" }"))
-				.andExpect(status().isOk()).andExpect(content().string("bar"))
-				// first WireMock
-				.andDo(WireMockRestDocs.verify().jsonPath("$[?(@.foo >= 20)]")
-						.jsonPath("$[?(@.bar in ['baz','bazz','bazzz'])]")
-						.contentType(MediaType.valueOf("application/json"))
-						.stub("shouldGrantABeerIfOldEnough"))
-				// then Contract DSL documentation
-				.andDo(document("index", SpringCloudContractRestDocs.dslContract()));

The preceding test creates the stub presented in the previous section, generating both -the contract and a documentation file.

The contract is called index.groovy and might look like the following example:

import org.springframework.cloud.contract.spec.Contract
-
-Contract.make {
-    request {
-        method 'POST'
-        url '/foo'
-        body('''
-            {"foo": 23 }
-        ''')
-        headers {
-            header('''Accept''', '''application/json''')
-            header('''Content-Type''', '''application/json''')
-        }
-    }
-    response {
-        status OK()
-        body('''
-        bar
-        ''')
-        headers {
-            header('''Content-Type''', '''application/json;charset=UTF-8''')
-            header('''Content-Length''', '''3''')
-        }
-        testMatchers {
-            jsonPath('$[?(@.foo >= 20)]', byType())
-        }
-    }
-}

The generated document (formatted in Asciidoc in this case) contains a formatted -contract. The location of this file would be index/dsl-contract.adoc.

12. Migrations

[Tip]Tip

For up to date migration guides please visit -the project’s wiki page.

This section covers migrating from one version of Spring Cloud Contract Verifier to the -next version. It covers the following versions upgrade paths:

12.1 1.0.x → 1.1.x

This section covers upgrading from version 1.0 to version 1.1.

12.1.1 New structure of generated stubs

In 1.1.x we have introduced a change to the structure of generated stubs. If you have -been using the @AutoConfigureWireMock notation to use the stubs from the classpath, -it no longer works. The following example shows how the @AutoConfigureWireMock notation -used to work:

@AutoConfigureWireMock(stubs = "classpath:/customer-stubs/mappings", port = 8084)

You must either change the location of the stubs to: -classpath:…​/META-INF/groupId/artifactId/version/mappings or use the new -classpath-based @AutoConfigureStubRunner, as shown in the following example:

@AutoConfigureWireMock(stubs = "classpath:customer-stubs/META-INF/travel.components/customer-contract/1.0.2-SNAPSHOT/mappings/", port = 8084)

If you do not want to use @AutoConfigureStubRunner and you want to remain with the old -structure, set your plugin tasks accordingly. The following example would work for the -structure presented in the previous snippet.

Maven.  -

<!-- start of pom.xml -->
-
-<properties>
-    <!-- we don't want the verifier to do a jar for us -->
-    <spring.cloud.contract.verifier.skip>true</spring.cloud.contract.verifier.skip>
-</properties>
-
-<!-- ... -->
-
-<!-- You need to set up the assembly plugin -->
-<build>
-    <plugins>
-        <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-assembly-plugin</artifactId>
-            <executions>
-                <execution>
-                    <id>stub</id>
-                    <phase>prepare-package</phase>
-                    <goals>
-                        <goal>single</goal>
-                    </goals>
-                    <inherited>false</inherited>
-                    <configuration>
-                        <attach>true</attach>
-                        <descriptor>${basedir}/src/assembly/stub.xml</descriptor>
-                    </configuration>
-                </execution>
-            </executions>
-        </plugin>
-    </plugins>
-</build>
-<!-- end of pom.xml -->
-
-<!-- start of stub.xml-->
-
-<assembly
-	xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 https://maven.apache.org/xsd/assembly-1.1.3.xsd">
-	<id>stubs</id>
-	<formats>
-		<format>jar</format>
-	</formats>
-	<includeBaseDirectory>false</includeBaseDirectory>
-	<fileSets>
-		<fileSet>
-			<directory>${project.build.directory}/snippets/stubs</directory>
-			<outputDirectory>customer-stubs/mappings</outputDirectory>
-			<includes>
-				<include>**/*</include>
-			</includes>
-		</fileSet>
-		<fileSet>
-			<directory>${basedir}/src/test/resources/contracts</directory>
-			<outputDirectory>customer-stubs/contracts</outputDirectory>
-			<includes>
-				<include>**/*.groovy</include>
-			</includes>
-		</fileSet>
-	</fileSets>
-</assembly>
-
-<!-- end of stub.xml-->

-

Gradle.  -

task copyStubs(type: Copy, dependsOn: 'generateWireMockClientStubs') {
-//    Preserve directory structure from 1.0.X of spring-cloud-contract
-    from "${project.buildDir}/resources/main/customer-stubs/META-INF/${project.group}/${project.name}/${project.version}"
-    into "${project.buildDir}/resources/main/customer-stubs"
-}

-

12.2 1.1.x → 1.2.x

This section covers upgrading from version 1.1 to version 1.2.

12.2.1 Custom HttpServerStub

HttpServerStub includes a method that was not in version 1.1. The method is -String registeredMappings() If you have classes that implement HttpServerStub, you -now have to implement the registeredMappings() method. It should return a String -representing all mappings available in a single HttpServerStub.

See issue 355 for more -detail.

12.2.2 New packages for generated tests

The flow for setting the generated tests package name will look like this:

  • Set basePackageForTests
  • If basePackageForTests was not set, pick the package from baseClassForTests
  • If baseClassForTests was not set, pick packageWithBaseClasses
  • If nothing got set, pick the default value: -org.springframework.cloud.contract.verifier.tests

See issue 260 for more -detail.

12.2.3 New Methods in TemplateProcessor

In order to add support for fromRequest.path, the following methods had to be added to the -TemplateProcessor interface:

  • path()
  • path(int index)

See issue 388 for more -detail.

12.2.4 RestAssured 3.0

Rest Assured, used in the generated test classes, got bumped to 3.0. If -you manually set versions of Spring Cloud Contract and the release train -you might see the following exception:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project some-project: Compilation failure: Compilation failure:
-[ERROR] /some/path/SomeClass.java:[4,39] package com.jayway.restassured.response does not exist

This exception will occur due to the fact that the tests got generated with -an old version of plugin and at test execution time you have an incompatible -version of the release train (and vice versa).

Done via issue 267

12.3 1.2.x → 2.0.x

\ No newline at end of file + +If you are not redirected automatically, follow the link to the documentation \ No newline at end of file