Commit Graph

115 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Mathias Düsterhöft
6f3c3f850b Enable amqp integration by property (#131)
Fixes #133
2016-11-06 22:34:05 +01:00
Mathias Düsterhöft
49520d4c3d Add support for spring-amqp annotated listener endpoints
without this change only explicit Spring AMQP support was present
with this change support for spring-amqp annotated listener endpoints was added

fixes #127
2016-10-31 14:23:56 +01:00
Mathias Düsterhöft
2b70b450b9 add spring-amqp/spring-rabbit support for message contracts (#106) 2016-10-20 12:43:31 +02:00
Andrew Fitzgerald
74ea3fd27d Allow MethodBodyBuilder to evaluate ExecutionProperty objects (#114) 2016-10-18 08:20:17 +02:00
Marcin Grzejszczak
f4a6b4f4b1 Going back to snapshots 2016-10-17 12:22:17 +02:00
Marcin Grzejszczak
dd214f83f6 Bumping versions before release 2016-10-17 11:54:52 +02:00
Marcin Grzejszczak
7072284c95 Making Windows build pass (#109)
* had to ignore some tests for Windows due to absurd exceptions
* fixed escaping path for directory matching

fixes #98
2016-10-16 13:47:46 +02:00
Marcin Grzejszczak
fa152252b9 Fixing the tests for Windows 2016-10-10 13:47:05 +02:00
Marcin Grzejszczak
d3896f913b Changed ContractVerifierObjectMapper to a bean
without this change we couldn't alter the mapper

with this change you can customize the whole verifier objectmapper or the objectmapper that is on classpath

fixes #97
2016-10-07 14:59:49 +02:00
Marcin Grzejszczak
8e68dcedd4 Problem with auto-generated values from regex inside the respose body
added missing `$()` method for consumer and producer side only

fixes #94
2016-10-04 15:12:55 +02:00
Marcin Grzejszczak
b598518281 Added ignored to contracts
without this change the only way to ignore a contract was to provide it in the plugin's config

with this change you can also set it on the contract itself.

fixes #30
2016-09-26 14:32:01 +02:00
Marcin Grzejszczak
a557b89a86 Fixed missing test side value resolution
without this change when generating contract tests we were not iterating over a parsed json with test side values only. We had DslProperties that were ignored by multiple dispatch

with this change when generating tests we first convert the parsed json into its test side (those with `producer` method) and only then perform any logic

fixes #85
2016-09-26 13:21:06 +02:00
Marcin Grzejszczak
6381362ad6 Going back to Snapshots 2016-09-23 21:04:10 +02:00
Marcin Grzejszczak
8ee2ef4b18 Bumping versions before release 2016-09-23 20:07:58 +02:00
Marcin Grzejszczak
e8917940ec Added option of multiple test base classes
without this change the user was forced to use a single base class for all of the generated tests. It could become problematic after some time.

With this change we provide a range of options of providing different base classes for different contracts.

fixes #16
2016-09-23 15:52:14 +02:00
Marcin Grzejszczak
01f4ad76be Consumer Contracts (#83)
With this functionality you can have one centralized repository containing all contracts. This repo will have to produce a JAR containing all contracts. The layout of the repository can be arbitrary but some sensible defaults are assumed. The producer will be able to then download that JAR and produce tests and stubs from it.

fixes #38
2016-09-23 10:16:51 +02:00
Marcin Grzejszczak
93782cb049 Polish 2016-09-21 11:06:16 +02:00
Marcin Grzejszczak
7eefac9a15 Added missing conditional on class for Stream autoconfig 2016-09-20 09:25:24 +02:00
Marcin Grzejszczak
24b3f80e8c Going back to SNAPSHOTs 2016-09-08 23:25:23 +02:00
Marcin Grzejszczak
411ca5886b Bumping versions before RC1 release 2016-09-08 23:25:23 +02:00
Marcin Grzejszczak
dbc7c57702 Changed the docs (#74)
* reorganized the entries (now the Contract details went to the very bottom)
* added FAQ section where versioning and dynamic props are better defined
* added in a couple of places links to Groovy JSON docs

fixes #69
2016-09-06 19:41:34 +02:00
Marcin Grzejszczak
30e149694e Moved message collector to a separate config 2016-09-02 17:41:20 +02:00
Marcin Grzejszczak
708a9e8b36 Fixed broken tests 2016-09-02 17:34:41 +02:00
Marcin Grzejszczak
49c5089b40 Added missing beans + Added auto creation of message channels 2016-09-02 17:06:18 +02:00
Marcin Grzejszczak
18b5cf8890 Added a check for missing bean 2016-09-02 16:06:15 +02:00
Marcin Grzejszczak
5c4bc1bda1 Added missing version 2016-09-02 11:24:08 +02:00
Marcin Grzejszczak
8dde9f333b Removed XML entry
will readd it once it has been fixed

fixes #67
2016-08-30 11:06:04 +02:00
Marcin Grzejszczak
c59306ce5d Going back to snapshots 2016-08-27 00:27:55 +02:00
Marcin Grzejszczak
bf60a6b72f Bumping versions before release 2016-08-26 23:51:33 +02:00
Marcin Grzejszczak
64d6d3ef6c Automatic stub registration (#64)
before this change the support for Stub Runner Boot with Service Discovery was pretty useless since Stub Runner stubbed service discovery. That makes a lot of sense in unit / integration tests but not when you want to do some version of end to end tests. 

With this change you can pass a property to enable automated registration of stubs in Service Discovery.

Technical changes:
* Added Zookeeper registration
* Added Eureka registration
* Added Consul registration
* Added checkstyle plugin - fixed part of exceptions
2016-08-26 16:09:16 +02:00