[BAEL-14274] - Fixed article code for https://www.baeldung.com/jackson-ignore-null-fields
This commit is contained in:
parent
783a93fb47
commit
181f7fe8d4
|
@ -165,7 +165,7 @@ public class JacksonSerializationIgnoreUnitTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public final void givenIgnoringNullFieldsOnClass_whenWritingObjectWithNullField_thenFieldIsIgnored() throws JsonProcessingException {
|
||||
public final void givenNullsIgnoredOnClass_whenWritingObjectWithNullField_thenIgnored() throws JsonProcessingException {
|
||||
final ObjectMapper mapper = new ObjectMapper();
|
||||
final MyDtoIgnoreNull dtoObject = new MyDtoIgnoreNull();
|
||||
|
||||
|
@ -178,7 +178,7 @@ public class JacksonSerializationIgnoreUnitTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public final void givenIgnoringNullFieldsGlobally_whenWritingObjectWithNullField_thenIgnored() throws JsonProcessingException {
|
||||
public final void givenNullsIgnoredGlobally_whenWritingObjectWithNullField_thenIgnored() throws JsonProcessingException {
|
||||
final ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.setSerializationInclusion(Include.NON_NULL);
|
||||
final MyDto dtoObject = new MyDto();
|
||||
|
|
Loading…
Reference in New Issue