55
66import org .junit .jupiter .api .Test ;
77
8- import tools .jackson .databind .SerializationFeature ;
8+ import tools .jackson .databind .cfg . DateTimeFeature ;
99import tools .jackson .dataformat .ion .IonObjectMapper ;
1010
1111import static org .junit .jupiter .api .Assertions .assertEquals ;
@@ -25,8 +25,8 @@ private IonObjectMapper.Builder newMapperBuilder() {
2525 @ Test
2626 public void testSerializationAsTimestamp01Nanoseconds () throws Exception {
2727 IonObjectMapper mapper = newMapperBuilder ()
28- .enable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
29- .enable (SerializationFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
28+ .enable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
29+ .enable (DateTimeFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
3030 .build ();
3131
3232 OffsetDateTime date = OffsetDateTime .ofInstant (Instant .ofEpochSecond (0L ), Z1 );
@@ -37,8 +37,8 @@ public void testSerializationAsTimestamp01Nanoseconds() throws Exception {
3737 @ Test
3838 public void testSerializationAsTimestamp01Milliseconds () throws Exception {
3939 IonObjectMapper mapper = newMapperBuilder ()
40- .enable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
41- .disable (SerializationFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
40+ .enable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
41+ .disable (DateTimeFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
4242 .build ();
4343
4444 OffsetDateTime date = OffsetDateTime .ofInstant (Instant .ofEpochSecond (0L ), Z1 );
@@ -49,8 +49,8 @@ public void testSerializationAsTimestamp01Milliseconds() throws Exception {
4949 @ Test
5050 public void testSerializationAsTimestamp02Nanoseconds () throws Exception {
5151 IonObjectMapper mapper = newMapperBuilder ()
52- .enable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
53- .enable (SerializationFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
52+ .enable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
53+ .enable (DateTimeFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
5454 .build ();
5555
5656 OffsetDateTime date = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L , 183917322 ), Z2 );
@@ -61,8 +61,8 @@ public void testSerializationAsTimestamp02Nanoseconds() throws Exception {
6161 @ Test
6262 public void testSerializationAsTimestamp02Milliseconds () throws Exception {
6363 IonObjectMapper mapper = newMapperBuilder ()
64- .enable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
65- .disable (SerializationFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
64+ .enable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
65+ .disable (DateTimeFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
6666 .build ();
6767
6868 OffsetDateTime date = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L , 183917322 ), Z2 );
@@ -73,8 +73,8 @@ public void testSerializationAsTimestamp02Milliseconds() throws Exception {
7373 @ Test
7474 public void testSerializationAsTimestamp03Nanoseconds () throws Exception {
7575 IonObjectMapper mapper = newMapperBuilder ()
76- .enable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
77- .enable (SerializationFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
76+ .enable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
77+ .enable (DateTimeFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
7878 .build ();
7979
8080 OffsetDateTime date = OffsetDateTime .now (Z3 );
@@ -85,8 +85,8 @@ public void testSerializationAsTimestamp03Nanoseconds() throws Exception {
8585 @ Test
8686 public void testSerializationAsTimestamp03Milliseconds () throws Exception {
8787 IonObjectMapper mapper = newMapperBuilder ()
88- .enable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
89- .disable (SerializationFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
88+ .enable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
89+ .disable (DateTimeFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
9090 .build ();
9191
9292 OffsetDateTime date = OffsetDateTime .now (Z3 );
@@ -98,7 +98,7 @@ public void testSerializationAsTimestamp03Milliseconds() throws Exception {
9898 public void testSerializationAsString01 () throws Exception {
9999 OffsetDateTime date = OffsetDateTime .ofInstant (Instant .ofEpochSecond (0L ), Z1 );
100100 IonObjectMapper mapper = newMapperBuilder ()
101- .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
101+ .disable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
102102 .build ();
103103
104104 String value = mapper .writeValueAsString (date );
@@ -110,7 +110,7 @@ public void testSerializationAsString01() throws Exception {
110110 public void testSerializationAsString02 () throws Exception {
111111 OffsetDateTime date = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L , 183917322 ), Z2 );
112112 IonObjectMapper mapper = newMapperBuilder ()
113- .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
113+ .disable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
114114 .build ();
115115
116116 String value = mapper .writeValueAsString (date );
@@ -122,7 +122,7 @@ public void testSerializationAsString02() throws Exception {
122122 public void testSerializationAsString03 () throws Exception {
123123 OffsetDateTime date = OffsetDateTime .now (Z3 );
124124 IonObjectMapper mapper = newMapperBuilder ()
125- .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
125+ .disable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
126126 .build ();
127127
128128 String value = mapper .writeValueAsString (date );
@@ -135,8 +135,8 @@ public void testSerializationWithTypeInfo01() throws Exception {
135135 OffsetDateTime date = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L , 183917322 ), Z2 );
136136 IonObjectMapper mapper = newMapperBuilder ()
137137 .addMixIn (Temporal .class , MockObjectConfiguration .class )
138- .enable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
139- .enable (SerializationFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
138+ .enable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
139+ .enable (DateTimeFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
140140 .build ();
141141
142142 String value = mapper .writeValueAsString (date );
@@ -149,8 +149,8 @@ public void testSerializationWithTypeInfo02() throws Exception {
149149 OffsetDateTime date = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L , 183917322 ), Z2 );
150150 IonObjectMapper mapper = newMapperBuilder ()
151151 .addMixIn (Temporal .class , MockObjectConfiguration .class )
152- .enable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
153- .disable (SerializationFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
152+ .enable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
153+ .disable (DateTimeFeature .WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS )
154154 .build ();
155155
156156 String value = mapper .writeValueAsString (date );
@@ -163,7 +163,7 @@ public void testSerializationWithTypeInfo03() throws Exception {
163163 OffsetDateTime date = OffsetDateTime .now (Z3 );
164164 IonObjectMapper mapper = newMapperBuilder ()
165165 .addMixIn (Temporal .class , MockObjectConfiguration .class )
166- .disable (SerializationFeature .WRITE_DATES_AS_TIMESTAMPS )
166+ .disable (DateTimeFeature .WRITE_DATES_AS_TIMESTAMPS )
167167 .build ();
168168
169169 String value = mapper .writeValueAsString (date );
0 commit comments