Commit Graph

266 Commits

Author SHA1 Message Date
Marcin Grzejszczak
8975aee9a8 Using testMatchers in DSL other than byRegex adds unsolicited isEmpty check for an array
The converted body looks different when done via the String notation than it does when done via a map notation. When working with String body and when matchers are provided, even when all entries of a map / list got removed, the map / list itself remains. That leads to unnecessary creation of checks for empty collection. With this method we're checking if the JSON path matcher is related to array checking and we're trying to remove that trailing collection. All in all it's better to use the Groovy based notation for defining body...

fixes #391
2017-08-28 17:31:05 +02:00
Marcin Grzejszczak
49df7bf472 Wrong assertion type is picked for Iterables
without this change in the generated test when SpringCloudContractAssertions are used the compiler is picking an invalid type of Assertj Assertions.
with this change we're explicitly casting to the appropriate interface so that the SpringCloudContractAssertions methods are picked

fixes #381
2017-08-28 16:09:51 +02:00
Marcin Grzejszczak
4c82cf1b58 Revert "Wrong assertion type is picked for Iterables"
This reverts commit 8d2549fecf.
2017-08-28 16:04:13 +02:00
Marcin Grzejszczak
8d2549fecf Wrong assertion type is picked for Iterables
without this change in the generated test when SpringCloudContractAssertions are used, we're casting the read element of the JSON to a Collection class whereas we should be casting to an Iterable.

fixes #381
2017-08-28 15:39:34 +02:00
Marcin Grzejszczak
8ba58d3ab8 Ensure that /tmp files get removed upon process termination
fixes #359
2017-08-22 16:16:25 +02:00
Marcin Grzejszczak
b99bf95ff9 Bumping versions to 1.1.4.BUILD-SNAPSHOT after release 2017-08-21 12:33:24 +02:00
Marcin Grzejszczak
237ee85dc3 Going back to snapshots 2017-08-21 12:33:24 +02:00
Marcin Grzejszczak
b81bb2a489 Update SNAPSHOT to 1.1.3.RELEASE 2017-08-21 12:28:10 +02:00
Marcin Grzejszczak
32cc52a4c2 Spock tests don't have the proper static import
without this change the `org.springframework.cloud.contract.verifier.assertion.SpringCloudContractAssertions.assertThat` was missing in Spock tests
with this change it is added and matchers work fine again

