From ee27f3d75aa4299f26cc9d76de138e2094046f81 Mon Sep 17 00:00:00 2001 From: eugenp Date: Thu, 11 Sep 2014 18:41:00 +0300 Subject: [PATCH] small gson test changes --- .../serialization/test/GsonSerializationTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gson/src/test/java/org/baeldung/gson/serialization/test/GsonSerializationTest.java b/gson/src/test/java/org/baeldung/gson/serialization/test/GsonSerializationTest.java index a7ad7b67fa..1c23a072f3 100644 --- a/gson/src/test/java/org/baeldung/gson/serialization/test/GsonSerializationTest.java +++ b/gson/src/test/java/org/baeldung/gson/serialization/test/GsonSerializationTest.java @@ -72,12 +72,12 @@ public class GsonSerializationTest { String jsonDate = gson.toJson(sourceDate, sourceDateType); // test System.out.println("jsonDate:\n" + jsonDate); - String estimatedResult = "\"Jan 1, 1970 3:16:40 AM\""; - assertTrue(jsonDate.equals(estimatedResult)); + String expectedResult = "\"Jan 1, 1970 3:16:40 AM\""; + assertTrue(jsonDate.equals(expectedResult)); } @Test - public void givenUsingCustomDeserializer_whenFieldNotMatchesCriteria_thenIgnoringIt() { + public void givenUsingCustomDeserializer_whenFieldNotMatchesCriteria_thenIgnored() { SourceClass sourceObject = new SourceClass(-1, "minus 1"); GsonBuilder gsonBuildr = new GsonBuilder(); gsonBuildr.registerTypeAdapter(SourceClass.class, new IgnoringFieldsNotMatchingCriteriaSerializer()); @@ -85,9 +85,9 @@ public class GsonSerializationTest { Type sourceObjectType = new TypeToken() { }.getType(); String jsonString = gson.toJson(sourceObject, sourceObjectType); - // test - String estimatedResult = "{\"stringValue\":\"minus 1\"}"; - assertEquals(estimatedResult, jsonString); + + String expectedResult = "{\"stringValue\":\"minus 1\"}"; + assertEquals(expectedResult, jsonString); } } \ No newline at end of file