Commit Graph

73 Commits

Author SHA1 Message Date
Marcin Grzejszczak
c496722838 Merge branch '1.1.x' 2017-07-03 11:10:20 +02:00
Marcin Grzejszczak
b54c36ce8b Polish 2017-07-03 11:10:02 +02:00
Tomasz Kopczynski
9d0075f586 gh-342: Rest Docs stubs with no body 2017-07-02 22:59:38 +02:00
Marcin Grzejszczak
3ff0ed942c Trying to make the shading work in intellij (again) 2017-06-20 17:24:32 +02:00
Marcin Grzejszczak
ea5e7e238b Trying to make the shading work in intellij (again) 2017-06-20 09:26:11 +02:00
Marcin Grzejszczak
12ce468b6d Removing deprecations 2017-06-19 18:46:02 +02:00
Dave Syer
8cdad73158 Add support for placeholder resolution in stub file names
E.g. document("{method-name}/{step}").

Fixes gh-84
2017-06-16 14:47:38 +01:00
Marcin Grzejszczak
325afbe3ec Fixed wrong condition on jsonpath for rest docs
fixes #298
2017-06-06 13:28:31 +02:00
Marcin Grzejszczak
205bced50c Polish 2017-05-10 10:35:18 +02:00
Marcin Grzejszczak
6853faa648 Polish 2017-05-10 10:31:52 +02:00
Tomasz Kopczynski
3d23964dca Remove unnecessary host entry from Spring REST Docs contract generation 2017-05-08 19:21:12 +02:00
Dave Syer
cf637d040f Add custom jetty fault injector for 9.4 2017-04-24 14:45:52 +01:00
Marcin Grzejszczak
2380cb483e Merge branch '1.0.x' 2017-04-24 15:07:01 +02:00
Marcin Grzejszczak
1f71cde2be Removed unused import 2017-04-24 15:06:52 +02:00
Marcin Grzejszczak
c2fdead0b0 Merge branch '1.0.x' 2017-04-24 15:03:09 +02:00
Marcin Grzejszczak
b98223b082 Fixed checkstyle 2017-04-24 15:02:50 +02:00
Dave Syer
f3102d6366 Merge branch '1.0.x' 2017-04-24 09:21:35 +01:00
Dave Syer
d3f6ad90a8 Add a fault injector if server is jetty or tomcat
Tomcat sends a slightly different reponse and the client sees it
differently in the malformed chunk scenario. It would be good to have
the same features for Undertow.

See gh-270.
2017-04-24 09:20:17 +01:00
Dave Syer
225e83d025 Merge branch '1.0.x' 2017-04-21 16:10:30 +01:00
Dave Syer
235281ce9f Add @AutoConfigureHttpClient for SSL validation error handling
For tests only users can add this annotation to make the rest template
in their app ignore SSL validation.
2017-04-21 16:09:08 +01:00
Dave Syer
ac9e976a4b Merge remote-tracking branch 'origin/1.0.x' 2017-03-24 09:43:04 +00:00
Dave Syer
c1e285e76f Fix property source ordering issue with bootstrap context
The problem is that the bootstrap context gets created first
with the correct wiremock server port, and then the environment
is merged into the main context before the annotation
property source is created, so the latter takes precedence.
Fixed by re-ordering the property sources if detected.

Also switch off bootstrap context for wiremock server

Fixes gh-225
2017-03-24 09:41:36 +00:00
Dave Syer
aeefdd8636 Merge remote-tracking branch 'origin/1.0.x' 2017-03-22 12:06:58 +00:00
Dave Syer
fd04629f8f Extend range of HTTP request methods in Wiremock REST docs
Fixes gh-249
2017-03-22 12:05:16 +00:00
Marcin Grzejszczak
0048ebd756 Merge branch '1.0.x' 2017-02-23 17:37:40 +01:00
Marcin Grzejszczak
7e19f9fceb Adds option to generate contracts from RestDocs
with this change we're giving an option to not only generate stubs but also generate contracts from the RestDocs test

    fixes #14
