1
0

for now, make give all users the role of a HOSTMASTER

This commit is contained in:
Michael Hoennig
2019-04-25 12:56:51 +02:00
parent 3e30cf2d17
commit fb3b79cfc4
8 changed files with 48 additions and 17 deletions

View File

@ -21,7 +21,7 @@ public class JSonBuilder {
}
private static String inQuotes(Object value) {
return "\"" + value.toString() + "\"";
return value != null ? "\"" + value.toString() + "\"" : "null";
}
}

View File

@ -72,6 +72,20 @@ public class JSonDeserializerWithAccessFilterUnitTest {
given(jsonParser.getCodec()).willReturn(codec);
}
@Test
public void shouldDeserializeNullField() throws IOException {
// given
givenJSonTree(asJSon(
ImmutablePair.of("id", 1234L),
ImmutablePair.of("openStringField", null)));
// when
GivenDto actualDto = new JSonDeserializerWithAccessFilter<>(ctx, jsonParser, null, GivenDto.class).deserialize();
// then
assertThat(actualDto.openStringField).isNull();
}
@Test
public void shouldDeserializeStringField() throws IOException {
// given