fixes #382
2017-08-18 18:02:29 +02:00
Marcin Grzejszczak
f37869e348 Spring Integration Stub Messages shouldn't be @Component annotated 2017-08-18 14:57:48 +02:00
Cástor Rodríguez
3b44533905 Test generation to place queryParameters before async on RestAssured when chain (#373)
fixes #372
2017-07-31 11:57:06 +02:00
Rocks360
1727041400 Support for generic top level domain .online in the email regular expression (#371)
* Refactor email regular expression to support email addresses ending with .online

fixes #367
2017-07-31 10:03:49 +02:00
Marcin Grzejszczak
e4af835b8e Going back to snapshots 2017-07-21 14:30:45 +02:00
Marcin Grzejszczak
85f458e34c Update SNAPSHOT to 1.1.2.RELEASE 2017-07-21 14:06:43 +02:00
Felipe Adorno
421b669361 Tests fail to compile when the contract contains a long value (#358)
without this change when a contract contains a long value inside the body, then the code fails to compile since the provided number is assumed to be an integer.
with this change we're appending an L literal to that value for the compiler to assume that it's a long value.
2017-07-17 22:35:37 +02:00
Marcin Grzejszczak
0f91efffd3 Fixed the way we treat headers and matching strategies
fixes #353
2017-07-13 12:09:27 +02:00
Marcin Grzejszczak
99deaad17e Contracts path cannot be overriden
without this change there's no way to change the default path of the path to the contracts when trying to execute the convert / generateTests task for another project
with this change we're setting properly the `spring.cloud.contract.verifier.contractsDirectory` for both tasks

fixes #338
2017-06-28 14:45:33 +02:00
Marcin Grzejszczak
aa68196b27 Added tests for #336
fixes #336
2017-06-28 12:46:56 +02:00
Marcin Grzejszczak
36409ac400 Fixing the way queue binding key gets used for rabbit listener
without this change we're very strict in terms of the number of called send methods on the rabbittemplate
with this change we accept that the method could have been called more than once

fixes #332
2017-06-28 11:46:22 +02:00
Marcin Grzejszczak
97380129a4 Fixed wrong contract pattern scanning
e.g. this worked

com/example/foo/...

this didn't

/contract/com/example/foo/...

fixes #335
2017-06-20 21:46:22 +02:00
Marcin Grzejszczak
1a462893e2 Fixed missing header setting and messaging test indentation
fixes #323
2017-06-09 13:05:42 +02:00
Marcin Grzejszczak
2b527b5579 Added a null check if someone passes null as headers for amqp 2017-06-09 12:15:43 +02:00
Marcin Grzejszczak
b158ed4919 Fixed broken response headers assertions
fixes #318
2017-06-05 11:29:43 +02:00
Marcin Grzejszczak
4631ab6ea8 Adds support for execute in request body
fixes #313
2017-06-01 17:50:10 +02:00
Marcin Grzejszczak
baf294dbbf Updated the contracts 2017-05-31 16:14:06 +02:00
Marcin Grzejszczak
8979b79c56 Added examples of multipart support
fixes #304
2017-05-31 15:40:35 +02:00
Marcin Grzejszczak
9fd4a21c43 Added backward compatibility with previous versions in terms of rabbitmq connection factory mocking
without this change we're not mocking all necessary methods in connection factory. When someone used the rabbittemplate, accidentaly we mocked the proper method to return a mocked connection factory. When rabbitmq started using different version of the `newConnection` in all places where rabbittemplate was used the real connection factory was created.
with this change we're mocking all `newConnection` methods to return a mocked connection

fixes #303
2017-05-31 14:28:49 +02:00
Marcin Grzejszczak
d5e933f169 Fixed tests 2017-05-26 22:27:46 +02:00
Marcin Grzejszczak
05ca8f909b Added messagingContentType
without this change you can by mistake use the http headers in a messaging headers which will fail to work
with this change we're adding the messagingContentType() method that allows to properly set the content type

fixes #296
2017-05-26 20:43:44 +02:00
Marcin Grzejszczak
459448cb27 Asserting on the payload before converting it
without this change an NPE is thrown instead of a meaningful message

fixes #307
2017-05-26 18:45:53 +02:00
Marcin Grzejszczak
e0ea1b27f0 Bumping versions to 1.1.2.BUILD-SNAPSHOT after release 2017-05-22 23:57:24 +02:00
Marcin Grzejszczak
82f68347fa Going back to snapshots 2017-05-22 23:57:23 +02:00
Marcin Grzejszczak
7a10b3bf34 Update SNAPSHOT to 1.1.1.RELEASE 2017-05-22 23:51:18 +02:00
Marcin Grzejszczak
c7f5accae4 Merge branch '1.0.x' 2017-05-11 11:38:06 +02:00
Marcin Grzejszczak
4ddae01bf9 Calling toString on getting messaging headers
With contract like this

```
	// output message of the contract
	outputMessage {
		// destination to which the output message will be sent
		sentTo 'verifications'
		// the body of the output message
		body(
			eligible: true
		)
		headers {
			header("contentType", applicationJsonUtf8())
		}
	}
```

the generated test produces

```
ContractVerifierMessage response = contractVerifierMessaging.receive("verifications");
assertThat(response.getHeader("contentType")).isEqualTo("application/json;charset=UTF-8");
```

The headers in the response is a MimeType not a String so the equality check fails.

fixes #297
2017-05-11 11:37:50 +02:00
Marcin Grzejszczak
4c4a18ed22 Bumped versions after release 2017-05-05 12:31:03 +02:00
Marcin Grzejszczak
e9306448f9 Going back to snapshots 2017-05-05 12:23:41 +02:00
Marcin Grzejszczak
bd67bb2f26 Update SNAPSHOT to 1.0.5.RELEASE 2017-05-05 12:12:38 +02:00
Marcin Grzejszczak
15ef2cab35 Merge branch '1.0.x' 2017-05-05 11:41:39 +02:00
Marcin Grzejszczak
1e16934fce Bumped jsonassert to 0.4.9
without this change we analyze empty sets of jsonpath results improperly

fixes #289
2017-05-05 11:25:19 +02:00
Marcin Grzejszczak
97a4d6c101 Merge branch '1.0.x' 2017-04-28 13:15:56 +02:00
Marcin Grzejszczak
8ca2ed6b22 Fixed the way package and class names are generated
with the new layout of contracts and stubs the package name was improperly generated (for chars like +, or digits)
with this change we're converting those chars to _

fixes #276
2017-04-28 12:46:45 +02:00
Marcin Grzejszczak
c9538548fd Adds an option to use StubRunner from classpath (#284)
without this change there's no option to use Stub Runner to pick stubs from classpath
with this change we're adding that option. It's enough for the user not to provide neither the `repositoryRoot` nor `workOffline`. If that's the case then Classpath scanning will take place.

fixes #282
2017-04-27 17:13:15 +02:00
Marcin Grzejszczak
a804894c9a Updated code and docs 2017-04-26 12:42:33 +02:00
Marcin Grzejszczak
cf52e6baa6 Added support fot dots in keys
without this change it's impossible to work with jsons that have dots in keys
    with this change that's possible again

    fixes #269
2017-04-26 12:12:17 +02:00
Marcin Grzejszczak
cf2e7e0feb Generate code that respects dots in keys
without this change if the user has jsons that contain `.` in a key (e.g. `foo.bar.baz`) then the produced json path is wrong
with this change we're wrapping all keys in `[' ']` format (e.g. `['foo.bar.baz']`) so that the json path gets properly translated

fixes #269
2017-04-25 14:57:07 +02:00
Marcin Grzejszczak
a994f7c17b Merge branch '1.0.x' 2017-04-25 13:15:56 +02:00
Marcin Grzejszczak
0d1b76c471 Fixed wrong test name 2017-04-25 13:15:04 +02:00
Marcin Grzejszczak
2942882775 :Merge branch '1.0.x' 2017-04-25 13:11:32 +02:00
Marcin Grzejszczak
0a09695b5c Fixed missing escaping of . in folder name
fixes #276
2017-04-25 13:07:10 +02:00