From 09a9968c50cf2d93c668e889872ba3ef84106919 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Wed, 9 May 2018 06:52:34 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- multi/multi__contract_dsl.html | 2 +- single/spring-cloud-contract.html | 2 +- spring-cloud-contract.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multi/multi__contract_dsl.html b/multi/multi__contract_dsl.html index 0d940415aa..d251535370 100644 --- a/multi/multi__contract_dsl.html +++ b/multi/multi__contract_dsl.html @@ -1816,7 +1816,7 @@ leads to generation of two tests that look more or less like this:

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 iss much better if you name your contracts because doing so makes +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.11 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.  diff --git a/single/spring-cloud-contract.html b/single/spring-cloud-contract.html index ace10e074f..2428097738 100644 --- a/single/spring-cloud-contract.html +++ b/single/spring-cloud-contract.html @@ -5216,7 +5216,7 @@ leads to generation of two tests that look more or less like this:

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 iss much better if you name your contracts because doing so makes +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.11 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.  diff --git a/spring-cloud-contract.xml b/spring-cloud-contract.xml index eaca27b349..30d1783dbb 100644 --- a/spring-cloud-contract.xml +++ b/spring-cloud-contract.xml @@ -4,7 +4,7 @@ Spring Cloud Contract -2018-05-08 +2018-05-09 @@ -8414,7 +8414,7 @@ index of the contract in the list. 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). -As you can see, it iss much better if you name your contracts because doing so makes +As you can see, it is much better if you name your contracts because doing so makes your tests far more meaningful.