@Test
public void testJsonEncode()
throws Exception
{
ServiceAnnouncement serviceAnnouncement = serviceAnnouncement("foo")
.addProperty("http", "http://localhost:8080")
.addProperty("jmx", "jmx://localhost:1234")
.build();
Map<String, Object> actual = objectCodec.fromJson(serviceAnnouncementCodec.toJson(serviceAnnouncement));
String json = Resources.toString(Resources.getResource("service-announcement.json"), Charsets.UTF_8);
Map<String, Object> expected = objectCodec.fromJson(json);
// set id in expected
expected.put("id", serviceAnnouncement.getId().toString());
assertEquals(actual, expected);
}