Commit Graph

1247 Commits

Author SHA1 Message Date
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
Marcin Grzejszczak
cb803320cd Updated tests for the context path
without this change the explicit mode is broken and context path scenario can't be tested
    with this change you can provide the EXPLICIT mode with which you can set the RestAssured to send real requests. That way you can set up your application to listen on a socket and have the context path setup. The contracts need to include the context path too since in real world you'll send a request to a URL that contains a context path element.

    fixes #179 #117
2016-12-28 19:38:39 +01:00
Marcin Grzejszczak
0fd91976f3 Added excludeBuildFolders property
without this change when we work with the repo with common contracts then in the logs we can see that a lot of unnecessary files are processed. Those files are related to the fact that `target` / `build` folders are created and reside in the path in which we're searching for contracts. Due to this we have duplicates in terms of converting files.
with this change we add the `excludeBuildFolders` property that is by default turned off. If you enable it in the `pom.xml` that is used by the consumers to install stubs locally then the target folder gets ignored.

fixes #167
2016-12-28 12:28:07 +01:00
Marcin Grzejszczak
60648f6203 Updated video in the docs 2016-12-27 19:54:05 +01:00
Marcin Grzejszczak
07bf0cb9c7 Fixed the way in JUnit we address list indices
without this change for some reason we're using .get() to address an entry in the list via a index
with this change we're doing it in the proper JSON path format which is `$[index]`

fixes #85
2016-12-27 14:18:40 +01:00
Marcin Grzejszczak
b7beb322b5 Fixed deserialization of byte array
without this fix we're not assuming that the payload can be an array of bytes
with this fix we're converting an array of bytes into a String

fixes #178
2016-12-27 12:24:34 +01:00
Marcin Grzejszczak
a509124976 Added info about WireMock exclusions to the docs
without this change if someone used the Spring Cloud BOM one could have some dependency related issues coming from exclusions of WireMock dependencies in SPring CLoud COntract
with this change we're informing the user about this

fixes #146
2016-12-23 14:38:46 +01:00
Marcin Grzejszczak
6da0cb25ac Unescaping escaped quotes
without this change we're escapng an already escaped quotes in a regex
with this change we're doing a hack to unescape a double escaped quote

fixes #169
2016-12-23 14:26:29 +01:00
Marcin Grzejszczak
4582a6a3bf Fixed invalid parsing of ids
without this change when someone has provided an empty value of port then a default classifier was set instead of picking the provided one

fixes #176
2016-12-22 19:10:42 +01:00
Marcin Grzejszczak
1fe79521ac Response body with text content type header still being verified using json matchers
- fixed the way that text/plain is dealt with
 - added compilation checks for Groovy / Java
 - added compilation check for JaxRs

This is an important commit since it's compiling the generated code to ensure that the tests we're generating
are compilable. It turned out that a couple of regex for Groovy were not properly set. With this change
if we produce code that doesn't compile

fixes #177 #172
2016-12-22 18:34:02 +01:00
Marcin Grzejszczak
73d4d652ff Fixed invalid OptionalProperty conversion
without this change a toString was executed on an optional property due to a missing method that parses those kind of props.
with this change we've added a missing method and also we've made optional property toString return the proper pattern

fixes #173
2016-12-21 16:14:30 +01:00
Marcin Grzejszczak
5a32b73f26 Creating missing folders if not present
without this fix sometimes when the folders are not created then exceptions occur while trying to process the project.

Related to #159
2016-12-21 14:36:58 +01:00
Marcin Grzejszczak
8951ea554f Fixed checking projects from root
without this change contracts are taken from a wrong directory and they tend to be always up to date in a multi module project
with this change we check the contract sources from the current project. also we've removed the up to date check

fixes #159
2016-12-20 19:12:06 +01:00
Marcin Grzejszczak
40f335da21 Updated readme 2016-12-19 16:19:56 +01:00
koslowskyj
62a7720c96 use method queryParam provided by MockMvc instead of appending Url 2016-12-19 16:06:06 +01:00
koslowskyj
4bdf572f1e support of encoded url parameters in MockMvc 2016-12-19 16:05:57 +01:00
Dave Syer
29a726e773 Add lifecycle mapping for m2e 2016-12-15 10:45:53 +00:00
Marcin Grzejszczak
f9961d17f6 Fixed missing regex value generation
without this change the autogenerated tests were wrong and contained a 'cursor' value
with this change it got fixed

fixes #168
2016-12-14 21:58:01 +01:00
Marcin Grzejszczak
e3056a4978 #167 updated the regex and tests 2016-12-07 16:53:21 +01:00
Marcin Grzejszczak
c067774eee Fixed the invalid regex escape
fixes #162
2016-12-07 16:29:11 +01:00
Marcin Grzejszczak
545874c951 Issues #110 user pass (#157)
can now configure username and password authentication and a proxy for accessing stub repository

