@Test public void testBuilderNodeId() { ServiceDescriptor expected = new ServiceDescriptor( UUID.fromString("12345678-1234-1234-1234-123456789012"), "node", "type", "pool", "location", ServiceState.RUNNING, ImmutableMap.of("a", "apple", "b", "banana")); ServiceDescriptorBuilder builder = serviceDescriptor(expected.getType()) .setId(expected.getId()) .setLocation(expected.getLocation()) .setNodeId(expected.getNodeId()) .setPool(expected.getPool()) .setState(expected.getState()); for (Map.Entry<String, String> entry : expected.getProperties().entrySet()) { builder.addProperty(entry.getKey(), entry.getValue()); } assertDescriptorEquals(expected, builder.build()); }
@Test public void testBuilderNodeId() { ServiceDescriptor expected = new ServiceDescriptor( UUID.fromString("12345678-1234-1234-1234-123456789012"), "node", "type", "pool", "location", ServiceState.RUNNING, ImmutableMap.of("a", "apple", "b", "banana")); ServiceDescriptorBuilder builder = serviceDescriptor(expected.getType()) .setId(expected.getId()) .setLocation(expected.getLocation()) .setNodeId(expected.getNodeId()) .setPool(expected.getPool()) .setState(expected.getState()); for (Map.Entry<String, String> entry : expected.getProperties().entrySet()) { builder.addProperty(entry.getKey(), entry.getValue()); } assertDescriptorEquals(expected, builder.build()); }