22
33
44import org .junit .jupiter .api .Test ;
5+ import org .junitpioneer .jupiter .DefaultTimeZone ;
56import pmedit .serdes .SerDeslUtils ;
67
78import java .util .*;
89
910import static org .junit .jupiter .api .Assertions .*;
1011
12+ @ DefaultTimeZone ("UTC" )
1113public class SerDesTest {
1214 static final String ALL_NULLS_YAML =
1315 """
@@ -157,7 +159,7 @@ public void testToYaml() {
157159 md .doc .creationDate = new GregorianCalendar (2020 ,2 , 2 , 1 , 1 , 1 );
158160 String expected = ALL_NULLS_YAML
159161 .replace ("doc.author: null" , "doc.author: \" AUTHOR\" " )
160- .replace ("doc.creationDate: null" , "doc.creationDate: \" 2020-03-01T23 :01:01.000+00:00\" " );
162+ .replace ("doc.creationDate: null" , "doc.creationDate: \" 2020-03-02T01 :01:01.000+00:00\" " );
161163 assertEquals (expected , md .toYAML ());;
162164 }
163165
@@ -168,7 +170,7 @@ public void testFromYaml() {
168170 md .doc .creationDate = new GregorianCalendar (2020 ,2 , 2 , 1 , 1 , 1 );
169171 String yaml = ALL_NULLS_YAML
170172 .replace ("doc.author: null" , "doc.author: \" AUTHOR\" " )
171- .replace ("doc.creationDate: null" , "doc.creationDate: \" 2020-03-01T23 :01:01.000+00:00\" " );
173+ .replace ("doc.creationDate: null" , "doc.creationDate: \" 2020-03-02T01 :01:01.000+00:00\" " );
172174 MetadataInfo parsed = new MetadataInfo ();
173175 parsed .fromYAML (yaml );;
174176 assertTrue (md .isEquivalent (parsed ));
@@ -182,7 +184,7 @@ public void testToJson() {
182184 md .doc .creationDate = new GregorianCalendar (2020 ,2 , 2 , 1 , 1 , 1 );
183185 String expected = ALL_NULLS_JSON
184186 .replace ("\" doc.author\" : null" , "\" doc.author\" : \" AUTHOR\" " )
185- .replace ("\" doc.creationDate\" : null" , "\" doc.creationDate\" : \" 2020-03-01T23 :01:01.000+00:00\" " );
187+ .replace ("\" doc.creationDate\" : null" , "\" doc.creationDate\" : \" 2020-03-02T01 :01:01.000+00:00\" " );
186188 assertEquals (expected .trim (), md .toJson ().trim ());;
187189 }
188190
@@ -193,7 +195,7 @@ public void testFromJson() {
193195 md .doc .creationDate = new GregorianCalendar (2020 ,2 , 2 , 1 , 1 , 1 );
194196 String json = ALL_NULLS_JSON
195197 .replace ("\" doc.author\" : null" , "\" doc.author\" : \" AUTHOR\" " )
196- .replace ("\" doc.creationDate\" : null" , "\" doc.creationDate\" : \" 2020-03-01T23 :01:01.000+00:00\" " );
198+ .replace ("\" doc.creationDate\" : null" , "\" doc.creationDate\" : \" 2020-03-02T01 :01:01.000+00:00\" " );
197199 MetadataInfo parsed = new MetadataInfo ();
198200 parsed .fromJson (json );;
199201 assertTrue (md .isEquivalent (parsed ));
0 commit comments