@@ -262,9 +262,11 @@ class Jackson2JsonEncoderTests extends AbstractEncoderTests<Jackson2JsonEncoder>
|
||||
ObjectMapper mapper = new ObjectMapper().configure(SerializationFeature.INDENT_OUTPUT, true);
|
||||
this.encoder.registerObjectMappersForType(JacksonViewBean.class, map -> map.put(halMediaType, mapper));
|
||||
|
||||
String ls = System.lineSeparator(); // output below is different between Unix and Windows
|
||||
testEncode(Mono.just(jacksonValue), type, halMediaType, Collections.emptyMap(), step -> step
|
||||
.consumeNextWith(expectString("{" + ls + " \"withView1\" : \"with\"" + ls + "}"))
|
||||
.consumeNextWith(expectString("""
|
||||
{
|
||||
\s "withView1" : "with"
|
||||
}"""))
|
||||
.verifyComplete()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -63,8 +63,6 @@ import static org.assertj.core.api.Assertions.within;
|
||||
*/
|
||||
class MappingJackson2HttpMessageConverterTests {
|
||||
|
||||
protected static final String NEWLINE_SYSTEM_PROPERTY = System.lineSeparator();
|
||||
|
||||
private final MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
|
||||
|
||||
|
||||
@@ -369,8 +367,10 @@ class MappingJackson2HttpMessageConverterTests {
|
||||
this.converter.writeInternal(bean, null, outputMessage);
|
||||
String result = outputMessage.getBodyAsString(StandardCharsets.UTF_8);
|
||||
|
||||
assertThat(result).isEqualTo(("{" + NEWLINE_SYSTEM_PROPERTY +
|
||||
" \"name\" : \"Jason\"" + NEWLINE_SYSTEM_PROPERTY + "}"));
|
||||
assertThat(result).isEqualToNormalizingNewlines("""
|
||||
{
|
||||
\s "name" : "Jason"
|
||||
}""");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user