|
|
|
@ -19,6 +19,7 @@ package org.springframework.boot.autoconfigure.jackson;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.text.DateFormat;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.time.Duration;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.Set;
|
|
|
|
@ -378,6 +379,15 @@ class JacksonAutoConfigurationTests {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void writeDurationAsTimestampsDefault() {
|
|
|
|
|
this.contextRunner.run((context) -> {
|
|
|
|
|
ObjectMapper mapper = context.getBean(ObjectMapper.class);
|
|
|
|
|
Duration duration = Duration.ofHours(2);
|
|
|
|
|
assertThat(mapper.writeValueAsString(duration)).isEqualTo("\"PT2H\"");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
void writeWithVisibility() {
|
|
|
|
|
this.contextRunner
|
|
|
|
|