Bumped jsonassert to 0.4.11

fixes gh-538, gh-537
This commit is contained in:
Marcin Grzejszczak
2018-02-05 14:48:04 +01:00
parent 3ee5c4c308
commit 83e304008e
9 changed files with 34 additions and 7 deletions

View File

@@ -15,7 +15,7 @@
<description>Spring Cloud Contract Dependencies</description>
<properties>
<wiremock.version>2.14.0</wiremock.version>
<jsonassert.version>0.4.10</jsonassert.version>
<jsonassert.version>0.4.11</jsonassert.version>
<aether.version>1.0.2.v20150114</aether.version>
</properties>
<dependencyManagement>

View File

@@ -14,6 +14,6 @@
# limitations under the License.
#
wiremockVersion=2.14.0
jsonAssertVersion=0.4.10
jsonAssertVersion=0.4.11
verifierVersion=1.2.3.BUILD-SNAPSHOT

View File

@@ -14,5 +14,5 @@
# limitations under the License.
#
wiremockVersion=2.14.0
jsonAssertVersion=0.4.10
jsonAssertVersion=0.4.11
verifierVersion=1.2.3.BUILD-SNAPSHOT

View File

@@ -14,5 +14,5 @@
# limitations under the License.
#
wiremockVersion=2.14.0
jsonAssertVersion=0.4.10
jsonAssertVersion=0.4.11
verifierVersion=1.2.3.BUILD-SNAPSHOT

View File

@@ -14,6 +14,6 @@
# limitations under the License.
#
wiremockVersion=2.14.0
jsonAssertVersion=0.4.10
jsonAssertVersion=0.4.11
verifierVersion=1.2.3.BUILD-SNAPSHOT

View File

@@ -63,7 +63,7 @@
<dependency>
<groupId>com.toomuchcoding.jsonassert</groupId>
<artifactId>jsonassert</artifactId>
<version>0.4.10</version>
<version>0.4.11</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -62,7 +62,7 @@
<dependency>
<groupId>com.toomuchcoding.jsonassert</groupId>
<artifactId>jsonassert</artifactId>
<version>0.4.10</version>
<version>0.4.11</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -201,6 +201,14 @@ class DelegatingJsonVerifiable implements MethodBufferingJsonVerifiable {
return readyToCheck;
}
@Override public JsonVerifiable isInstanceOf(Class clazz)
throws IllegalStateException {
DelegatingJsonVerifiable readyToCheck = new FinishedDelegatingJsonVerifiable(
this.delegate.jsonPath(), this.delegate.isInstanceOf(clazz), this.methodsBuffer);
readyToCheck.methodsBuffer.offer(".isInstanceOf(" + clazz.getName() + ")");
return readyToCheck;
}
@Override
public MethodBufferingJsonVerifiable matches(String value) {
DelegatingJsonVerifiable readyToCheck = new FinishedDelegatingJsonVerifiable(

View File

@@ -0,0 +1,19 @@
package org.springframework.cloud.contract.verifier.builder;
import com.jayway.jsonpath.DocumentContext;
import com.jayway.jsonpath.JsonPath;
import org.junit.Test;
import static com.toomuchcoding.jsonassert.JsonAssertion.assertThatJson;
/**
* @author Marcin Grzejszczak
*/
public class JsonAssertTests {
// #537
@Test
public void should_compare_big_decimals() {
DocumentContext context = JsonPath.parse("{\"foo\": 55534673.56}");
assertThatJson(context).field("['foo']").isEqualTo(55534673.57);
}
}