ServiceDescriptor { @Override public String toString() { return toStringHelper(this) .add("id", id) .add("nodeId", nodeId) .add("type", type) .add("pool", pool) .add("location", location) .add("state", state) .add("properties", properties) .toString(); } @JsonCreator  ServiceDescriptor(
            @JsonProperty("id") UUID id,
            @JsonProperty("nodeId") String nodeId,
            @JsonProperty("type") String type,
            @JsonProperty("pool") String pool,
            @JsonProperty("location") String location,
            @JsonProperty("state") ServiceState state,
            @JsonProperty("properties") Map<String, String> properties); @JsonProperty UUID getId(); @JsonProperty String getNodeId(); @JsonProperty String getType(); @JsonProperty String getPool(); @JsonProperty String getLocation(); @JsonProperty ServiceState getState(); @JsonProperty Map<String, String> getProperties(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static ServiceDescriptorBuilder serviceDescriptor(String type);  }
@Test public void testJsonDecode() throws Exception { ServiceDescriptor expected = new ServiceDescriptor(UUID.fromString("12345678-1234-1234-1234-123456789012"), "node", "type", "pool", "location", ServiceState.RUNNING, ImmutableMap.of("a", "apple", "b", "banana")); String json = Resources.toString(getResource("service-descriptor.json"), UTF_8); ServiceDescriptor actual = serviceDescriptorCodec.fromJson(json); assertDescriptorEquals(expected, actual); }
@Test public void testToString() { assertNotNull(new ServiceDescriptor(UUID.fromString("12345678-1234-1234-1234-123456789012"), "node", "type", "pool", "location", ServiceState.RUNNING, ImmutableMap.of("a", "apple", "b", "banana"))); }