The converted body looks different when done via the String notation than it does when done via a map notation. When working with String body and when matchers are provided, even when all entries of a map / list got removed, the map / list itself remains. That leads to unnecessary creation of checks for empty collection. With this method we're checking if the JSON path matcher is related to array checking and we're trying to remove that trailing collection. All in all it's better to use the Groovy based notation for defining body...
fixes#391
without this change in the generated test when SpringCloudContractAssertions are used the compiler is picking an invalid type of Assertj Assertions.
with this change we're explicitly casting to the appropriate interface so that the SpringCloudContractAssertions methods are picked
fixes#381
without this change in the generated test when SpringCloudContractAssertions are used, we're casting the read element of the JSON to a Collection class whereas we should be casting to an Iterable.
fixes#381
without this change the value of `spring.cloud.contract.verifier.http.port` gets executed via the `httpPort` method in options builder. The problem is that this method applies the port to the previously started stub. In this case we're not providing any stubs explicitly thus things don't work as they should.
with this change we reuse the min / max port mechanism to limit the range of port to the provided http port
fixes#384
without this change we always set the default value of the package with generated tests, unless a value overrides it.
with this change the flow for setting the generated tests package name will look like this:
- pick basePackageForTests
- if basePackageForTests wasn't set pick the package from baseClassForTests
- if baseClassForTests wasn't set pick packageWithBaseClasses
- if nothing got set pick the default org.springframework.cloud.contract.verifier.tests
The rationale behind this change is such that often in the base class you would like to have package scoped methods and the fact that the tests are always generated in the default location requires to make these methods public or always override this property.
fixes#260
without this change the `org.springframework.cloud.contract.verifier.assertion.SpringCloudContractAssertions.assertThat` was missing in Spock tests
with this change it is added and matchers work fine again
fixes#382