Commit Graph

823 Commits

Author SHA1 Message Date
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
Marcin Grzejszczak
3c8b712aa2 Made BlockBuilder public
it's a useful class that can be used by different test generators

fixes #254
2017-04-18 12:06:09 +02:00
Marcin Grzejszczak
bfc0d87053 Merge branch '1.0.x' 2017-04-18 09:53:32 +02:00
Marcin Grzejszczak
4414ffb333 Added one more test 2017-04-18 09:53:08 +02:00
Marcin Grzejszczak
3ace049241 Fixed the quotes in JaxRs entities
without this change we're adding an unnecessary quote around a JaxRs entity
with this change we're ensuring that the quote is not there

fixes #261
2017-04-18 09:49:52 +02:00
Marcin Grzejszczak
1a22c00359 Merge branch '1.0.x' 2017-04-14 17:10:17 +02:00
Marcin Grzejszczak
2ce4b2e67c Added an option to use Rest Assured version 3.0
without this change it's impossible to use Rest Assured 3.0 with Spring Cloud Contract. That's because we are adding Rest Assured 2.0 imports.
with this change we detect Rest Assured version. If 3.0 is available on the classpath we change the imports

fixes #266
2017-04-14 15:31:22 +02:00
Marcin Grzejszczak
0f870e7bab Merge branch '1.0.x' 2017-04-14 12:34:43 +02:00
Marcin Grzejszczak
28885c1459 JSONPath compilation fails when there is an array, attribute that is an array and then attribute on an execute()
without this change we're not referrencing arrays properly in json path. For some reason (that I don't remember) we had a deferrencing via 'get' in the code. 'get' is not present in JSON Path. That's why it was failing
with this change we're deferrencing arrays via `.` or index

fixes #251
2017-04-14 12:30:57 +02:00
Marcin Grzejszczak
b142195d09 Merge branch '1.0.x' 2017-04-14 09:59:31 +02:00
Marcin Grzejszczak
5843234fa1 Fixed invalid escaping of characters for regex
without this change some regex contained invalid characters. Even though the code compiles the regular expressions passed to json assert are invalid.
with this change that gets fixed and tests are added. We're now checking if the code can be executed and not only compiled. We also check if WireMock fed with the stubs generated from these cases works fine and not only do we check if stub mappings are properly generated.

