File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
main/java/io/kubernetes/client/openapi
test/java/io/kubernetes/client/openapi Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ public class JSON {
45
45
46
46
private boolean isLenientOnJson = false ;
47
47
48
- public static final DateTimeFormatter RFC3339MICRO_FORMATTER =
48
+ private static final DateTimeFormatter RFC3339MICRO_FORMATTER =
49
49
new DateTimeFormatterBuilder ()
50
50
.parseDefaulting (ChronoField .OFFSET_SECONDS , 0 )
51
51
.append (DateTimeFormatter .ofPattern ("yyyy-MM-dd'T'HH:mm:ss" ))
Original file line number Diff line number Diff line change @@ -67,9 +67,10 @@ public void testOffsetDateTime1e3Parse() {
67
67
68
68
@ Test
69
69
public void testOffsetDateTimeNoFractionParse () {
70
- String timeStr = "2018-04-03T11:32:26Z" ;
71
- OffsetDateTime t = OffsetDateTime .parse (timeStr , JSON .RFC3339MICRO_FORMATTER );
72
- String serializedTsStr = JSON .RFC3339MICRO_FORMATTER .format (t );
73
- assertEquals ("2018-04-03T11:32:26.000000Z" , serializedTsStr );
70
+ String timeStr = "\" 2018-04-03T11:32:26Z\" " ;
71
+ OffsetDateTime dateTime = json .deserialize (timeStr , OffsetDateTime .class );
72
+ String serializedTsStr = json .serialize (dateTime );
73
+ String expectedStr = "\" 2018-04-03T11:32:26.000000Z\" " ;
74
+ assertEquals (expectedStr , serializedTsStr );
74
75
}
75
76
}
You can’t perform that action at this time.
0 commit comments