99
1010import  org .junit .jupiter .api .Test ;
1111
12- import  tools .jackson .databind .DeserializationFeature ;
1312import  tools .jackson .databind .ObjectReader ;
14- 
13+ import   tools . jackson . databind . cfg . DateTimeFeature ; 
1514import  tools .jackson .dataformat .ion .IonObjectMapper ;
1615
1716import  static  java .time .ZoneOffset .UTC ;
@@ -97,7 +96,7 @@ public void testDeserializationAsFloat03NonUTCDefault() throws Exception {
9796    public  void  testDeserializationAsInt01Nanoseconds () throws  Exception  {
9897        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (0L ), UTC );
9998        OffsetDateTime  actual  = READER_UTC_DEFAULT 
100-                 .with (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
99+                 .with (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
101100                .readValue ("0" );
102101
103102        assertEquals (expected , actual , "The value is not correct." );
@@ -107,7 +106,7 @@ public void testDeserializationAsInt01Nanoseconds() throws Exception {
107106    public  void  testDeserializationAsInt01NanosecondsNonUTCDefault () throws  Exception  {
108107        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (0L ), Z1 );
109108        OffsetDateTime  actual  = READER_Z1_DEFAULT 
110-                 .with (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
109+                 .with (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
111110                .readValue ("0" );
112111
113112        assertEquals (expected , actual , "The value is not correct." );
@@ -117,7 +116,7 @@ public void testDeserializationAsInt01NanosecondsNonUTCDefault() throws Exceptio
117116    public  void  testDeserializationAsInt02Nanoseconds () throws  Exception  {
118117        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L ), UTC );
119118        OffsetDateTime  actual  = READER_UTC_DEFAULT 
120-                 .with (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
119+                 .with (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
121120                .readValue ("123456789" );
122121
123122        assertEquals (expected , actual , "The value is not correct." );
@@ -127,7 +126,7 @@ public void testDeserializationAsInt02Nanoseconds() throws Exception {
127126    public  void  testDeserializationAsInt02NanosecondsNonUTCDefault () throws  Exception  {
128127        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L ), Z1 );
129128        OffsetDateTime  actual  = READER_Z1_DEFAULT 
130-                 .with (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
129+                 .with (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
131130                .readValue ("123456789" );
132131
133132        assertEquals (expected , actual , "The value is not correct." );
@@ -138,7 +137,7 @@ public void testDeserializationAsInt03Nanoseconds() throws Exception {
138137        Instant  now  = Instant .now ();
139138        OffsetDateTime  expected  = OffsetDateTime .ofInstant (now , UTC ).truncatedTo (ChronoUnit .SECONDS );
140139        OffsetDateTime  actual  = READER_UTC_DEFAULT 
141-                 .with (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
140+                 .with (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
142141                .readValue (Long .toString (now .getEpochSecond ()));
143142
144143        assertEquals (expected , actual , "The value is not correct." );
@@ -149,7 +148,7 @@ public void testDeserializationAsInt03NanosecondsNonUTCDefault() throws Exceptio
149148        Instant  now  = Instant .now ();
150149        OffsetDateTime  expected  = OffsetDateTime .ofInstant (now , Z1 ).truncatedTo (ChronoUnit .SECONDS );
151150        OffsetDateTime  actual  = READER_Z1_DEFAULT 
152-                 .with (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
151+                 .with (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
153152                .readValue (Long .toString (now .getEpochSecond ()));
154153
155154        assertEquals (expected , actual , "The value is not correct." );
@@ -159,7 +158,7 @@ public void testDeserializationAsInt03NanosecondsNonUTCDefault() throws Exceptio
159158    public  void  testDeserializationAsInt01Milliseconds () throws  Exception  {
160159        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (0L ), UTC );
161160        OffsetDateTime  actual  = READER_UTC_DEFAULT 
162-                 .without (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
161+                 .without (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
163162                .readValue ("0" );
164163
165164        assertEquals (expected , actual , "The value is not correct." );
@@ -169,7 +168,7 @@ public void testDeserializationAsInt01Milliseconds() throws Exception {
169168    public  void  testDeserializationAsInt01MillisecondsNonUTCDefault () throws  Exception  {
170169        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (0L ), Z1 );
171170        OffsetDateTime  actual  = READER_Z1_DEFAULT 
172-                 .without (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
171+                 .without (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
173172                .readValue ("0" );
174173
175174        assertEquals (expected , actual , "The value is not correct." );
@@ -179,7 +178,7 @@ public void testDeserializationAsInt01MillisecondsNonUTCDefault() throws Excepti
179178    public  void  testDeserializationAsInt02Milliseconds () throws  Exception  {
180179        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L , 422000000 ), UTC );
181180        OffsetDateTime  actual  = READER_UTC_DEFAULT 
182-                 .without (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
181+                 .without (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
183182                .readValue ("123456789422" );
184183
185184        assertEquals (expected , actual , "The value is not correct." );
@@ -189,7 +188,7 @@ public void testDeserializationAsInt02Milliseconds() throws Exception {
189188    public  void  testDeserializationAsInt02MillisecondsNonUTCDefault () throws  Exception  {
190189        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L , 422000000 ), Z1 );
191190        OffsetDateTime  actual  = READER_Z1_DEFAULT 
192-                 .without (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
191+                 .without (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
193192                .readValue ("123456789422" );
194193
195194        assertEquals (expected , actual , "The value is not correct." );
@@ -200,7 +199,7 @@ public void testDeserializationAsInt03Milliseconds() throws Exception {
200199        Instant  now  = Instant .now ();
201200        OffsetDateTime  expected  = OffsetDateTime .ofInstant (now , UTC ).truncatedTo (ChronoUnit .MILLIS );
202201        OffsetDateTime  actual  = READER_UTC_DEFAULT 
203-                 .without (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
202+                 .without (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
204203                .readValue (Long .toString (now .toEpochMilli ()));
205204
206205        assertEquals (expected , actual , "The value is not correct." );
@@ -211,7 +210,7 @@ public void testDeserializationAsInt03MillisecondsNonUTCDefault() throws Excepti
211210        Instant  now  = Instant .now ();
212211        OffsetDateTime  expected  = OffsetDateTime .ofInstant (now , Z1 ).truncatedTo (ChronoUnit .MILLIS );
213212        OffsetDateTime  actual  = READER_Z1_DEFAULT 
214-                 .without (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
213+                 .without (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
215214                .readValue (Long .toString (now .toEpochMilli ()));
216215
217216        assertEquals (expected , actual , "The value is not correct." );
@@ -298,7 +297,7 @@ public void testDeserializationWithTypeInfo01() throws Exception {
298297        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L , 183917322 ), UTC );
299298
300299        IonObjectMapper  m  = newMapperBuilder ()
301-                 .enable (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
300+                 .enable (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
302301                .addMixIn (Temporal .class , MockObjectConfiguration .class )
303302                .build ();
304303
@@ -313,7 +312,7 @@ public void testDeserializationWithTypeInfo01NonUTCDefault() throws Exception {
313312
314313        IonObjectMapper  m  = newMapperBuilder ()
315314                .defaultTimeZone (TimeZone .getTimeZone (Z1 ))
316-                 .enable (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
315+                 .enable (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
317316                .addMixIn (Temporal .class , MockObjectConfiguration .class )
318317                .build ();
319318
@@ -327,7 +326,7 @@ public void testDeserializationWithTypeInfo02() throws Exception {
327326        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L , 0 ), UTC );
328327
329328        IonObjectMapper  m  = newMapperBuilder ()
330-                 .enable (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
329+                 .enable (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
331330                .addMixIn (Temporal .class , MockObjectConfiguration .class )
332331                .build ();
333332
@@ -342,7 +341,7 @@ public void testDeserializationWithTypeInfo02NonUTCDefault() throws Exception {
342341
343342        IonObjectMapper  m  = newMapperBuilder ()
344343                .defaultTimeZone (TimeZone .getTimeZone (Z1 ))
345-                 .enable (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
344+                 .enable (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
346345                .addMixIn (Temporal .class , MockObjectConfiguration .class )
347346                .build ();
348347
@@ -356,7 +355,7 @@ public void testDeserializationWithTypeInfo03() throws Exception {
356355        OffsetDateTime  expected  = OffsetDateTime .ofInstant (Instant .ofEpochSecond (123456789L , 422000000 ), UTC );
357356
358357        IonObjectMapper  m  = newMapperBuilder ()
359-                 .disable (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
358+                 .disable (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
360359                .addMixIn (Temporal .class , MockObjectConfiguration .class )
361360                .build ();
362361
@@ -371,7 +370,7 @@ public void testDeserializationWithTypeInfo03NonUTCDefault() throws Exception {
371370
372371        IonObjectMapper  m  = newMapperBuilder ()
373372                .defaultTimeZone (TimeZone .getTimeZone (Z1 ))
374-                 .disable (DeserializationFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
373+                 .disable (DateTimeFeature .READ_DATE_TIMESTAMPS_AS_NANOSECONDS )
375374                .addMixIn (Temporal .class , MockObjectConfiguration .class )
376375                .build ();
377376
0 commit comments