Merge remote-tracking branch 'upstream/master' into gh-304-add-discovery-clients-order-support
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -21,6 +21,7 @@ bin/
|
||||
# Package Files #
|
||||
*.war
|
||||
*.ear
|
||||
*.versionsBackup
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
@@ -32,6 +33,7 @@ hs_err_pid*
|
||||
.gradle/
|
||||
target/
|
||||
build/
|
||||
out/
|
||||
|
||||
hs_err_pid*
|
||||
.DS_Store
|
||||
|
||||
32
README.adoc
32
README.adoc
@@ -39,7 +39,7 @@ 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 or Spock) are used to verify if server-side implementation
|
||||
* 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.
|
||||
|
||||
@@ -234,7 +234,6 @@ run the collaborators' stubs for you, as shown in the following example:
|
||||
@SpringBootTest(webEnvironment=WebEnvironment.NONE)
|
||||
@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
|
||||
stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
@DirtiesContext
|
||||
public class LoanApplicationServiceTests {
|
||||
----
|
||||
|
||||
@@ -401,8 +400,8 @@ mode for HTTP contracts. However, JAX-RX client and explicit HTTP invocations ca
|
||||
used. (To do so, change the `testMode` property of the plugin to `JAX-RS` or `EXPLICIT`,
|
||||
respectively.)
|
||||
|
||||
Apart from the default JUnit, you can instead use Spock tests, by setting the plugin
|
||||
`testFramework` property to `Spock`.
|
||||
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: 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.
|
||||
@@ -519,7 +518,6 @@ the collaborators' stubs for you, as shown in the following example:
|
||||
@SpringBootTest(webEnvironment=WebEnvironment.NONE)
|
||||
@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
|
||||
stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
@DirtiesContext
|
||||
public class LoanApplicationServiceTests {
|
||||
----
|
||||
|
||||
@@ -693,7 +691,6 @@ Annotate your test class with `@AutoConfigureStubRunner`. In the annotation prov
|
||||
@SpringBootTest(webEnvironment=WebEnvironment.NONE)
|
||||
@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
|
||||
stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
@DirtiesContext
|
||||
public class LoanApplicationServiceTests {
|
||||
----
|
||||
|
||||
@@ -1035,8 +1032,7 @@ of an identifier or a timestamp, you need not hardcode a value. You want to allo
|
||||
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.
|
||||
https://cloud.spring.io/spring-cloud-contract/single/spring-cloud-contract.html#_contract_dsl[Consult the docs
|
||||
for more information.] We highly recommend using the map notation!
|
||||
Consult the <<contract-dsl>> section for more information. We highly recommend using the map notation!
|
||||
|
||||
TIP: You must understand the map notation in order to set up contracts. Please read the
|
||||
http://groovy-lang.org/json.html[Groovy docs regarding JSON].
|
||||
@@ -1069,7 +1065,7 @@ First, add the `Spring Cloud Contract` BOM.
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud-dependencies.version}</version>
|
||||
<version>${spring-cloud-release.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
@@ -1150,7 +1146,7 @@ Add the `Spring Cloud Contract` BOM:
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud-dependencies.version}</version>
|
||||
<version>${spring-cloud-release-train.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
@@ -1180,7 +1176,6 @@ can also provide the offline work switch (`StubRunnerProperties.StubsMode.LOCAL`
|
||||
@SpringBootTest(webEnvironment=WebEnvironment.NONE)
|
||||
@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
|
||||
stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
@DirtiesContext
|
||||
public class LoanApplicationServiceTests {
|
||||
----
|
||||
|
||||
@@ -1447,23 +1442,13 @@ https://github.com/spring-cloud-samples/spring-cloud-contract-samples[samples].
|
||||
|
||||
== Links
|
||||
|
||||
The following links may be helpful when working with Spring Cloud Contract Verifier:
|
||||
The following links may be helpful when working with Spring Cloud Contract:
|
||||
|
||||
* https://github.com/spring-cloud/spring-cloud-contract/[Spring Cloud Contract Github
|
||||
Repository]
|
||||
* https://github.com/spring-cloud-samples/spring-cloud-contract-samples/[Spring Cloud
|
||||
Contract Samples]
|
||||
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html[Spring Cloud
|
||||
Contract Documentation]
|
||||
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html/deprecated[Accurest
|
||||
Legacy Documentation]
|
||||
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html/#spring-cloud-contract-stub-runner[Spring
|
||||
Cloud Contract Stub Runner Documentation]
|
||||
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html/#stub-runner-for-messaging[Spring
|
||||
Cloud Contract Stub Runner Messaging Documentation]
|
||||
* https://gitter.im/spring-cloud/spring-cloud-contract[Spring Cloud Contract Gitter]
|
||||
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract-maven-plugin/[Spring
|
||||
Cloud Contract Maven Plugin]
|
||||
* https://www.youtube.com/watch?v=sAAklvxmPmk[Spring Cloud Contract WJUG Presentation by
|
||||
Marcin Grzejszczak]
|
||||
|
||||
@@ -1857,8 +1842,7 @@ 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
|
||||
https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html#_publishing_stubs_as_jars[publishing
|
||||
stubs as JARs], for example). After that, you can create a stub using WireMock in a
|
||||
<<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.
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-contract-docker-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<name>Spring Cloud Contract Docker Parent</name>
|
||||
<description>Spring Cloud Contract Docker Parent</description>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
WRAPPER_VERSION="4.4.1"
|
||||
WRAPPER_VERSION="4.10"
|
||||
GRADLE_BIN_DIR="gradle-${WRAPPER_VERSION}-bin"
|
||||
GRADLE_WRAPPER_DIR="${HOME}/.gradle/wrapper/dists/${GRADLE_BIN_DIR}"
|
||||
CURRENT_DIR="$( pwd )"
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-docker-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-contract-docker</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<name>Spring Cloud Contract Docker</name>
|
||||
<description>Spring Cloud Contract Docker</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
<artifactId>groovy</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -10,7 +10,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "io.spring.gradle:dependency-management-plugin:1.0.4.RELEASE"
|
||||
classpath "io.spring.gradle:dependency-management-plugin:1.0.6.RELEASE"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${verifierVersion}"
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ contracts {
|
||||
}
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = '4.4.1'
|
||||
gradleVersion = '4.9'
|
||||
}
|
||||
|
||||
task cleanOutput(type: Delete) {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
verifierVersion=2.1.0.BUILD-SNAPSHOT
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-docker-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-contract-stub-runner-docker</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<name>Spring Cloud Contract Stub Runner Docker</name>
|
||||
<description>Spring Cloud Contract Stub Runner Docker</description>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>spring-cloud-contract-docs</artifactId>
|
||||
|
||||
@@ -1,21 +1,11 @@
|
||||
== Links
|
||||
|
||||
The following links may be helpful when working with Spring Cloud Contract Verifier:
|
||||
The following links may be helpful when working with Spring Cloud Contract:
|
||||
|
||||
* https://github.com/spring-cloud/spring-cloud-contract/[Spring Cloud Contract Github
|
||||
Repository]
|
||||
* https://github.com/spring-cloud-samples/spring-cloud-contract-samples/[Spring Cloud
|
||||
Contract Samples]
|
||||
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html[Spring Cloud
|
||||
Contract Documentation]
|
||||
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html/deprecated[Accurest
|
||||
Legacy Documentation]
|
||||
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html/#spring-cloud-contract-stub-runner[Spring
|
||||
Cloud Contract Stub Runner Documentation]
|
||||
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html/#stub-runner-for-messaging[Spring
|
||||
Cloud Contract Stub Runner Messaging Documentation]
|
||||
* https://gitter.im/spring-cloud/spring-cloud-contract[Spring Cloud Contract Gitter]
|
||||
* https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract-maven-plugin/[Spring
|
||||
Cloud Contract Maven Plugin]
|
||||
* https://www.youtube.com/watch?v=sAAklvxmPmk[Spring Cloud Contract WJUG Presentation by
|
||||
Marcin Grzejszczak]
|
||||
|
||||
@@ -324,8 +324,7 @@ 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
|
||||
https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html#_publishing_stubs_as_jars[publishing
|
||||
stubs as JARs], for example). After that, you can create a stub using WireMock in a
|
||||
<<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.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
[[contract-dsl]]
|
||||
== Contract DSL
|
||||
|
||||
Spring Cloud Contract supports out of the box 2 types of DSL. One written in
|
||||
@@ -1103,6 +1104,47 @@ 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`).
|
||||
|
||||
=== Working with Web Flux
|
||||
|
||||
Spring Cloud Contract requires the usage of `EXPLICIT` mode in your generated tests
|
||||
to work with Web Flux.
|
||||
|
||||
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
|
||||
.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>
|
||||
----
|
||||
|
||||
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
|
||||
.Gradle
|
||||
----
|
||||
contracts {
|
||||
testMode = 'EXPLICIT'
|
||||
}
|
||||
----
|
||||
|
||||
The following example shows how to set up a base class and Rest Assured for Web Flux:
|
||||
|
||||
[source,groovy,indent=0]
|
||||
----
|
||||
include::{samples_url}/producer_webflux/src/test/java/com/example/BeerRestBase.java[tags=annotations,indent=0]
|
||||
|
||||
// your tests go here
|
||||
|
||||
// in this config class you define all controllers and mocked services
|
||||
include::{samples_url}/producer_webflux/src/test/java/com/example/BeerRestBase.java[tags=config,indent=0]
|
||||
|
||||
}
|
||||
----
|
||||
|
||||
=== Messaging Top-Level Elements
|
||||
|
||||
The DSL for messaging looks a little bit different than the one that focuses on HTTP. The
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
:introduction_url: https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/{branch}
|
||||
:samples_branch: 2.0.x
|
||||
:samples_branch: 2.1.x
|
||||
|
||||
== Spring Cloud Contract FAQ
|
||||
|
||||
@@ -127,7 +127,7 @@ $(stub(...), test(...))
|
||||
$(client(...), server(...))
|
||||
----
|
||||
|
||||
You can read more about this in the https://cloud.spring.io/spring-cloud-contract/single/spring-cloud-contract.html#_contract_dsl[Contract DSL section].
|
||||
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).
|
||||
@@ -344,84 +344,10 @@ contracts in the folder per topic.
|
||||
|
||||
===== For Maven Project
|
||||
|
||||
To make it possible to work on the producer side we could do the following things (all via Maven plugins):
|
||||
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```.
|
||||
|
||||
- Add common repo dependency to your classpath:
|
||||
|
||||
[source,xml,indent=0]
|
||||
----
|
||||
<dependency>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>common-repo</artifactId>
|
||||
<version>${common-repo.version}</version>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
- Download the JAR with the contracts and unpack the JAR to target:
|
||||
|
||||
[source,xml,indent=0]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-dependencies</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>unpack</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>common-repo</artifactId>
|
||||
<type>jar</type>
|
||||
<overWrite>false</overWrite>
|
||||
<outputDirectory>${project.build.directory}/contracts</outputDirectory>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
----
|
||||
|
||||
- Rip out all the folders we're not interested in:
|
||||
|
||||
[source,xml,indent=0]
|
||||
----
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<delete includeemptydirs="true">
|
||||
<fileset dir="${project.build.directory}/contracts">
|
||||
<include name="**/*" />
|
||||
<!--Producer artifactId-->
|
||||
<exclude name="**/${project.artifactId}/**" />
|
||||
<!--List of the supported topics-->
|
||||
<exclude name="**/${first-topic}/**" />
|
||||
<exclude name="**/${second-topic}/**" />
|
||||
</fileset>
|
||||
</delete>
|
||||
</tasks>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
----
|
||||
|
||||
- Run the contract plugin by pointing to the contracts to the folder under target:
|
||||
|
||||
[source,xml,indent=0]
|
||||
----
|
||||
@@ -429,16 +355,30 @@ To make it possible to work on the producer side we could do the following thing
|
||||
<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>
|
||||
<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>.*intoxication.*</contractPackageRegex>
|
||||
<baseClassFQN>com.example.intoxication.BeerIntoxicationBase</baseClassFQN>
|
||||
<contractPackageRegex>.*messaging.*</contractPackageRegex>
|
||||
<baseClassFQN>com.example.services.MessagingBase</baseClassFQN>
|
||||
</baseClassMapping>
|
||||
<baseClassMapping>
|
||||
<contractPackageRegex>.*rest.*</contractPackageRegex>
|
||||
<baseClassFQN>com.example.services.TestBase</baseClassFQN>
|
||||
</baseClassMapping>
|
||||
</baseClassMappings>
|
||||
<contractsDirectory>${project.build.directory}/contracts</contractsDirectory>
|
||||
<includedFiles>
|
||||
<includedFile>**/${project.artifactId}/**</includedFile>
|
||||
<includedFile>**/${first-topic}/**</includedFile>
|
||||
<includedFile>**/${second-topic}/**</includedFile>
|
||||
</includedFiles>
|
||||
</configuration>
|
||||
</plugin>
|
||||
----
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
== Spring Cloud Contract Verifier Introduction
|
||||
|
||||
TIP: The Accurest project was initially started by Marcin Grzejszczak and Jakub Kubrynski
|
||||
(http://codearte.io[codearte.io])
|
||||
|
||||
Spring Cloud Contract Verifier enables Consumer Driven Contract (CDC) development of
|
||||
JVM-based applications. It moves TDD to the level of software architecture.
|
||||
|
||||
@@ -15,10 +12,18 @@ 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 or Spock) are used to verify if server-side implementation
|
||||
* 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.
|
||||
|
||||
=== History
|
||||
|
||||
Before becoming Spring Cloud Contract, this project was called https://github.com/Codearte/accurest[Accurest].
|
||||
It was created by https://twitter.com/mgrzejszczak[Marcin Grzejszczak] and https://twitter.com/jkubrynski[Jakub Kubrynski]
|
||||
from (http://codearte.io[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.
|
||||
|
||||
=== Why a Contract Verifier?
|
||||
|
||||
Assume that we have a system consisting of multiple microservices:
|
||||
@@ -200,7 +205,6 @@ run the collaborators' stubs for you, as shown in the following example:
|
||||
@SpringBootTest(webEnvironment=WebEnvironment.NONE)
|
||||
@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
|
||||
stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
@DirtiesContext
|
||||
public class LoanApplicationServiceTests {
|
||||
----
|
||||
|
||||
@@ -363,8 +367,8 @@ mode for HTTP contracts. However, JAX-RX client and explicit HTTP invocations ca
|
||||
used. (To do so, change the `testMode` property of the plugin to `JAX-RS` or `EXPLICIT`,
|
||||
respectively.)
|
||||
|
||||
Apart from the default JUnit, you can instead use Spock tests, by setting the plugin
|
||||
`testFramework` property to `Spock`.
|
||||
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: 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.
|
||||
@@ -475,7 +479,6 @@ the collaborators' stubs for you, as shown in the following example:
|
||||
@SpringBootTest(webEnvironment=WebEnvironment.NONE)
|
||||
@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
|
||||
stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
@DirtiesContext
|
||||
public class LoanApplicationServiceTests {
|
||||
----
|
||||
|
||||
@@ -698,8 +701,7 @@ of an identifier or a timestamp, you need not hardcode a value. You want to allo
|
||||
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.
|
||||
https://cloud.spring.io/spring-cloud-contract/single/spring-cloud-contract.html#_contract_dsl[Consult the docs
|
||||
for more information.] We highly recommend using the map notation!
|
||||
Consult the <<contract-dsl>> section for more information. We highly recommend using the map notation!
|
||||
|
||||
TIP: You must understand the map notation in order to set up contracts. Please read the
|
||||
http://groovy-lang.org/json.html[Groovy docs regarding JSON].
|
||||
|
||||
@@ -69,8 +69,8 @@ messaging configuration, so you only need the one annotation.
|
||||
=== 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 tests are created. However, there is also a
|
||||
possibility to create Spock 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:
|
||||
|
||||
@@ -87,7 +87,7 @@ it is resolved as a channel name. For *Camel*, that's a certain component (for e
|
||||
|
||||
==== Scenario 1: No Input Message
|
||||
|
||||
Here is an example for Camel. For the given contract:
|
||||
For the given contract:
|
||||
|
||||
.Groovy DSL
|
||||
[source,groovy]
|
||||
@@ -117,7 +117,7 @@ include::{verifier_core_path}/src/test/groovy/org/springframework/cloud/contract
|
||||
|
||||
==== Scenario 2: Output Triggered by Input
|
||||
|
||||
Here is an example for Camel. For the given contract:
|
||||
For the given contract:
|
||||
|
||||
.Groovy DSL
|
||||
[source,groovy]
|
||||
@@ -147,7 +147,7 @@ include::{verifier_core_path}/src/test/groovy/org/springframework/cloud/contract
|
||||
|
||||
==== Scenario 3: No Output Message
|
||||
|
||||
Here is an example for Camel. For the given contract:
|
||||
For the given contract:
|
||||
|
||||
.Groovy DSL
|
||||
[source,groovy]
|
||||
@@ -180,9 +180,7 @@ include::{verifier_core_path}/src/test/groovy/org/springframework/cloud/contract
|
||||
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
|
||||
https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html/#stub-runner-for-messaging[the
|
||||
Stub Runner Messaging sections].
|
||||
For more information, see <<stub-runner-for-messaging>> section.
|
||||
|
||||
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
|
||||
.Maven
|
||||
|
||||
@@ -245,13 +245,14 @@ from the Groovy DSL should be placed. By default its value is
|
||||
`$buildDir/generated-test-sources/contractVerifier`.
|
||||
* *stubsOutputDir*: Specifies the directory where the generated WireMock stubs from
|
||||
the Groovy DSL should be placed.
|
||||
* *targetFramework*: Specifies the target test framework to be used. Currently, Spock and
|
||||
JUnit are supported with JUnit being the default framework.
|
||||
* *targetFramework*: 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.
|
||||
@@ -260,8 +261,6 @@ closure to set it up.
|
||||
separated. Otherwise, it scans contracts under the provided directory.
|
||||
* *contractsMode*: Specifies the mode of downloading contracts (whether the
|
||||
JAR is available offline, remotely etc.)
|
||||
* *contractsSnapshotCheckSkip*: If set to `true` will not assert whether the
|
||||
downloaded stubs / contract JAR was downloaded from a remote location or a local one(only applicable to Maven repos, not Git or Pact).
|
||||
* *deleteStubsAfterTest*: If set to `false` will not remove any downloaded
|
||||
contracts from temporary directories
|
||||
|
||||
@@ -438,8 +437,8 @@ include::{standalone_samples_path}/http-server/pom.xml[tags=contract_maven_plugi
|
||||
----
|
||||
|
||||
You can read more in the
|
||||
https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract-maven-plugin/[Spring
|
||||
Cloud Contract Maven Plugin Documentation].
|
||||
https://cloud.spring.io/spring-cloud-static/spring-cloud-contract/2.0.0.RELEASE/spring-cloud-contract-maven-plugin/[Spring
|
||||
Cloud Contract Maven Plugin Documentation (example for `2.0.0.RELEASE` version)].
|
||||
|
||||
[[maven-rest-assured]]
|
||||
==== Maven and Rest Assured 2.0
|
||||
@@ -582,8 +581,8 @@ classes.
|
||||
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`.
|
||||
* *testFramework*: Specifies the target test framework to be used. Currently, Spock and
|
||||
JUnit are supported with JUnit being the default framework
|
||||
* *testFramework*: Specifies the target test framework to be used. Currently, Spock, JUnit 4 (`TestFramework.JUNIT` and
|
||||
6JUnit 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
|
||||
@@ -609,8 +608,6 @@ the following options:
|
||||
* *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
|
||||
* *contractsSnapshotCheckSkip*: If `true` then will not assert whether a stub / contract
|
||||
JAR was downloaded from local or remote location
|
||||
* *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,
|
||||
@@ -944,27 +941,6 @@ For example, you might decide to have no dependencies at all.
|
||||
As a consumer, if you add the stub dependency to your classpath, you can explicitly
|
||||
exclude the unwanted dependencies.
|
||||
|
||||
=== CI Server setup
|
||||
|
||||
When fetching stubs / contracts in a CI, shared environment, what might happen is that
|
||||
both the producer and the consumer reuse the same local Maven repository. Due to this,
|
||||
the framework, responsible for downloading a stub JAR from remote location,
|
||||
can't decide which JAR should be picked, local or remote one. That caused
|
||||
the `"The artifact was found in the local repository but you have explicitly
|
||||
stated that it should be downloaded from a remote one"` exception
|
||||
and failed the build.
|
||||
|
||||
For such cases we're introducing the property and plugin setup mechanism:
|
||||
|
||||
- via `stubrunner.snapshot-check-skip` system property
|
||||
- via `STUBRUNNER_SNAPSHOT_CHECK_SKIP` environment variable
|
||||
|
||||
if either of these values is set to `true`, then the stub downloader will not
|
||||
verify the origin of the downloaded JAR.
|
||||
|
||||
For the plugins you need to set the `contractsSnapshotSkipCheck` property
|
||||
to `true`.
|
||||
|
||||
=== Scenarios
|
||||
|
||||
You can handle scenarios with Spring Cloud Contract Verifier. All you need to do is to
|
||||
@@ -989,7 +965,7 @@ name of `scenario1` and the three following steps:
|
||||
. logout marked as `Step2` which will close the scenario.
|
||||
|
||||
More details about WireMock scenarios can be found at
|
||||
http://wiremock.org/stateful-behaviour.html[http://wiremock.org/stateful-behaviour.html]
|
||||
http://wiremock.org/docs/stateful-behaviour/[http://wiremock.org/docs/stateful-behaviour/]
|
||||
|
||||
Spring Cloud Contract Verifier also generates tests with a guaranteed order of execution.
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ include::{standalone_samples_path}/http-server/pom.xml[tags=repos,indent=0]
|
||||
include::{standalone_samples_path}/http-server/build.gradle[tags=repos,indent=0]
|
||||
----
|
||||
|
||||
[[publishing-stubs-as-jars]]
|
||||
=== Publishing Stubs as JARs
|
||||
|
||||
The easiest approach would be to centralize the way stubs are kept. For example, you can
|
||||
@@ -154,7 +155,7 @@ $ STUBRUNNER_PORT="8083"
|
||||
$ 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}" -p "${STUBRUNNER_PORT}:${STUBRUNNER_PORT}" -p "9876:9876" springcloud/spring-cloud-contract-stub-runner:"${SC_CONTRACT_DOCKER_VERSION}"
|
||||
$ 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
|
||||
@@ -174,4 +175,8 @@ $ curl -H "Content-Type:application/json" -X POST --data '{ "title" : "Title", "
|
||||
# Now time for the second request
|
||||
$ curl -X GET http://localhost:9876/api/books
|
||||
# You will receive contents of the JSON
|
||||
```
|
||||
```
|
||||
|
||||
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"`
|
||||
@@ -1,3 +1,4 @@
|
||||
[[stub-runner-for-messaging]]
|
||||
== Stub Runner for Messaging
|
||||
|
||||
Stub Runner can run the published stubs in memory. It can integrate with the following
|
||||
|
||||
143
pom.xml
143
pom.xml
@@ -7,13 +7,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-build</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-contract-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
|
||||
<name>Spring Cloud Contract</name>
|
||||
<description>Spring Cloud Contract</description>
|
||||
@@ -26,22 +26,24 @@
|
||||
<checkstyle.version>2.17</checkstyle.version>
|
||||
<pact.version>3.5.13</pact.version>
|
||||
<jsch-agent.version>0.0.9</jsch-agent.version>
|
||||
<spring-cloud-build.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-build.version>
|
||||
<spring-cloud-zookeeper.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-zookeeper.version>
|
||||
<spring-cloud-stream.version>Elmhurst.BUILD-SNAPSHOT</spring-cloud-stream.version>
|
||||
<spring-cloud-netflix.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-netflix.version>
|
||||
<spring-cloud-consul.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-consul.version>
|
||||
<spring-cloud-commons.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-commons.version>
|
||||
<spring-cloud-build.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-build.version>
|
||||
<spring-cloud-zookeeper.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-zookeeper.version>
|
||||
<spring-cloud-stream.version>Fishtown.BUILD-SNAPSHOT</spring-cloud-stream.version>
|
||||
<spring-cloud-netflix.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-netflix.version>
|
||||
<spring-cloud-consul.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-consul.version>
|
||||
<spring-cloud-commons.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-commons.version>
|
||||
<jopt-simple.version>5.0.3</jopt-simple.version>
|
||||
<cglib.version>3.2.4</cglib.version>
|
||||
<spock-spring.version>1.0-groovy-2.4</spock-spring.version>
|
||||
<spock-global-unroll.version>0.5.1</spock-global-unroll.version>
|
||||
<spring-rabbit.version>2.0.0.RELEASE</spring-rabbit.version>
|
||||
<spring-rabbit.version>2.1.0.M2</spring-rabbit.version>
|
||||
<hoverfly-junit.version>0.2.2</hoverfly-junit.version>
|
||||
<commons-text.version>1.1</commons-text.version>
|
||||
<handlebars.version>4.0.6</handlebars.version>
|
||||
<jgit.version>4.6.0.201612231935-r</jgit.version>
|
||||
<javax-inject.version>1</javax-inject.version>
|
||||
<!-- We need to have compatibility with Gradle -->
|
||||
<groovy.version>2.4.15</groovy.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
@@ -83,11 +85,31 @@
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-spring</artifactId>
|
||||
<version>${spock-spring.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.spockframework</groupId>
|
||||
<artifactId>spock-core</artifactId>
|
||||
<version>${spock-spring.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>info.solidsoft.spock</groupId>
|
||||
@@ -99,10 +121,6 @@
|
||||
<artifactId>spring-rabbit</artifactId>
|
||||
<version>${spring-rabbit.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.specto</groupId>
|
||||
<artifactId>hoverfly-junit</artifactId>
|
||||
@@ -122,6 +140,10 @@
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -133,6 +155,10 @@
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -204,6 +230,97 @@
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-ant</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-bsf</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-console</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-docgenerator</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-groovydoc</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-groovysh</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-jmx</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-json</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-jsr223</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-nio</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-servlet</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-sql</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-swing</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-templates</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-test</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-testng</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-xml</artifactId>
|
||||
<version>${groovy.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-parent</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-contract-samples</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<name>Spring Cloud Contract Samples</name>
|
||||
<description>Spring Cloud Contract Samples</description>
|
||||
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.1.0.M2</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-dependencies.version>Finchley.BUILD-SNAPSHOT</spring-cloud-dependencies.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-release.version>Greenwich.BUILD-SNAPSHOT</spring-cloud-release.version>
|
||||
<excludeBuildFolders>true</excludeBuildFolders>
|
||||
</properties>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud-dependencies.version}</version>
|
||||
<version>${spring-cloud-release.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.M2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
org.gradle.daemon=false
|
||||
BOM_VERSION=Finchley.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Greenwich.BUILD-SNAPSHOT
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#Mon Jul 31 11:13:36 CEST 2017
|
||||
#Tue Aug 28 16:41:49 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
||||
6
samples/standalone/dsl/http-client/gradlew
vendored
6
samples/standalone/dsl/http-client/gradlew
vendored
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.0.4.RELEASE</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-dependencies.version>Finchley.BUILD-SNAPSHOT</spring-cloud-dependencies.version>
|
||||
<spring-cloud-release-train.version>Greenwich.BUILD-SNAPSHOT</spring-cloud-release-train.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -59,7 +59,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud-dependencies.version}</version>
|
||||
<version>${spring-cloud-release-train.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.example.loan;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -9,7 +7,6 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
import org.springframework.cloud.contract.stubrunner.spring.AutoConfigureStubRunner;
|
||||
import org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.example.loan.model.Client;
|
||||
@@ -17,11 +14,12 @@ import com.example.loan.model.LoanApplication;
|
||||
import com.example.loan.model.LoanApplicationResult;
|
||||
import com.example.loan.model.LoanApplicationStatus;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment=WebEnvironment.NONE, properties="server.context-path=/app")
|
||||
@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
|
||||
stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
@DirtiesContext
|
||||
public class LoanApplicationServiceContextPathTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
package com.example.loan;
|
||||
|
||||
import com.example.loan.model.Client;
|
||||
import com.example.loan.model.LoanApplication;
|
||||
import com.example.loan.model.LoanApplicationResult;
|
||||
import com.example.loan.model.LoanApplicationStatus;
|
||||
import com.jayway.jsonpath.DocumentContext;
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
import io.restassured.RestAssured;
|
||||
import io.restassured.response.ResponseOptions;
|
||||
import io.restassured.specification.RequestSpecification;
|
||||
@@ -16,9 +10,15 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
import org.springframework.cloud.contract.stubrunner.spring.AutoConfigureStubRunner;
|
||||
import org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.example.loan.model.Client;
|
||||
import com.example.loan.model.LoanApplication;
|
||||
import com.example.loan.model.LoanApplicationResult;
|
||||
import com.example.loan.model.LoanApplicationStatus;
|
||||
import com.jayway.jsonpath.DocumentContext;
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
|
||||
import static com.toomuchcoding.jsonassert.JsonAssertion.assertThatJson;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -27,7 +27,6 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@SpringBootTest(webEnvironment=WebEnvironment.NONE)
|
||||
@AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:6565"},
|
||||
stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
@DirtiesContext
|
||||
public class LoanApplicationServiceTests {
|
||||
// end::autoconfigure_stubrunner[]
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
server:
|
||||
port: 6565
|
||||
logging.level.org.springframework.cloud.contract: DEBUG
|
||||
logging:
|
||||
level:
|
||||
org.springframework.cloud.contract: debug
|
||||
@@ -10,7 +10,7 @@ buildscript {
|
||||
// end::repos[]
|
||||
dependencies {
|
||||
classpath 'org.codehaus.groovy:groovy-all:2.5.0-beta-1'
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.M2"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Finchley.BUILD-SNAPSHOT
|
||||
verifierVersion=2.1.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Greenwich.BUILD-SNAPSHOT
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#Mon Jul 31 11:13:36 CEST 2017
|
||||
#Tue Aug 28 16:41:57 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
||||
6
samples/standalone/dsl/http-server/gradlew
vendored
6
samples/standalone/dsl/http-server/gradlew
vendored
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.1.0.M2</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-dependencies.version>Finchley.BUILD-SNAPSHOT</spring-cloud-dependencies.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-release.version>Greenwich.BUILD-SNAPSHOT</spring-cloud-release.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -55,7 +55,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud-dependencies.version}</version>
|
||||
<version>${spring-cloud-release.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
@@ -105,7 +105,7 @@
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!--This plugin's configuration is used to store Eclipse m2e settings
|
||||
<!--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>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-samples-standalone</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<description>Spring Cloud Contract Standalone Test Samples used for end to end tests</description>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-samples-standalone</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<description>Spring Cloud Contract Standalone Test Samples used for end to end tests</description>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.M2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Finchley.BUILD-SNAPSHOT
|
||||
verifierVersion=2.1.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Greenwich.BUILD-SNAPSHOT
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#Mon Jul 31 11:13:36 CEST 2017
|
||||
#Tue Aug 28 16:42:27 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.1.0.M2</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
</properties>
|
||||
|
||||
<!-- tag::jars[] -->
|
||||
@@ -48,7 +48,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Finchley.BUILD-SNAPSHOT</version>
|
||||
<version>Greenwich.BUILD-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -7,10 +7,11 @@ buildscript {
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.M2"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
classpath "com.jayway.restassured:rest-assured:2.9.0"
|
||||
classpath "com.jayway.restassured:spring-mock-mvc:2.9.0"
|
||||
// Example of using Rest Assured 3.x. If you don't add this section Rest Assured 2.9.0 will be used
|
||||
// classpath "com.jayway.restassured:rest-assured:2.9.0"
|
||||
// classpath "com.jayway.restassured:spring-mock-mvc:2.9.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +56,9 @@ dependencies {
|
||||
|
||||
testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
|
||||
testCompile "org.springframework.cloud:spring-cloud-stream-test-support"
|
||||
testCompile "com.jayway.restassured:rest-assured:2.9.0"
|
||||
testCompile "com.jayway.restassured:spring-mock-mvc:2.9.0"
|
||||
// Example of using Rest Assured 3.x. If you don't add this section Rest Assured 2.9.0 will be used
|
||||
// testCompile "com.jayway.restassured:rest-assured:2.9.0"
|
||||
// testCompile "com.jayway.restassured:spring-mock-mvc:2.9.0"
|
||||
}
|
||||
|
||||
task stubsJar(type: Jar, dependsOn: "generateClientStubs") {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Finchley.BUILD-SNAPSHOT
|
||||
verifierVersion=2.1.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Greenwich.BUILD-SNAPSHOT
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#Mon Jul 31 11:13:36 CEST 2017
|
||||
#Tue Aug 28 16:42:35 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
||||
@@ -14,17 +14,21 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.1.0.M2</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
|
||||
@@ -41,23 +45,12 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-verifier</artifactId>
|
||||
<version>${spring-cloud-contract.version}</version>
|
||||
<artifactId>spring-cloud-starter-contract-verifier</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>spring-mock-mvc</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Example of overriding Rest Assured version -->
|
||||
<dependency>
|
||||
<!--<dependency>
|
||||
<groupId>com.jayway.restassured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
<version>2.9.0</version>
|
||||
@@ -68,7 +61,7 @@
|
||||
<artifactId>spring-mock-mvc</artifactId>
|
||||
<version>2.9.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
@@ -76,7 +69,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Finchley.BUILD-SNAPSHOT</version>
|
||||
<version>Greenwich.BUILD-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
@@ -104,7 +97,7 @@
|
||||
</configuration>
|
||||
|
||||
<!-- Example of using Rest Assured 3.x. If you don't add this section Rest Assured 2.9.0 will be used -->
|
||||
<dependencies>
|
||||
<!--<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.jayway.restassured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
@@ -117,7 +110,7 @@
|
||||
<version>2.9.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencies>-->
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.example.source;
|
||||
|
||||
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc;
|
||||
import io.restassured.module.mockmvc.RestAssuredMockMvc;
|
||||
import org.junit.Before;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.M2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
org.gradle.daemon=false
|
||||
BOM_VERSION=Finchley.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Greenwich.BUILD-SNAPSHOT
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#Mon Jul 31 11:13:36 CEST 2017
|
||||
#Tue Aug 28 16:42:45 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.0.4.RELEASE</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-dependencies.version>Finchley.BUILD-SNAPSHOT</spring-cloud-dependencies.version>
|
||||
<spring-cloud-release-train.version>Greenwich.BUILD-SNAPSHOT</spring-cloud-release-train.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -57,7 +57,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud-dependencies.version}</version>
|
||||
<version>${spring-cloud-release-train.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -11,7 +11,6 @@ import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
import org.springframework.cloud.contract.stubrunner.spring.AutoConfigureStubRunner;
|
||||
import org.springframework.cloud.contract.stubrunner.spring.StubRunnerProperties;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.example.loan.model.Client;
|
||||
@@ -23,7 +22,6 @@ import com.example.loan.model.LoanApplicationStatus;
|
||||
@SpringBootTest(webEnvironment=WebEnvironment.NONE)
|
||||
@AutoConfigureStubRunner(ids = {"com.example:pact-http-server:+:stubs"},
|
||||
stubsMode = StubRunnerProperties.StubsMode.LOCAL)
|
||||
@DirtiesContext
|
||||
public class LoanApplicationServiceTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.M2"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
//tag::pact_dependency[]
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-pact:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Finchley.BUILD-SNAPSHOT
|
||||
verifierVersion=2.1.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Greenwich.BUILD-SNAPSHOT
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#Mon Jul 31 11:13:36 CEST 2017
|
||||
#Tue Aug 28 16:42:54 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.1.0.M2</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-dependencies.version>Finchley.BUILD-SNAPSHOT</spring-cloud-dependencies.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-release.version>Greenwich.BUILD-SNAPSHOT</spring-cloud-release.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -52,7 +52,7 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>${spring-cloud-dependencies.version}</version>
|
||||
<version>${spring-cloud-release.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
@@ -108,7 +108,7 @@
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<!--This plugin's configuration is used to store Eclipse m2e settings
|
||||
<!--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>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-samples-standalone</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<description>Spring Cloud Contract Standalone Test Samples used for end to end tests with Pact</description>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-samples</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-contract-samples-standalone</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<name>Spring Cloud Contract Standalone Test Samples</name>
|
||||
<description>Spring Cloud Contract Standalone Test Samples used for end to end tests</description>
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.M2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Finchley.BUILD-SNAPSHOT
|
||||
verifierVersion=2.1.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Greenwich.BUILD-SNAPSHOT
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#Mon Jul 31 11:13:36 CEST 2017
|
||||
#Tue Aug 28 16:43:04 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.1.0.M2</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.example.loan;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties("service")
|
||||
public class ServiceProperties {
|
||||
|
||||
private int port = 8080;
|
||||
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return this.port;
|
||||
}
|
||||
}
|
||||
@@ -29,10 +29,10 @@ public class LoanApplicationServiceTests {
|
||||
@Autowired
|
||||
private LoanApplicationService service;
|
||||
|
||||
@Value("classpath:META-INF/com.example/http-server-restdocs/0.0.1-SNAPSHOT/mappings/markClientAsFraud.json")
|
||||
@Value("classpath:META-INF/com.example/http-server-restdocs/0.0.1-SNAPSHOT/mappings/standalone/shouldMarkClientAsFraud.json")
|
||||
private Resource markClientAsFraud;
|
||||
|
||||
@Value("classpath:META-INF/com.example/http-server-restdocs/0.0.1-SNAPSHOT/mappings/markClientAsNotFraud.json")
|
||||
@Value("classpath:META-INF/com.example/http-server-restdocs/0.0.1-SNAPSHOT/mappings/webapp/shouldMarkClientAsNotFraud.json")
|
||||
private Resource markClientAsNotFraud;
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -10,7 +10,7 @@ buildscript {
|
||||
maven { url "http://repo.spring.io/plugins-staging-local/" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.M2"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${project.findProperty('verifierVersion') ?: verifierVersion}"
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ contracts {
|
||||
generateClientStubs.enabled = false
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = '4.0.2'
|
||||
gradleVersion = '4.10'
|
||||
}
|
||||
|
||||
task stubsJar(type: Jar, dependsOn: ['copySnippets', 'copySources', 'copyClasses']) {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Finchley.BUILD-SNAPSHOT
|
||||
verifierVersion=2.1.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Greenwich.BUILD-SNAPSHOT
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#Mon Jul 31 11:13:36 CEST 2017
|
||||
#Tue Aug 28 16:43:13 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.1.0.M2</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring.cloud.contract.verifier.skip>true</spring.cloud.contract.verifier.skip>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring.cloud.contract.verifier.jar.skip>true</spring.cloud.contract.verifier.jar.skip>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -1 +1 @@
|
||||
rootProject.name = 'http-server-restdocs-gradle'
|
||||
rootProject.name = 'http-server-restdocs'
|
||||
|
||||
@@ -29,5 +29,12 @@
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}/stubs</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -12,7 +12,6 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.json.JacksonTester;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
@@ -25,10 +24,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Application.class)
|
||||
@AutoConfigureRestDocs(outputDir = "target/snippets")
|
||||
@AutoConfigureRestDocs
|
||||
@AutoConfigureMockMvc
|
||||
@AutoConfigureJsonTesters
|
||||
@DirtiesContext
|
||||
public class StubGeneratorTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.json.JacksonTester;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
@@ -31,7 +30,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
@SpringBootTest(classes = Application.class)
|
||||
@AutoConfigureRestDocs(outputDir = "target/snippets")
|
||||
@AutoConfigureMockMvc
|
||||
@DirtiesContext
|
||||
public class XmlStubGeneratorTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-samples-standalone</artifactId>
|
||||
<version>2.0.0.BUILD-SNAPSHOT</version>
|
||||
<version>2.1.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<description>Spring Cloud Contract Standalone Test Samples used for end to end tests</description>
|
||||
|
||||
<properties>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -7,7 +7,7 @@ buildscript {
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.M2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Finchley.BUILD-SNAPSHOT
|
||||
verifierVersion=2.1.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Greenwich.BUILD-SNAPSHOT
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#Mon Jul 31 11:13:36 CEST 2017
|
||||
#Tue Aug 28 16:43:22 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.1.0.M2</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -10,7 +10,7 @@ buildscript {
|
||||
maven { url "http://repo.spring.io/plugins-staging-local/" }
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.0.1.RELEASE"
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.1.0.M2"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
org.gradle.daemon=false
|
||||
verifierVersion=2.0.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Finchley.BUILD-SNAPSHOT
|
||||
verifierVersion=2.1.0.BUILD-SNAPSHOT
|
||||
BOM_VERSION=Greenwich.BUILD-SNAPSHOT
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
#Mon Jul 31 11:13:36 CEST 2017
|
||||
#Tue Aug 28 16:43:29 CEST 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
|
||||
|
||||
@@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
@@ -155,7 +155,7 @@ if $cygwin ; then
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save ( ) {
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<version>2.1.0.M2</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud-contract.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
<spring-cloud-contract.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWeb
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.json.JacksonTester;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
||||
import org.springframework.web.reactive.function.BodyInserters;
|
||||
@@ -28,7 +27,6 @@ import static org.springframework.cloud.contract.wiremock.restdocs.WireMockWebTe
|
||||
@AutoConfigureRestDocs(outputDir = "target/snippets")
|
||||
@AutoConfigureWebTestClient
|
||||
@AutoConfigureJsonTesters
|
||||
@DirtiesContext
|
||||
public class StubGeneratorTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user