Commit Graph

2158 Commits

Author SHA1 Message Date
Marcin Grzejszczak
a4e79d380f Fixed accidentally pasted code 2018-03-21 15:17:54 +01:00
Marcin Grzejszczak
736f56a93b Added tests for optional fields with nulls 2018-03-21 15:00:39 +01:00
Marcin Grzejszczak
297ee8e2ea Changed the Groovy equals & hashcode usage to manual one
there's a bug in Groovy with autogenerated hashCode and byte arrays
to fix it we've migrated from the AST to manual hashcode and equals generation

fixes gh-546
2018-03-21 14:03:06 +01:00
Marcin Grzejszczak
0078230492 Merge branch '1.2.x' 2018-03-21 11:35:42 +01:00
Marcin Grzejszczak
4e08f77996 escapes all generated strings by Xeger so that the code is java compatible
related to gh-589

fixes gh-588
2018-03-21 11:35:29 +01:00
Marcin Grzejszczak
f70c1dbfdd Added support for patterns inside GStrings in URL
related to gh-589

fixes gh-588
2018-03-21 10:54:24 +01:00
Marcin Grzejszczak
cd07f6d42b Xeger can cause stackoverflow and doesn't understand \d \w \s
fixes gh-589, fixes gh-590
2018-03-21 10:53:30 +01:00
Marcin Grzejszczak
561c2d30ec Merge branch '1.2.x' 2018-03-21 09:14:07 +01:00
Marcin Grzejszczak
f57cefc68a Ensured that regular expressions are generated properly; fixes gh-587 2018-03-21 09:13:19 +01:00
mfeygelson
4d72a2744e Support pattern properties in messaging contracts (#564)
(cherry picked from commit c4ab647)
2018-03-21 08:29:40 +01:00
Marcin Grzejszczak
18d0827fa7 Merge branch '1.2.x' 2018-03-20 21:14:22 +01:00
Marcin Grzejszczak
67019774e1 Fixed missing conversion of messaging patterns to java
without this change patterns were not escaped the way they should

fixes gh-587
2018-03-20 21:08:24 +01:00
Marcin Grzejszczak
b70106e7bc Merge branch '1.2.x' 2018-03-20 14:17:20 +01:00
Marcin Grzejszczak
c7250a8d62 Added support for RoutingKey in AMQP stub messages
fixed via @KazuoD suggestion

fixes gh-585
2018-03-20 14:17:05 +01:00
Marcin Grzejszczak
5476e1d127 Allow parametrization of generated contract names
with this change we accept all the placeholder values that are acceptible by RestDocs

fixes gh-452
2018-03-20 11:38:49 +01:00
Marcin Grzejszczak
8a9527b600 Fixed the docs 2018-03-19 16:34:38 +01:00
Marcin Grzejszczak
54cff1f19c Merge branch '1.2.x' 2018-03-19 16:33:29 +01:00
Marcin Grzejszczak
8ad4865fb5 Fixed the docs 2018-03-19 16:33:22 +01:00
Marcin Grzejszczak
60d45b5ad3 Merge branch '1.2.x' 2018-03-19 16:32:15 +01:00
Marcin Grzejszczak
51564ab444 Discouraged users from using spring-cloud-contract-wiremock dependency directly
the preferred option is to use `spring-cloud-starter-stub-runner`

fixes gh-348
2018-03-19 16:31:12 +01:00
Marcin Grzejszczak
e4eaafc697 Added Support Content-Transfer-Encoding in Multipart regexp
fixes gh-339
2018-03-19 15:31:42 +01:00
Marcin Grzejszczak
f433118a15 Allows exposure of multiple versions via Stub Runner
without this change for a single group and artifact id you can have only one entry in stub runner
with this change you can have multiple ones

fixes gh-474
2018-03-19 14:45:09 +01:00
Marcin Grzejszczak
ed52de44ba 🤦 2018-03-19 11:43:32 +01:00
Marcin Grzejszczak
65cd71f38e Added support for byte multipart content
fixes gh-546
2018-03-19 10:54:02 +01:00
Marcin Grzejszczak
cd723739b5 Added more verbose information to collection assertions
with this change each collection assertion has the `.as("x.y.z")` where `x.y.z is the json path. That results in the following message to be printed when size of the collection was wrong

`[x.y.z] The size <3> is not between <5> and <7>`

fixes gh-441
2018-03-16 17:48:01 +01:00
Marcin Grzejszczak
64fe74fee7 Polish 2018-03-16 16:55:25 +01:00
Marcin Grzejszczak
969cfe8573 Added an option to disable the wiremock rest tempalte customizer
with this change just set "wiremock.rest-template-ssl-enabled:false"  and the customizer will not be set up

fixes gh-413
2018-03-16 16:30:30 +01:00
Marcin Grzejszczak
c3d7e2721d Small update on the annotation 2018-03-16 16:14:55 +01:00
Marcin Grzejszczak
32888e3b92 Add a convenience mechanism to get stub runner port
Now, you can also use the `@StubRunnerPort` annotation to inject the port of a running stub.
Value of the annotation can be the `groupid.artifactid` or just the `artifactid`. Example for Stub Runner ids
`com.example:foo`, `com.example:bar`.

```java
@StubRunnerPort("foo")
int fooPort;
@StubRunnerPort("com.example.bar")
int barPort;
```

fixes gh-573
2018-03-16 16:04:36 +01:00
Marcin Grzejszczak
e222142321 Added support for form param
without this change we supported only text and json content type body.
with this change we also support url encoded form parameters

fixes gh-578
2018-03-16 12:05:53 +01:00
Marcin Grzejszczak
068206f02a Removed private access 2018-03-16 11:52:18 +01:00
Marcin Grzejszczak
e18d3c848e Fixed a typo 2018-03-16 07:10:08 +01:00
Marcin Grzejszczak
1cd2ce9722 Fixed broken tests 2018-03-16 06:53:37 +01:00
Marcin Grzejszczak
7a38ab9867 Added the deleteStubsAfterTest flag to remove stubs after tests are finished
if `deleteStubsAfterTest` is set to false then stubs will NOT be deleted after tests are executed

fixes gh-512
2018-03-16 01:08:37 +01:00
Marcin Grzejszczak
903094d8b4 Merge branch '1.2.x' 2018-03-15 17:14:04 +01:00
Marcin Grzejszczak
13902ecf1d Documented custom settings.xml setup; fixes gh-552 2018-03-15 17:13:51 +01:00
Marcin Grzejszczak
05d4bb3a57 Merge branch '1.2.x' 2018-03-15 16:43:42 +01:00
Marcin Grzejszczak
8fa57f5832 Added additional tests 2018-03-15 16:43:32 +01:00
Marcin Grzejszczak
b43204fb82 Merge branch '1.2.x' 2018-03-15 14:56:04 +01:00
Marcin Grzejszczak
08025963a8 Docker images built only in integration mode (to speed up build) 2018-03-15 14:55:45 +01:00
Marcin Grzejszczak
c33ad02550 Added support for Docker and external contracts repo
These environment variables are used when contracts lay in an external repository. To enable
this feature you must set the `EXTERNAL_CONTRACTS_ARTIFACT_ID` environment variable.

- `EXTERNAL_CONTRACTS_GROUP_ID` - group id of the project with contracts. Defaults to `com.example`
- `EXTERNAL_CONTRACTS_ARTIFACT_ID`- artifact id of the project with contracts.
- `EXTERNAL_CONTRACTS_CLASSIFIER`- classifier of the project with contracts. Empty by default
- `EXTERNAL_CONTRACTS_VERSION` - version of the project with contracts. Defaults to `+`, equivalent to picking the latest
- `EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL` - URL of your Artifact Manager. Defaults to value of `REPO_WITH_BINARIES_URL` env var.
If that's not set, defaults to `http://localhost:8081/artifactory/libs-release-local`
which is the default URL of https://jfrog.com/artifactory/[Artifactory] running locally
- `EXTERNAL_CONTRACTS_PATH` - path to contracts for the given project, inside the project with contracts.
Defaults to slash separated `EXTERNAL_CONTRACTS_GROUP_ID` concatenated with `/` and `EXTERNAL_CONTRACTS_ARTIFACT_ID`. E.g.
for group id `foo.bar` and artifact id `baz`, would result in `foo/bar/baz` contracts path.
- `EXTERNAL_CONTRACTS_WORK_OFFLINE` - if set to `true` then will retrieve artifact with contracts
from the container's `.m2`. Mount your local `.m2` as a volume available at the container's `/root/.m2` path.
You must not set both `EXTERNAL_CONTRACTS_WORK_OFFLINE` and `EXTERNAL_CONTRACTS_REPO_WITH_BINARIES_URL`.

fixes gh-576
2018-03-15 14:48:28 +01:00
Marcin Grzejszczak
8e4360535c Added HttpStatus delegate in the Groovy DSL Response
with this change there are numerous helper methods that should provide a more descriptive DSL for the response status. Instead of a numerical status you can now call a method e.g. instead of 200 call OK()

fixes gh-575
2018-03-15 10:00:45 +01:00
Axel Hodler
f31e9ba137 Added anyDouble DslProperty (#571) 2018-03-14 21:07:20 +01:00
Marcin Grzejszczak
cd51d09ec4 Merge branch '1.2.x' 2018-03-13 18:07:16 +01:00
Marcin Grzejszczak
38cb54eab2 Added fast switch for circle 2018-03-13 18:05:36 +01:00
Marcin Grzejszczak
17c375a629 Updated docs to point to different branches 2018-03-13 17:51:08 +01:00
Marcin Grzejszczak
ab76b12edf Added one more ant pattern to gradle and maven plugins
The bug is related to the fact that initially, we were supporting slash-separated paths to projects. E.g. if the group id was `a.b.c` then we did checked for `a/b/c` folder. At certain point we've started building stubs with the `groupid` folder as such e.g. `a.b.c/artifact-id`. This is where the bug comes in. For Maven and Gradle we're using ant patterns for copying files. We're only providing the slash-separated ant pattern. With this fix, we're backward compatible (we're leaving the slash-separated one) and we're adding support for dot-delimited group id.

fixes gh-555
2018-03-13 17:51:08 +01:00
Marcin Grzejszczak
2740496d86 Added one more ant pattern to gradle and maven plugins
The bug is related to the fact that initially, we were supporting slash-separated paths to projects. E.g. if the group id was `a.b.c` then we did checked for `a/b/c` folder. At certain point we've started building stubs with the `groupid` folder as such e.g. `a.b.c/artifact-id`. This is where the bug comes in. For Maven and Gradle we're using ant patterns for copying files. We're only providing the slash-separated ant pattern. With this fix, we're backward compatible (we're leaving the slash-separated one) and we're adding support for dot-delimited group id.

fixes gh-555
2018-03-13 17:47:00 +01:00
Eddú Meléndez Gonzales
97a8e3c2f5 Add missing configuration properties metadata for stub-runner (#572)
See gh-566
2018-03-13 10:35:49 +01:00
Marcin Grzejszczak
d9739907ab Merge branch '1.2.x' 2018-03-13 10:34:56 +01:00