fail("Should not throw an exception even if the setter does not exist");
}
}
@Test
public void whenAttemptingToSetANullValue_ThenShouldNotCallTheSetter() throws Exception {
<BUG>ObjectMapper mapper = new ObjectMapper(Person.class);
</BUG>
Map<String, String> values = new HashMap<>();
values.put("age", null);
<BUG>Person person = (Person) mapper.mapObject(values);
assertThat(person).isNotNull();</BUG>
assertThat(person.getAge()).isEqualTo(0);

fail("Should not throw an exception even if the setter does not exist");
}
}
@Test
public void whenAttemptingToSetANullValue_ThenShouldNotCallTheSetter() throws Exception {
ObjectMapper<Person> mapper = new ObjectMapper<>(Person.class);
Map<String, String> values = new HashMap<>();
values.put("age", null);
Person person = mapper.mapObject(values);
assertThat(person).isNotNull();
assertThat(person.getAge()).isEqualTo(0);
