Skip to content

Commit e7b41bc

Browse files
committed
Use Apache Johnzon 1.1 for JSON-B integration tests
Issue: SPR-15590
1 parent 3cc94ae commit e7b41bc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,8 @@ project("spring-web") {
767767
testRuntime("com.sun.mail:javax.mail:${javamailVersion}")
768768
testRuntime("com.sun.xml.bind:jaxb-core:${jaxbVersion}")
769769
testRuntime("com.sun.xml.bind:jaxb-impl:${jaxbVersion}")
770+
testRuntime("javax.json:javax.json-api:1.1")
771+
testRuntime("org.apache.johnzon:johnzon-jsonb:1.1.0")
770772
}
771773
}
772774

spring-web/src/test/java/org/springframework/http/converter/json/JsonbHttpMessageConverterTests.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.List;
2525
import java.util.Map;
2626

27-
import org.junit.Ignore;
2827
import org.junit.Test;
2928

3029
import org.springframework.core.ParameterizedTypeReference;
@@ -36,9 +35,11 @@
3635
import static org.junit.Assert.*;
3736

3837
/**
38+
* Integration tests for the JSON Binding API, running against Apache Johnzon.
39+
*
3940
* @author Juergen Hoeller
41+
* @since 5.0
4042
*/
41-
@Ignore // until we are able to include Eclipse Yasson (the JSONB RI) in our build setup
4243
public class JsonbHttpMessageConverterTests {
4344

4445
private final JsonbHttpMessageConverter converter = new JsonbHttpMessageConverter();
@@ -133,7 +134,7 @@ public void writeUTF16() throws IOException {
133134
MockHttpOutputMessage outputMessage = new MockHttpOutputMessage();
134135
String body = "H\u00e9llo W\u00f6rld";
135136
this.converter.write(body, contentType, outputMessage);
136-
assertEquals("Invalid result", "\"" + body + "\"", outputMessage.getBodyAsString(StandardCharsets.UTF_16BE));
137+
assertEquals("Invalid result", body, outputMessage.getBodyAsString(StandardCharsets.UTF_16BE));
137138
assertEquals("Invalid content-type", contentType, outputMessage.getHeaders().getContentType());
138139
}
139140

0 commit comments

Comments
 (0)