From 52a6046e45a3d4811952d07ca448645a2b7de72a Mon Sep 17 00:00:00 2001 From: eugenp Date: Sun, 5 Jan 2014 23:02:40 +0200 Subject: [PATCH] minor cleanup work --- .../baeldung/jackson/test/JacksonSerializationUnitTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jackson/src/test/java/org/baeldung/jackson/test/JacksonSerializationUnitTest.java b/jackson/src/test/java/org/baeldung/jackson/test/JacksonSerializationUnitTest.java index e348e60de3..f510bd93da 100644 --- a/jackson/src/test/java/org/baeldung/jackson/test/JacksonSerializationUnitTest.java +++ b/jackson/src/test/java/org/baeldung/jackson/test/JacksonSerializationUnitTest.java @@ -40,7 +40,7 @@ public class JacksonSerializationUnitTest { } @Test - public final void givenNameOfFieldIsChanged_whenSerializing_thenCorrect() throws JsonParseException, IOException { + public final void givenNameOfFieldIsChangedViaAnnotationOnGetter_whenSerializing_thenCorrect() throws JsonParseException, IOException { final ObjectMapper mapper = new ObjectMapper(); final MyDtoFieldNameChanged dtoObject = new MyDtoFieldNameChanged(); dtoObject.setStringValue("a"); @@ -52,6 +52,8 @@ public class JacksonSerializationUnitTest { System.out.println(dtoAsString); } + // tests - serialize via accessors/fields + @Test(expected = JsonMappingException.class) public final void givenObjectHasNoAccessors_whenSerializing_thenException() throws JsonParseException, IOException { final String dtoAsString = new ObjectMapper().writeValueAsString(new MyDtoNoAccessors());