@@ -24,18 +24,18 @@ public void givenCollection_whenSerializing_thenCorrect() {
2424 final String jsonCollection = new Gson ().toJson (sourceCollection , sourceCollectionType );
2525
2626 // test
27- final Collection < SourceClass > testCollection = new Gson (). fromJson ( jsonCollection , sourceCollectionType ) ;
28- assertEquals (sourceCollection , testCollection );
27+ final String estimatedResult = "[{ \" intValue \" :1, \" stringValue \" : \" one \" },{ \" intValue \" :2, \" stringValue \" : \" two \" }]" ;
28+ assertEquals (estimatedResult , jsonCollection );
2929 }
3030
3131 @ Test
32- public void givenArrayOfObjects_whenSerializing_thenMapToJsonCollection () {
32+ public void givenArrayOfObjects_whenSerializing_thenCorrect () {
3333 final SourceClass [] sourceArray = { new SourceClass (1 , "one" ), new SourceClass (2 , "two" ) };
34- final String jsonCollection = new Gson ().toJson (sourceArray );
34+ final String jsonString = new Gson ().toJson (sourceArray );
3535
3636 // test
3737 final String estimatedResult = "[{\" intValue\" :1,\" stringValue\" :\" one\" },{\" intValue\" :2,\" stringValue\" :\" two\" }]" ;
38- assertEquals (estimatedResult , jsonCollection );
38+ assertEquals (estimatedResult , jsonString );
3939 }
4040
4141 @ Test
@@ -73,7 +73,7 @@ public void givenDate_whenSerializing_thenCorrect() {
7373 final String jsonDate = gson .toJson (sourceDate , sourceDateType );
7474
7575 // test
76- final Date testDate = gson . fromJson ( jsonDate , sourceDateType ) ;
77- assertTrue (sourceDate .equals (testDate ));
76+ final String estimatedResult = " \" Jan 1, 1970 3:16:40 AM \" " ;
77+ assertTrue (jsonDate .equals (estimatedResult ));
7878 }
7979}
0 commit comments