fixes #250
2017-04-14 09:40:15 +02:00
Marcin Grzejszczak
ef5020986f Bumping versions to 1.1.1.BUILD-SNAPSHOT after release 2017-04-11 11:26:11 +02:00
Marcin Grzejszczak
fe14d5c7d9 Going back to snapshots 2017-04-11 11:23:13 +02:00
Marcin Grzejszczak
c167df4fd6 Update SNAPSHOT to 1.1.0.RELEASE 2017-04-11 11:08:00 +02:00
Marcin Grzejszczak
4a93090ccc Adding an option to override file extension (#255)
without this change it's impossible to change the generated file extension
with this change you can do it. E.g. provide your own test generator that will store files in `.php` file

fixes #253
2017-03-28 14:41:51 +02:00
Marcin Grzejszczak
4d895da4fb Merge branch '1.0.x' 2017-03-20 18:04:19 +01:00
Peter Frank
ebf09dfda3 gh-245: Created new DslProperty creation methods (#247)
Added:
- iso8601WithOffset which handles iso8601 date time with timezone date validation
- nonBlankString which handles string that aren't "" and also just whitespace
- nonEmptyString which handles "" strings
- anyOf(String...) which handles enumerated style attributes for validation

fixes #245

changed the name of iso8601DatetimeWithTimezone to anyIso8601WithOffset per code review suggestions
2017-03-20 18:02:40 +01:00
Marcin Grzejszczak
a6cd890b50 Going back to snapshots 2017-03-17 10:09:33 +01:00
Marcin Grzejszczak
47dc54cad4 Update SNAPSHOT to 1.1.0.RC1 2017-03-17 10:04:52 +01:00
Marcin Grzejszczak
ef9c567d46 Going back to snapshots 2017-03-10 15:00:53 +01:00
Marcin Grzejszczak
63180de4fe Bumping versions before release 2017-03-10 14:46:47 +01:00
Marcin Grzejszczak
b3ee45a48c Made tests less brittle 2017-03-07 22:57:10 +01:00
Marcin Grzejszczak
d6f2227f89 Referencing request from response (#238)
The best situation is to provide fixed values but sometimes you need to reference a request in your response. In order to do this you can profit from the fromRequest() method that allows you to reference a bunch of elements from the HTTP request. You can use the following options:

- `fromRequest().url()` - return the request URL
- `fromRequest().query(String key)` - return the first query parameter with a given name
- `fromRequest().query(String key, int index)` - return the nth query parameter with a given name
- `fromRequest().header(String key)` - return the first header with a given name
- `fromRequest().header(String key, int index)` - return the nth header with a given name
- `fromRequest().body()` - return the full request body
- `fromRequest().body(String jsonPath)` - return the element from the request that matches the JSON Path

fixes #237
2017-03-02 10:14:10 +01:00
Marcin Grzejszczak
5d72fc2071 Merge branch '1.0.x' 2017-02-22 13:38:26 +01:00
Marcin Grzejszczak
19120f55fc Fixed the way we clone bodies in response
without this change we are not doing a deep copy of a collection thus we're accidentaly removing the original value
with this change we ensure that a deep copy is made

fixes #229
2017-02-22 13:30:59 +01:00
Marcin Grzejszczak
c78e5ebfd5 Merge branch '1.0.x' 2017-02-14 14:28:13 +01:00
Marcin Grzejszczak
99d393b8e3 Fixed the way we work with body that is just a number
fixes #226
2017-02-14 14:04:39 +01:00
Marcin Grzejszczak
3351bb3751 Ignored a test due to Netflix Retry issue 2017-02-10 14:13:54 +01:00
Marcin Grzejszczak
270907fbd9 Fixed broken tests 2017-02-10 13:42:47 +01:00
Marcin Grzejszczak
a1eb124e0c Updated docs 2017-02-10 13:40:49 +01:00
Marcin Grzejszczak
47102d722b Added the byCommand matcher
with this change the users can pass their own custom methods for the given matcher

hopefully fixes #217
2017-02-10 13:30:09 +01:00
Marcin Grzejszczak
0de8b383ae Merge branch '1.0.x' 2017-02-09 16:55:05 +01:00
Marcin Grzejszczak
576330652f Added support for .. in the path
when one provides .. in the path it's actually a collection. So if regex is there now we support it. If it's size check - exception will be thrown

fixes #217
2017-02-09 16:36:37 +01:00
Marcin Grzejszczak
8b91361bc1 Added flattened size assertion and refactored collection assertions
with this change we no longer call the integer assertions on the size. We have our own custom size assertions.
Also we can do a flattened size assertion. If in the jsonpath there is [*] we can finally check the whole size and assert it properly

related to #217
2017-02-09 16:13:28 +01:00
Marcin Grzejszczak
a2c48dd1ba Revert "Disabling support for size checks when path contains [*]"
This reverts commit dc1c230b3d.
2017-02-09 15:08:43 +01:00
Marcin Grzejszczak
0a3e5a979c Merge branch '1.0.x' 2017-02-09 15:08:25 +01:00
Marcin Grzejszczak
dc1c230b3d Disabling support for size checks when path contains [*]
we'll need to flatten the array before checking the size. That logic will end up in our custom assertions.

related to #217
2017-02-09 15:07:31 +01:00
Marcin Grzejszczak
f34039bbfb Added SpringCloudContractAssertions
we're hiding the details related to assertions in our new abstraction over assertj assertions. That way we'll be able to add new methods in an easy way. There will be no need to create annonymous conditions etc.
2017-02-08 14:02:29 +01:00
Marcin Grzejszczak
b94a074e41 Merge branch '1.0.x' 2017-02-08 11:42:12 +01:00
Marcin Grzejszczak
ab7fe13aac Adding an option to validate children nodes in an array (#219)
without this change it's impossible to assert with response matchers all elements of an array
with this change we're using AssertJs conditions in case the pattern contains [*]

fixes #217
2017-02-08 11:41:59 +01:00
Marcin Grzejszczak
0c14acc412 Merge branch '1.0.x' 2017-02-03 10:49:57 +01:00
Marcin Grzejszczak
e1816681dd Fixed the condition for min / max assertions to use 0 too
without this change due to Groovy Truth, size 0 is ignored
with this change we're checking for null, thus size 0 is not ignored

fixes #204
2017-02-03 10:49:47 +01:00
Marcin Grzejszczak
e135e618ec Polish 2017-02-02 17:16:36 +01:00
Marcin Grzejszczak
eaea0a6d21 Upgrading WireMock to 2.5.1
fixes #202
2017-02-02 17:15:04 +01:00