Merge branch '1.0.x'

This commit is contained in:
Marcin Grzejszczak
2017-03-03 17:34:47 +01:00
2 changed files with 24 additions and 4 deletions

View File

@@ -654,6 +654,9 @@ git clone https://your-git-server.com/server-side.git local-http-server-repo
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.
[source,groovy,indent=0]
----
package contracts
@@ -926,7 +929,7 @@ You have to add the dependencies needed by the autogenerated tests
</dependency>
----
In the configuration of the Maven plugin we passed the `baseClassForTests` property
In the configuration of the Maven plugin we passed the `packageWithBaseClasses` property
[source,xml,indent=0]
----
@@ -941,7 +944,14 @@ In the configuration of the Maven plugin we passed the `baseClassForTests` prope
</plugin>
----
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 http://rest-assured.io/[Rest Assured MVC] to start the server side `FraudDetectionController`.
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 http://rest-assured.io/[Rest Assured MVC] to start the server side `FraudDetectionController`.
[source,java,indent=0]
----

View File

@@ -184,6 +184,9 @@ git clone https://your-git-server.com/server-side.git local-http-server-repo
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.
[source,groovy,indent=0]
----
include::{introduction_url}/samples/standalone/dsl/http-server/src/test/resources/contracts/fraud/shouldMarkClientAsFraud.groovy[]
@@ -346,14 +349,21 @@ You have to add the dependencies needed by the autogenerated tests
include::{introduction_url}/samples/standalone/dsl/http-server/pom.xml[tags=verifier_test_dependencies,indent=0]
----
In the configuration of the Maven plugin we passed the `baseClassForTests` property
In the configuration of the Maven plugin we passed the `packageWithBaseClasses` property
[source,xml,indent=0]
----
include::{introduction_url}/samples/standalone/dsl/http-server/pom.xml[tags=contract_maven_plugin,indent=0]
----
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 http://rest-assured.io/[Rest Assured MVC] to start the server side `FraudDetectionController`.
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 http://rest-assured.io/[Rest Assured MVC] to start the server side `FraudDetectionController`.
[source,java,indent=0]
----