restEasySingletons.serviceInstanceMarshallerSingleton.writeTo(service, null, null, null, null, null, out);
getJson("http://localhost:" + port + "/v1/service/test/" + service.getId(), new String(out.toByteArray()));
String json = getJson("http://localhost:" + port + "/v1/service", null);
ServiceNames names = restEasySingletons.serviceNamesMarshallerSingleton.readFrom(ServiceNames.class, null, null, MediaType.APPLICATION_JSON_TYPE, null, new ByteArrayInputStream(json.getBytes()));
Assert.assertEquals(names.getNames(), Lists.newArrayList("test"));
json = getJson("http://localhost:" + port + "/v1/service/test", null);
ServiceInstances<String> instances = restEasySingletons.serviceInstancesMarshallerSingleton.readFrom(null, null, null, null, null, new ByteArrayInputStream(json.getBytes()));
Assert.assertEquals(instances.getServices().size(), 1);
Assert.assertEquals(instances.getServices().get(0), service);