Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Dec 12, 2023
1 parent 2c932f0 commit 8e59346
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public void testDeserializationOk() throws Exception
result = MAPPER.readValue(quote("localhost:7070"), HostAndPort.class);
assertEquals("localhost", result.getHost());
assertEquals(7070, result.getPort());

assertNull(MAPPER.readValue("null", HostAndPort.class));

// Null values lead to "empty" Value
result = MAPPER.readValue("{\"host\": null}", HostAndPort.class);
assertEquals(HostAndPort.fromHost(""), result);
}

public void testDeserializationFail() throws Exception
Expand All @@ -50,9 +56,5 @@ public void testDeserializationFail() throws Exception
verifyException(e, "Cannot deserialize");
verifyException(e, "from Array value");
}

// Null values lead to "empty" Value
result = MAPPER.readValue("{\"host\": null}", HostAndPort.class);
assertEquals(HostAndPort.fromHost(""), result);
}
}

0 comments on commit 8e59346

Please sign in to comment.