Commit Graph

823 Commits

Author SHA1 Message Date
buildmaster
1314163825 Going back to snapshots 2019-01-22 20:46:18 +00:00
buildmaster
cd239d8c39 Update SNAPSHOT to 2.1.0.RELEASE 2019-01-22 20:39:11 +00:00
Marcin Grzejszczak
8ebc749d2f Fixed the way regex entries are generated for message bodies; fixes gh-858 2019-01-22 09:14:08 +01:00
Marcin Grzejszczak
38b1ebae2f Added a test case for message and regex; fixes gh-858 2019-01-22 08:44:51 +01:00
Olga Maciaszek-Sharma
313d5ef586 Fix WebFlux usage section in docs. Remove unused method (#857)
Remove unused method and implementation for processing xml body verification (class is package-
scope, so not backwards incompatible change).
2019-01-21 18:51:35 +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
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
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
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
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
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
9c7c896115 Assert size of collections on the request side; fixes gh-824 2018-12-20 14:53:38 +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
4ca8091494 Removed cross compilation 2018-12-17 13:31:24 +01:00
Marcin Grzejszczak
46056aa783 Added a test that ensures that invalid class name gets converted 2018-12-16 23:28:02 +01:00
Marcin Grzejszczak
4464800512 Improved reading from file 2018-12-16 23:10:30 +01:00
Marcin Grzejszczak
e68448281f Revert "Fixed invalid multiline json reading"
This reverts commit 923faef7d3.
2018-12-16 22:54:57 +01:00
Marcin Grzejszczak
923faef7d3 Fixed invalid multiline json reading 2018-12-16 22:39:28 +01:00
Marcin Grzejszczak
0058b987ae Adds support for binary payloads (#818)
with this change we're adding support for binary payloads both for HTTP and messaging.

fixes #664
2018-12-15 14:06:17 +01:00
buildmaster
ba02983ff6 Going back to snapshots 2018-12-11 22:34:06 +00:00
buildmaster
eae5866fba Update SNAPSHOT to 2.1.0.RC2 2018-12-11 22:28:39 +00:00
buildmaster
cb401b9cc2 Going back to snapshots 2018-12-11 19:03:21 +00:00
buildmaster
ca9bd89614 Update SNAPSHOT to 2.1.0.RC1 2018-12-11 18:57:39 +00:00
Marcin Grzejszczak
38a70b5b75 Fixed the documentation 2018-12-03 14:34:55 +01:00
Olga Maciaszek-Sharma
9bafbf66c8 Code cleanup. 2018-11-19 11:37:33 +01:00
Marcin Grzejszczak
b52b6d2ef8 Merge branch '2.0.x' 2018-11-14 12:01:48 +01:00
Marcin Grzejszczak
9c6d625941 Merge branch '1.2.x' into 2.0.x 2018-11-14 12:01:34 +01:00
Marcin Grzejszczak
f0c7d26e8b Allows generating stubs for body containing boolean; fixes gh-708 2018-11-14 12:01:23 +01:00
Marcin Grzejszczak
a0aaee7578 Converted the storer's interface to byte[] 2018-11-12 22:23:14 +01:00
Marcin Grzejszczak
72f171ed6c targetFramework to testFramework 2018-11-12 11:17:13 +01:00
Marcin Grzejszczak
387b95a894 Added warning message 2018-11-11 11:32:53 +01:00
Marcin Grzejszczak
6210c42162 Add an option to dump contracts into a common representation
Allow an option to dump contracts as files for the given ContractConverter. In other words, if you have contracts written in e,g, groovy and yml, by providing a FQN of org.springframework.cloud.contract.verifier.converter.YamlContractConverter, you will be able to dump all files in a folder in a yml format.

fixes gh-793
2018-11-10 23:53:18 +01:00
Marcin Grzejszczak
8cf9dc8252 Added a guard against npe in camel 2018-11-09 20:33:05 +01:00
Marcin Grzejszczak
8f1ab301c9 Merge branch '2.0.x' 2018-11-08 20:10:49 +01:00
Marcin Grzejszczak
c884b9cfbd Merge branch '1.2.x' into 2.0.x 2018-11-08 20:04:48 +01:00
Marcin Grzejszczak
525bc4eead Ensures that can parse amqp headers when they are a list; fixes gh-789 2018-11-08 20:04:35 +01:00