Commit Graph

2620 Commits

Author SHA1 Message Date
Marcin Grzejszczak
941e56cdce Bumped Build 2019-01-21 14:13:09 +01:00
Marcin Grzejszczak
281bd653ae Bumped Boot to 2.1.2.RELEASE 2019-01-21 13:34:49 +01:00
Marcin Grzejszczak
d41d79b887 Added javadocs 2019-01-20 22:42:36 +01:00
Marcin Grzejszczak
0d0d2ea11c Shouldn't always parse each object
without this change, when a body is parsed and it contains a JSON in a JSON, then we parse it. That's because our logic hasn't actually ever considered that one can have a valid JSON string in a JSON.

with this change we're introducing a parsing closure. When we know that the body is a Map and we know that we're parsing a JSON, then we don't want to parse any Strings inside that map. We assume that the users know what they do, so if an element in the map is a String, then we just pass it.

fixes gh-652
2019-01-20 22:23:34 +01:00
Marcin Grzejszczak
1eed5c606d Merge branch '2.0.x' 2019-01-20 20:33:57 +01:00
Marcin Grzejszczak
fb1e081dda Added a test and docs on how to add all stubs from the classpath; fixes gh-591 2019-01-20 20:33:49 +01:00
Marcin Grzejszczak
d50ddf15c5 Merge branch '2.0.x' 2019-01-20 13:06:15 +01:00
Marcin Grzejszczak
7f1b14a292 Escaping new lines for json; fixes gh-802 2019-01-20 13:05:08 +01:00
Olga Maciaszek-Sharma
6c3caddb7b Add xml support (#855)
* Start working on generating stub requests from Xml.

* Start implementing matching by xpath.

* Handle xml request body matchers.

* Merge branch 'master' into add-xml-support

* Implement analysing xmls and converting nodes to matchers.

* Handle attributes in xml analysis and generate stubs with xml body matchers.

* Make XmlToXPathsConverter statically compiled.

* Start extracting json test generation logic out of the MethodBodyBuilder.

* Fix extracted JsonBodyVerificationBuilder. Fix processing attributes
from xml while generating stubs. Fix and adjust tests to recent changes.

* Merge branch 'master' into add-xml-support

# Conflicts:
#	spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/builder/MethodBodyBuilder.groovy
#	spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/converter/ContractsToYaml.groovy
#	spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/dsl/wiremock/WireMockRequestStubStrategy.groovy
#	spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/JsonToJsonPathsConverter.groovy
#	spring-cloud-contract-verifier/src/test/groovy/org/springframework/cloud/contract/verifier/converter/YamlContractConverterSpec.groovy

* Implement test generation for XML body matchers. Start implementing handling XML lists in assertions.

* Fix generating list element assertions and regex body matcher assertions.
Move XML-assert lib content to project sources. Add tests.

* Fix recognising XML content from String body. Minor refactoring.

* Adjust yaml contracts to new xml handling.

* Add tests for handling XML with yaml contracts. Handle incorrect request
matchers processing.

* Minor refactoring.

* Add docs.

* Fix docs.

* Fixes after code review.

* Switch to apache commons logger in `XmlAsserter`.
2019-01-18 20:16:19 +01:00
Marcin Grzejszczak
5d8015aa0f Merge branch '2.0.x' 2019-01-18 16:28:07 +01:00
Marcin Grzejszczak
03a4303a10 Not causing an exception when context is broken; fixes gh-833 2019-01-18 16:28:00 +01:00
Marcin Grzejszczak
ab452206f9 Should provide an option to remove folders that are not empty in Windows; fixes gh-834 2019-01-18 16:15:31 +01:00
Marcin Grzejszczak
4a127e7785 Removed unnecessary duplicated call to rest doc's document method; fixes gh-816 2019-01-15 17:36:25 +01:00
Marcin Grzejszczak
122ae70851 Fixed build 2019-01-15 15:25:34 +01:00
Marcin Grzejszczak
15e511251e Merge branch '2.0.x' 2019-01-15 15:16:38 +01:00
Marcin Grzejszczak
85e8e869b7 Ensures that we don't try to remove root element from json; fixes gh-844 2019-01-15 15:16:29 +01:00
Marcin Grzejszczak
4846e00014 Merge branch '2.0.x' 2019-01-15 14:59:10 +01:00
Marcin Grzejszczak
9d0f859f3d Fixed unnecessary escaping of strings; fixes gh-851 2019-01-15 14:58:55 +01:00
Marcin Grzejszczak
9d538b7393 Fixes folder names for generated tests
without this change the generated tests reference a package that is not actually resolved to a proper folder. That's because we're not escaping the folder name properly
with this change we ensure that all folders have good name

fixes gh-836
fixes gh-850
2019-01-14 20:19:01 +01:00
Spencer Gibb
4b028ea48a Bumps spring cloud build to 2.1.2.BUILD-SNAPSHOT 2019-01-12 12:58:47 -05:00
Marcin Grzejszczak
6de903368a Added support for additional configuration of HTTP Server stubs
without this change it's hard to add HTTPs support for the stubs ran by stub runner. It's close to impossible to alter the default configuration of HTTP server stubs at all (e.g. lower the logging level of WireMock stubs etc.)
    with this change we allow to pass a class as a property to stub runner either via annotation, JUnit rule / extension or just system properties. That way the configurer will be applied at runtime for WireMock stubs (implementors of custom HTTP server stubs will need to perform some additional work to allow this)

    fixes gh-742
2019-01-11 13:47:40 +01:00
Marcin Grzejszczak
66f7e9329e Updated docs; fixes gh-846 2019-01-10 16:50:48 +01:00
Marcin Grzejszczak
ea65ae3553 Added latest version support for git storage
without this change you always have to pass the concrete version for git based storage
with this change we support passing of a latests version

fixes gh-745
2019-01-10 16:04:32 +01:00
Marcin Grzejszczak
e12b0b74b6 Migrated the destination for Pact to meta-data 2019-01-08 15:08:51 +01:00
Stephan
70adb02ec9 Workaround for missing message destination in message-pacts: Description field is used. 2019-01-08 14:59:52 +01:00
Marcin Grzejszczak
7b0b264d4b Fixed the broken build 2019-01-07 20:35:21 +01:00
Marcin Grzejszczak
a4c423edee Merge branch '2.0.x' 2019-01-07 18:01:15 +01:00
Marcin Grzejszczak
16e5f1bd19 Fixed wrong sub-arrays isEmpty assertion; fixes gh-797 2019-01-07 17:58:44 +01:00
Marcin Grzejszczak
2fdb9901c5 Merge branch '2.0.x' 2019-01-04 17:26:36 +01:00
Marcin Grzejszczak
69d990f3a1 Added spring-boot-starter-web for stub runner boot
fixes gh-840
2019-01-04 17:26:19 +01:00
Marcin Grzejszczak
e22f5ec76e Fixed cloning of objects 2019-01-03 10:59:02 +01:00
Marcin Grzejszczak
120820ff9c Warn message if scm not matched 2019-01-02 19:00:40 +01:00
Marcin Grzejszczak
20c12e569d Fixed invalid flag 2019-01-02 18:10:45 +01:00
Marcin Grzejszczak
4b50846fb4 Polish 2019-01-02 10:13:40 +01:00
Marcin Grzejszczak
d90bf2ccab Polish 2019-01-01 11:58:04 +01:00
Marcin Grzejszczak
6464513878 Allow fetching contract definitions from file system and pushing them to GIT; fixes gh-773 2019-01-01 11:49:59 +01:00
Marcin Grzejszczak
56fbc11f62 Allows passing of regex type (#832)
without this change if one does $(regex("[0-9]")) we have no knowledge of whether the result should be text or a number. What we do ATM is we always generate a String
with this change once can pass the type of regular expression and we will generate the concrete value of that given type

fixes gh-768
2018-12-28 16:29:32 +01:00
Marcin Grzejszczak
58bf533462 Fixed invalid yaml contract name setting 2018-12-27 11:54:51 +01:00
Marcin Grzejszczak
59e5f8b1eb Convert Contract Definitions to YAML (#827)
without this change, if you're using some external libraries and you reference them in your DSL, those libraries need to also be used on the consumer side.

with this change, you can set the contractsToYaml property of the plugin, that will convert the contract definitions into YAML, and then generate tests and stubs. We will store the original contract definitions under the originals folder.

fixes #744
2018-12-27 11:14:31 +01:00
Marcin Grzejszczak
6901fe03f5 BUmped wiremock to 2.20.0; fixes gh-925 2018-12-24 09:35:18 +01:00
buildmaster
e6640350bc Going back to snapshots 2018-12-20 21:43:00 +00:00
buildmaster
f47d0d3406 Update SNAPSHOT to 2.1.0.RC3 2018-12-20 21:37:41 +00:00
Marcin Grzejszczak
a57a8e6548 Polish 2018-12-20 14:58:32 +01:00
Marcin Grzejszczak
9c7c896115 Assert size of collections on the request side; fixes gh-824 2018-12-20 14:53:38 +01:00
Marcin Grzejszczak
6969d233b8 Removed httpclient setup 2018-12-18 14:08:42 +01:00
Marcin Grzejszczak
d7ae991469 Fixed build 2018-12-18 14:04:53 +01:00
Marcin Grzejszczak
204c6a97f7 Merge branch '2.0.x' 2018-12-18 13:24:17 +01:00
Marcin Grzejszczak
7b2cce7513 Fixed issues with bound ports 2018-12-18 13:20:39 +01:00
Marcin Grzejszczak
f45f624d34 Made test less brittle 2018-12-17 13:49:06 +01:00
Marcin Grzejszczak
4ca8091494 Removed cross compilation 2018-12-17 13:31:24 +01:00