Fixes #110
2016-12-05 14:56:08 +01:00
Marcin Grzejszczak
cf2dbc24a6 Adds the env prop for every run server (#158)
without this change you can't reference the port of a server as an env var

fixes #147
2016-12-01 22:49:23 +02:00
Marcin Grzejszczak
7a347da55a Going back to snapshots 2016-11-24 18:58:50 +01:00
Marcin Grzejszczak
c7883a0d97 Bumping version before release 2016-11-24 18:37:39 +01:00
Marcin Grzejszczak
a5642265cd Fixed the way contracts are packaged and tests are generated for plugins
the biggest problem was related with the scenario in which a jar with shared contracts is downloaded
with this change the output JAR structure is proper

fixes #156
2016-11-24 16:56:58 +01:00
Marcin Grzejszczak
c2a1efa9dc Plugins are generating tests for all contracts when using external contracts
When using contract plugins together with a shared repo with contracts we end up with creating contract tests for all the contracts. Stubs are created properly but tests generation ignores the path pattern.
With this change we fix the way tests are generated

fixes #155
2016-11-23 17:43:25 +01:00
Andy Wilkinson
72e165e4ae Use spring-asciidoctor-extensions to provide tabbed code blocks (#153) 2016-11-21 17:15:33 +01:00
Dave Syer
475fa2a40b Fix escaping of __ 2016-11-21 13:56:14 +00:00
Marcin Grzejszczak
699c7d2121 Added Gradle / Maven tabs
with these changes if someone is not interested with one of those tools one won't see it until it gets clicked

fixes #152
2016-11-21 13:59:42 +01:00
Marcin Grzejszczak
49373eb160 Added docs on extending the DSL
with this change we're explaining how you can add your custom methods to the DSL

fixes #23
2016-11-21 11:46:01 +01:00
Marcin Grzejszczak
b1175ff9bd Simplification of the dsl (#151)
with this change to DSL we're adding some helper methods and DSL simplifications 

- c(...) / p(...) - for consumer / producer
- for regex - e.g. $(anyUrl()) - insead of $(consumer(regex(url()))
- Added helper headers and media types
- Added helper http methods

fixes #149
2016-11-18 15:38:35 +01:00
Marcin Grzejszczak
df80cc8f1f Added execute support for text based responses
without this change it's impossible to execute any custom method to assert a response for a body that is just text
with this change you can do it

fixes #150
2016-11-17 13:15:25 +01:00
Marcin Grzejszczak
d683d3d6f0 Added regex support for text based response
without this change any assertion on a text based response wouldn't work
with this change we start doing regex checks

fixes #150
2016-11-17 12:55:48 +01:00
Dave Syer
fa3c0035e0 Use apache HTTP client instead of JDK
Never got to the bottom of this, but the test failure with the
dropped connection (EOF on socket) seems to go away if we use
the Apache client instead of the JDK.
2016-11-15 09:53:42 +00:00
Marcin Grzejszczak
74574b3dc6 Added exclusion on demand of files from jar
without this change you can't control what should be excluded from your folder in the output stubs jar. That way when having a common repo with contracts you had the whole target put into stubs jar
    with this change you can set e.g. `**/target/**/*.*` to exclude anything from the target folder

    fixes #145
2016-11-14 15:54:57 +01:00
Marcin Grzejszczak
ffc691167f Updated ports 2016-11-14 10:57:59 +01:00
Marcin Grzejszczak
42d82dca23 Prepared code for parallel run 2016-11-14 10:30:04 +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
1b3496f492 Switch off web environment in tests
This seems to fix the flickering test problem for me at least.
Not sure why yet, so I'll continue to stare at it.
2016-11-11 11:53:48 +00:00
Marcin Grzejszczak
dcdb7e7f65 Added flaky test support :/ 2016-11-10 13:39:34 +01: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
Marcin Grzejszczak
235af1df1e Added the work offline switch for Gradle plugin
without this change you have to pass `contractRepositoryUrl` for the contract jar to be downloaded
with this change you can pass the `contractsWorkOffline` flag and the local maven repo will be analyzed

fixes #140
2016-11-08 17:27:43 +01:00
Marcin Grzejszczak
293fa22bf4 Updated contract deps 2016-11-08 17:09:07 +01:00
Marcin Grzejszczak
92cf2cf5c6 Updated Spring Boot starter 2016-11-08 17:03:43 +01:00
Marcin Grzejszczak
24e5155431 Added NPE guard for remoteRepos
without this NPE could be thrown while passing workoffline flag and no remote repos
with this NPE will not be thrown

fixes #138
2016-11-08 16:54:40 +01:00
Marcin Grzejszczak
b3cf4077e2 Fixed the base class name
without this change for convention class names we haven't escaped illegal chars
with this change the illegal chars are escaped and no compilation issues occur

fixes #137
2016-11-08 16:14:20 +01:00
Denis Stepanov
ca1cb9fdf6 Allow empty classifier (#134) 2016-11-07 15:11:16 +01:00