mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-29 10:50:33 +00:00
Downgrade to JSONassert 1.5.x
Closes gh-34901
This commit is contained in:
@@ -137,7 +137,7 @@ dependencies {
|
||||
api("org.reactivestreams:reactive-streams:1.0.4")
|
||||
api("org.seleniumhq.selenium:htmlunit3-driver:4.36.1")
|
||||
api("org.seleniumhq.selenium:selenium-java:4.36.0")
|
||||
api("org.skyscreamer:jsonassert:2.0-rc1")
|
||||
api("org.skyscreamer:jsonassert:1.5.3")
|
||||
api("org.testng:testng:7.11.0")
|
||||
api("org.webjars:underscorejs:1.8.3")
|
||||
api("org.webjars:webjars-locator-lite:1.1.0")
|
||||
|
||||
+4
-3
@@ -18,6 +18,7 @@ package org.springframework.http.converter.json;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.skyscreamer.jsonassert.JSONAssert;
|
||||
import tools.jackson.databind.ObjectMapper;
|
||||
@@ -42,7 +43,7 @@ class ProblemDetailJacksonMixinTests {
|
||||
|
||||
|
||||
@Test
|
||||
void writeStatusAndHeaders() {
|
||||
void writeStatusAndHeaders() throws Exception {
|
||||
ProblemDetail detail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, "Missing header");
|
||||
testWrite(detail,
|
||||
"""
|
||||
@@ -54,7 +55,7 @@ class ProblemDetailJacksonMixinTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void writeCustomProperty() {
|
||||
void writeCustomProperty() throws Exception {
|
||||
ProblemDetail detail = ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, "Missing header");
|
||||
detail.setProperty("host", "abc.org");
|
||||
detail.setProperty("user", null);
|
||||
@@ -109,7 +110,7 @@ class ProblemDetailJacksonMixinTests {
|
||||
assertThat(detail.getProperties()).containsEntry("host", "abc.org");
|
||||
}
|
||||
|
||||
private void testWrite(ProblemDetail problemDetail, String expected) {
|
||||
private void testWrite(ProblemDetail problemDetail, String expected) throws JSONException {
|
||||
String output = this.mapper.writeValueAsString(problemDetail);
|
||||
JSONAssert.assertEquals(expected, output, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user