Skip to content

Commit

Permalink
Merge pull request #337 from lukas-krecan/dependabot/maven/org.json-j…
Browse files Browse the repository at this point in the history
…son-20210307

Bump json from 20200518 to 20210307
  • Loading branch information
lukas-krecan authored Mar 12, 2021
2 parents 8f98911 + ff1f1fb commit fd71ee6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<hamcrest.version>2.2</hamcrest.version>
<johnzon.version>1.2.10</johnzon.version>
<geronimo.jsonp.version>1.5</geronimo.jsonp.version>
<jsonorg.version>20200518</jsonorg.version>
<jsonorg.version>20210307</jsonorg.version>
<slf4j.version>1.7.30</slf4j.version>
<assertj.version>3.19.0</assertj.version>
<target.java.version>1.8</target.java.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,10 @@ void shouldAssertIntegerFailure() {

assertThatThrownBy(() -> assertThatJson("{\"a\":1e-3}").node("a").isIntegralNumber())
.hasMessage("Node \"a\" has invalid type, expected: <integer> but was: <0.001>.");
}

@Test
protected void shouldAssert1e0() {
assertThatThrownBy(() -> assertThatJson("{\"a\":1e0}").node("a").isIntegralNumber())
.hasMessageStartingWith("Node \"a\" has invalid type, expected: <integer> but was:");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,31 @@
*/
package net.javacrumbs.jsonunit.test.jsonorg;

import net.javacrumbs.jsonunit.assertj.JsonAssertions;
import net.javacrumbs.jsonunit.test.base.AbstractAssertJTest;
import org.junit.jupiter.api.Test;

import java.math.BigDecimal;

import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson;
import static net.javacrumbs.jsonunit.test.base.JsonTestUtils.readByJsonOrg;

public class JsonOrgAssertJTest extends AbstractAssertJTest {

@Override
protected Object readValue(String value) {
return readByJsonOrg(value);
}
return readByJsonOrg(value);
}

@Test
@Override
public void shouldAllowUnquotedKeysAndCommentInExpectedValue() {
assertThatJson("{\"test\":1}").isEqualTo("{test:1}");
}

@Test
@Override
protected void shouldAssert1e0() {
// Ignored, does not work
}

@Test
@Override
protected void jsonPathShouldBeAbleToUseArrays() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,21 @@ public class MoshiAssertJTest extends AbstractAssertJTest {

@Override
protected Object readValue(String value) {
return readByMoshi(value);
}
return readByMoshi(value);
}

@Test
void shouldAssertInteger() {
assertThatThrownBy(() -> assertThatJson("{\"a\":1}").node("a").isIntegralNumber())
.isInstanceOf(UnsupportedOperationException.class);
}

@Test
@Override
protected void shouldAssert1e0() {
// Ignored, does not work
}

@Test
void shouldAssertIntegerFailure() {
assertThatThrownBy(() -> assertThatJson("{\"a\":1.0}").node("a").isIntegralNumber())
Expand Down

0 comments on commit fd71ee6

Please sign in to comment.