2017-02-23 17:37:24 +01:00
Marcin Grzejszczak
d75636169f Merge branch '1.0.x' 2017-02-08 14:04:24 +01:00
Marcin Grzejszczak
92349595e5 Fixed unnecessary slash (#218)
without this change the pattern for stubs contains an unnecessary / which corrupts the location search (e.g. /_files is converted to //_files and there is no such path)
with this change we're removing that value

fixes #216
2017-02-08 14:04:07 +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
Marcin Grzejszczak
1e9e7a4792 Added foreward compatibility with WireMock stubs
fixes #213
2017-02-02 17:00:17 +01:00
Patrice Conil
1337bb0dea Implement JSON matching with JSON Content-Type (#208)
fixes #116
2017-02-01 10:13:24 +01:00
Marcin Grzejszczak
ed30fc6aa5 Fixed the not setting of response status for rest docs
without this change the status recorded in the test was not properly placed in the stub
with this change it gets fixed

fixes #199
2017-01-26 13:11:37 +01:00
Marcin Grzejszczak
4ceaff5b66 Added missing body pattern comparison
without this change the eact contents of the body were mostly ignored
with this change we support all WireMock body matching patterns

fixes #135
2016-12-29 15:38:34 +01:00
Marcin Grzejszczak
e4d8e1f6e2 Added missing method verification
without this change the only criterion for matching of requests was URL / headers / content. The method check was missing
with this change we verify if the HTTP method matches too

fixes #163
2016-12-29 14:10:13 +01:00
Dave Syer
e93d951d50 Add support for file root location in @AutoConfigureWireMock 2016-11-11 14:15:11 +00:00
Dave Syer
3d4cb355c2 Add support for files in WireMockRestServiceServer 2016-11-11 13:10:27 +00:00
Dave Syer
4829e687d8 Improve test coverage of default stubs locations 2016-11-11 12:55:41 +00:00
Dave Syer
b063612d89 Add support for explicit priority in mock server stubs 2016-11-11 12:33:53 +00:00
Dave Syer
891452376b Don't use ServerProperties for configuring Wiremock server
The problem is that it is a Spring Boot app (really tiny one), so
it binds to server.* in the environment, if you try to use
the stock ServerProperties. We only need a subset of the features
so it's actually relatively easy to wrap it and use a delegate.
2016-11-09 16:12:23 +00:00
Dave Syer
13a90f71e9 Defer setting ignore expect order 2016-10-12 09:20:22 +01:00
Marcin Grzejszczak
c8ac0fe8dc Fixing checkstyle issues 2016-10-12 10:18:19 +02:00
Dave Syer
0f41f4a4dc Tweak mock server builder so that it ignores order by default
If user loads stubs from a directory, the order of the resources
is best left to the comparator by default. If the user wants to
order stubs explicitly, she now has to use ignoreExpectOrder(false)
(the default is true, unlike the normal mock mvc server).
2016-10-11 17:03:14 +02:00
Dave Syer
1a88cbd40a Fix order of matchers in mock server
It turns out the WireMock does not (I think) contain a comparator
that helps. We have made a custom comparator that helps a bit
(it orders requests with the same URL in reverse order of the
number of headers matched).
2016-10-11 15:45:30 +02:00
Dave Syer
67e75fd2c6 Add header matchers for mock http server
Wrapping the WireMock matcher in a Hamcrest matcher, and also
using WireMock's native support for sorting mappings, so the
most specific match comes first.
2016-10-11 14:58:14 +02:00
Dave Syer
103668c669 Add all headers if they are matched with "equalTo"
Still TODO: other matcher types (regex etc.)

See gh-105
2016-10-11 14:31:40 +02:00
Dave Syer
870e42f565 Fix mock server when path is empty
When the path is empty "/" is a better default than "null".
2016-10-11 13:57:36 +02:00
Dave Syer
4313717e01 Check that header exists explicitly while loading stubs
Fixes gh-103
2016-10-11 09:49:30 +01:00
Dave Syer
1d32db483b Add test and correct double "/" in fail path
A double "/" wrks with the file system but not in a jar file
apparently, so the test isn't perfect yet. Also improves
javadocs for stubs().
2016-10-11 09:38:37 +01:00
Marcin Grzejszczak
bfc2172d66 Applied checkstyle rules 2016-08-29 12:04:21 +02:00