From cbfc5d1a6b185e1a4d61ed04c84106952d25f0ce Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 3 Mar 2017 16:56:26 +0000 Subject: [PATCH] Sync docs from 1.0.x to gh-pages --- 1.0.x/spring-cloud-contract.html | 34 ++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/1.0.x/spring-cloud-contract.html b/1.0.x/spring-cloud-contract.html index b9787d84bc..692914e527 100644 --- a/1.0.x/spring-cloud-contract.html +++ b/1.0.x/spring-cloud-contract.html @@ -1704,6 +1704,19 @@ public void shouldBeRejectedDueToAbnormalLoanAmount() {

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
+
+We’re placing the contract under src/test/resources/contract/fraud folder. The fraud folder +is important cause we’ll reference that folder in the producer’s test base class name. +
+
package contracts
@@ -2048,7 +2061,7 @@ git pull https://your-git-server.com/server-side-fork.git contract-change-pr
 
-

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

+

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

@@ -2063,8 +2076,25 @@ git pull https://your-git-server.com/server-side-fork.git contract-change-pr
+
+ + + + + +
+
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/contract/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.

+

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.