File tree Expand file tree Collapse file tree
gson/src/test/java/org/baeldung/gson/serialization/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,22 +72,22 @@ public void givenDate_whenSerializing_thenCorrect() {
7272 String jsonDate = gson .toJson (sourceDate , sourceDateType );
7373 // test
7474 System .out .println ("jsonDate:\n " + jsonDate );
75- String estimatedResult = "\" Jan 1, 1970 3:16:40 AM\" " ;
76- assertTrue (jsonDate .equals (estimatedResult ));
75+ String expectedResult = "\" Jan 1, 1970 3:16:40 AM\" " ;
76+ assertTrue (jsonDate .equals (expectedResult ));
7777 }
7878
7979 @ Test
80- public void givenUsingCustomDeserializer_whenFieldNotMatchesCriteria_thenIgnoringIt () {
80+ public void givenUsingCustomDeserializer_whenFieldNotMatchesCriteria_thenIgnored () {
8181 SourceClass sourceObject = new SourceClass (-1 , "minus 1" );
8282 GsonBuilder gsonBuildr = new GsonBuilder ();
8383 gsonBuildr .registerTypeAdapter (SourceClass .class , new IgnoringFieldsNotMatchingCriteriaSerializer ());
8484 Gson gson = gsonBuildr .create ();
8585 Type sourceObjectType = new TypeToken <SourceClass >() {
8686 }.getType ();
8787 String jsonString = gson .toJson (sourceObject , sourceObjectType );
88- // test
89- String estimatedResult = "{\" stringValue\" :\" minus 1\" }" ;
90- assertEquals (estimatedResult , jsonString );
88+
89+ String expectedResult = "{\" stringValue\" :\" minus 1\" }" ;
90+ assertEquals (expectedResult , jsonString );
9191 }
9292
9393}
You can’t perform that action at this time.
0 commit comments