Commit Graph

445 Commits

Author SHA1 Message Date
Marcin Grzejszczak
ea2d6b6580 Merge branch '2.1.x' 2019-08-23 16:41:33 +02:00
Olga Maciaszek-Sharma
8826cc1252 Deprecate TestFrameworkDefinition.
Signed-off-by: Olga Maciaszek-Sharma <olga.maciaszek@gmail.com>
2019-08-23 12:28:47 +02:00
Olga Maciaszek-Sharma
bb57287eb9 Merge branch '2.1.x'
# Conflicts:
#	spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/config/framework/TestNGDefinition.groovy
#	spring-cloud-contract-verifier/src/test/groovy/org/springframework/cloud/contract/verifier/builder/SingleTestGeneratorSpec.groovy
2019-08-23 12:20:00 +02:00
Olga Maciaszek-Sharma
60809445ff Add test scenarios to JUnit5. Fixes gh-887. (#1177) 2019-08-20 16:09:16 +02:00
Olga Maciaszek-Sharma
abe12c7727 Merge branch '2.1.x' 2019-08-19 13:09:34 +02:00
Olga Maciaszek-Sharma
be00f6cee2 Recognise arrays by regex and not only [*] literal. (#1172)
* Recognise arrays by regex and not only `[*]` literal.
Fixes gh-1091.

* Add test.

* Fix getting index of last matched groups.
2019-08-19 13:07:58 +02:00
Marcin Grzejszczak
3c4772bb6f Fixed the Jotlin sample with the Gradle API 2019-08-14 12:19:53 +02:00
Marcin Grzejszczak
ebc524c87d Merge branch 'master' into feature/kotlin-contract-support 2019-08-14 10:49:35 +02:00
anatoliy-balakirev
ad9eefd0f5 Add incremental build support to gradle plugin (#1165)
In order to make it working - I had to define clear input and output
params for each gradle task.
As part of this task I've also cleaned up some services to define clear
inputs instead of generic `ContractVerifierConfigProperties`.

Fixes gh-1133
2019-08-14 10:48:15 +02:00
Tim Ysewyn
301e8be951 Merge branch 'master' into feature/kotlin-contract-support 2019-08-13 15:45:51 +02:00
anatoliy-balakirev
ca72481d10 fix NPEs (#1170) 2019-08-13 15:28:02 +02:00
Marcin Grzejszczak
f1731e018e Removed jacoco from the build on circle 2019-08-13 15:11:12 +02:00
Tim Ysewyn
9f2a96d8d6 Merge branch 'master' into feature/kotlin-contract-support 2019-08-13 14:35:05 +02:00
Marcin Grzejszczak
f4fef09eb6 Throw an exception when Java can't be parsed 2019-08-13 12:19:24 +02:00
Tim Ysewyn
5ae10f246c Merge branch 'master' into feature/kotlin-contract-support 2019-08-13 10:03:57 +02:00
Marcin Grzejszczak
cd946fe01c Fixed the build 2019-08-12 16:02:36 +02:00
Marcin Grzejszczak
b85b5edb99 Ignored the file dsl based tests 2019-08-12 14:27:12 +02:00
Marcin Grzejszczak
706044bfe5 Added support for writing contracts in Java
fixes gh-1161
2019-08-12 13:40:58 +02:00
Tim Ysewyn
962e626de4 Merge branch 'master' into feature/kotlin-contract-support 2019-08-10 14:05:18 +02:00
Marcin Grzejszczak
909930a6f4 Added failOnInProgress
with this change your plugin can fail the build if you have any in progress contracts

fixes gh-1156
2019-08-08 14:15:24 +02:00
Tim Ysewyn
05f9486852 Merge branch 'master' into feature/kotlin-contract-support 2019-08-07 23:29:55 +02:00
Marcin Grzejszczak
2be3d0ab86 Added the option "inProgress" to the contract
without this change we can't have a contract that will generate a stub but not a test. Of course that's for a reason since it's overriding the very essence of contract test.
with this change we assume that the users know what they're doing and that they will use this flag rarerly. Cause it means that you can have a false positive.

related to gh-881
2019-08-06 15:39:32 +02:00
Tim Ysewyn
551d4dde59 Made helper functions static 2019-08-05 20:48:37 +02:00
Marcin Grzejszczak
5e84a38377 Revert " Added support for incremental Gradle builds"
This reverts commit 31972419
2019-08-01 14:01:40 +02:00
Marcin Grzejszczak
31972419e9 Added support for incremental Gradle builds
fixes gh-1133
2019-07-31 23:26:28 +02:00
janeisklar
c55031e094 Add TestNG support for spring-cloud-contract-verifier (#1101) (#1135)
fixes #1101
2019-07-12 12:17:12 +02:00
Marcin Grzejszczak
82be516441 Fixed formatting 2019-07-09 18:20:43 +02:00
Marcin Grzejszczak
121b0f1fdf Made destination resolver lazy 2019-07-09 18:17:53 +02:00
Marcin Grzejszczak
869e644740 Fixed resolution of content type when working with WireMock stubs 2019-07-09 17:48:08 +02:00
Marcin Grzejszczak
7f351f8b80 Fixed support for line indentations and line endings 2019-07-09 17:47:43 +02:00
Marcin Grzejszczak
f48895c189 Added back support for interacting with a running broker via stub runner 2019-07-09 17:46:51 +02:00
Marcin Grzejszczak
d99d9e12f3 Merge branch '2.1.x' 2019-07-08 17:50:03 +02:00
Marcin Grzejszczak
a1f308b0cf Fixed unnecessary file renaming for scenarios when converting to yaml; fixes gh-1132 2019-07-08 17:06:24 +02:00
Marcin Grzejszczak
89c213f593 Convert to yaml will use query params; fixes gh-1086 2019-07-08 16:34:29 +02:00
Marcin Grzejszczak
bdc69c2523 Merge branch '2.1.x' 2019-07-08 15:39:40 +02:00
Marcin Grzejszczak
03ce42294c Ensures that execute(...) is resolved properly for YAML conversion; fixes gh-1129 2019-07-08 15:38:56 +02:00
Marcin Grzejszczak
6b9e377487 Rewriting to java (#1131)
* Rewritting to java

- rewritten a lot of Spring Cloud Contract Spec module to Java
- extracted all Groovy stuff to a separate package
- will now continue writing extension modules
- spring-cloud-contract-spec will be written purely in java
- spring-cloud-contract-spec-groovy will have Groovy extensions

fixes gh-1130
2019-07-08 14:15:21 +02:00
Marcin Grzejszczak
78e3c08c32 Bumps Groovy to 2.5.7 and Gradle to 5.5; fixes gh-1046 2019-07-03 10:42:28 +02:00
Marcin Grzejszczak
59d3f0d075 Fixed the broken build 2019-07-01 18:31:33 +02:00
Marcin Grzejszczak
b18445ff3f Converted to java 2019-07-01 16:03:22 +02:00
Marcin Grzejszczak
93f2044ef6 Converted to java 2019-07-01 15:48:52 +02:00
Marcin Grzejszczak
a18df67ae8 Added suppresswarnings for all generated tests; fixes gh-1074 2019-07-01 10:49:27 +02:00
Marcin Grzejszczak
d739efc50b Bumped pact to 3.6.7; fixes gh-1099 2019-06-28 17:17:32 +02:00
Marcin Grzejszczak
e792670c7b Fixing wrong json imports 2019-06-28 09:36:43 +02:00
Marcin Grzejszczak
972a50265f Refactored class and method generation (#1116)
following two event storming sessions with @pilloPl and @OlgaMaciaszek and the Spring Cloud Contract community we've decided to refactor the core modules of Spring Cloud Contract Verifier.

The main idea is that the current `JavaTestGenerator`'s implementation no longer uses complex logic to generate classes and methods.

We've introduced abstractions such as:

-    class body builder (to build classes)
-    groovy and java class metadata
-    imports (for various frameworks)
-    default setup for json, xml, restassured, jaxrs
-    class annotations for spock, junit and junit5
-    field insertion e.g. for messaging
2019-06-27 23:01:37 +02:00
Olga Maciaszek-Sharma
954ddfb3d5 Merge branch '2.1.x'
# Conflicts:
#	docker/pom.xml
#	docker/spring-cloud-contract-docker/pom.xml
#	docker/spring-cloud-contract-docker/project/gradle.properties
#	docker/spring-cloud-contract-stub-runner-docker/pom.xml
#	docs/pom.xml
#	pom.xml
#	samples/pom.xml
#	samples/standalone/contracts/com/example/server/pom.xml
#	samples/standalone/dsl/http-client/pom.xml
#	samples/standalone/dsl/http-server/gradle.properties
#	samples/standalone/dsl/http-server/pom.xml
#	samples/standalone/dsl/pom.xml
#	samples/standalone/messaging/pom.xml
#	samples/standalone/messaging/stream-sink/gradle.properties
#	samples/standalone/messaging/stream-sink/pom.xml
#	samples/standalone/messaging/stream-source/gradle.properties
#	samples/standalone/messaging/stream-source/pom.xml
#	samples/standalone/pact/pact-http-client/pom.xml
#	samples/standalone/pact/pact-http-server/gradle.properties
#	samples/standalone/pact/pact-http-server/pom.xml
#	samples/standalone/pact/pom.xml
#	samples/standalone/pom.xml
#	samples/standalone/restdocs/http-client/gradle.properties
#	samples/standalone/restdocs/http-client/pom.xml
#	samples/standalone/restdocs/http-server/gradle.properties
#	samples/standalone/restdocs/http-server/pom.xml
#	samples/standalone/restdocs/pom.xml
#	samples/standalone/webclient/http-client/gradle.properties
#	samples/standalone/webclient/http-client/pom.xml
#	samples/standalone/webclient/http-server/gradle.properties
#	samples/standalone/webclient/http-server/pom.xml
#	samples/standalone/webclient/pom.xml
#	samples/standalone/yml/http-client/pom.xml
#	samples/standalone/yml/http-server/gradle.properties
#	samples/standalone/yml/http-server/pom.xml
#	samples/standalone/yml/pom.xml
#	samples/wiremock-jetty/pom.xml
#	samples/wiremock-native/pom.xml
#	samples/wiremock-tomcat/pom.xml
#	samples/wiremock-undertow-ssl/pom.xml
#	samples/wiremock-undertow/pom.xml
#	samples/wiremock/pom.xml
#	spring-cloud-contract-dependencies/pom.xml
#	spring-cloud-contract-shade/pom.xml
#	spring-cloud-contract-spec/pom.xml
#	spring-cloud-contract-starters/pom.xml
#	spring-cloud-contract-starters/spring-cloud-starter-contract-stub-runner-jetty/pom.xml
#	spring-cloud-contract-starters/spring-cloud-starter-contract-stub-runner/pom.xml
#	spring-cloud-contract-starters/spring-cloud-starter-contract-verifier/pom.xml
#	spring-cloud-contract-stub-runner-boot/pom.xml
#	spring-cloud-contract-stub-runner/pom.xml
#	spring-cloud-contract-tools/pom.xml
#	spring-cloud-contract-tools/spring-cloud-contract-converters/pom.xml
#	spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/gradle.properties
#	spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/pom.xml
#	spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties
#	spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle.properties
#	spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle.properties
#	spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties
#	spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/pom.xml
#	spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/complex-configuration/pom.xml
#	spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/different-module-configuration/module/pom.xml
#	spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/plugin-extension/pom.xml
#	spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-groovy/pom.xml
#	spring-cloud-contract-tools/spring-cloud-contract-maven-plugin/src/test/projects/spring-boot-java/pom.xml
#	spring-cloud-contract-tools/spring-cloud-contract-pact/pom.xml
#	spring-cloud-contract-verifier/pom.xml
#	spring-cloud-contract-wiremock/pom.xml
#	tests/pom.xml
#	tests/samples-messaging-amqp/pom.xml
#	tests/samples-messaging-camel/pom.xml
#	tests/samples-messaging-integration/pom.xml
#	tests/samples-messaging-stream/pom.xml
#	tests/spring-cloud-contract-stub-runner-amqp/pom.xml
#	tests/spring-cloud-contract-stub-runner-boot-eureka/pom.xml
#	tests/spring-cloud-contract-stub-runner-boot-zookeeper/pom.xml
#	tests/spring-cloud-contract-stub-runner-camel/pom.xml
#	tests/spring-cloud-contract-stub-runner-context-path/pom.xml
#	tests/spring-cloud-contract-stub-runner-integration/pom.xml
#	tests/spring-cloud-contract-stub-runner-moco-contract-jar/pom.xml
#	tests/spring-cloud-contract-stub-runner-moco/pom.xml
#	tests/spring-cloud-contract-stub-runner-stream/pom.xml
2019-06-27 15:26:56 +02:00
Artem Ptushkin
de70cd1ef6 Matching strategy at body and contentType issue (#1113)
* Created test for equalToXml and bodyMatchers with xml content type - Failed

* Fixed equalToXml at stub for the equalToXml body and xml content type

* Fixed equalToJson at stub for the equalToJson body and explicit json content type.
If body has matching strategy then it has be used for stub generation.
2019-06-27 15:00:56 +02:00
Artem Ptushkin
60b9e9e1f0 Fixed MissingMethodExceptionNoStack at creating assertion for spock test (#1110)
* Created test for the issue #1089 - failed with MissingMethodExceptionNoStack
* Created groovy unit test for the issue #1089 - failed with MissingMethodExceptionNoStack
* Fixed MissingMethodExceptionNoStack (#1089)
* Changed SpringCloudContractAssertions to groovy with compileStatic

fixes gh-1089
2019-06-19 10:17:40 +02:00
Artem Ptushkin
3e96da889c Fixed MissingMethodExceptionNoStack at creating assertion for spock test (#1110)
* Created test for the issue #1089 - failed with MissingMethodExceptionNoStack
* Created groovy unit test for the issue #1089 - failed with MissingMethodExceptionNoStack
* Fixed MissingMethodExceptionNoStack (#1089)
* Changed SpringCloudContractAssertions to groovy with compileStatic

fixes gh-1089
2019-06-19 10:16:41 +02:00
Olga Maciaszek-Sharma
6a8b005d3d Merge branch '2.1.x' 2019-04-26 17:06:54 +02:00