@Test public void testBuilderNodeInfo() { NodeInfo nodeInfo = new NodeInfo(new NodeConfig().setEnvironment("test").setPool("pool")); ServiceDescriptor expected = new ServiceDescriptor( UUID.fromString("12345678-1234-1234-1234-123456789012"), nodeInfo.getNodeId(), "type", nodeInfo.getPool(), "location", ServiceState.STOPPED, ImmutableMap.of("a", "apple", "b", "banana")); ServiceDescriptor actual = serviceDescriptor(expected.getType()) .setId(expected.getId()) .setLocation(expected.getLocation()) .setNodeInfo(nodeInfo) .setState(expected.getState()) .addProperties(expected.getProperties()) .build(); assertDescriptorEquals(expected, actual); }
@Test public void testBuilderNodeInfo() { NodeInfo nodeInfo = new NodeInfo(new NodeConfig().setEnvironment("test").setPool("pool")); ServiceDescriptor expected = new ServiceDescriptor( UUID.fromString("12345678-1234-1234-1234-123456789012"), nodeInfo.getNodeId(), "type", nodeInfo.getPool(), "location", ServiceState.STOPPED, ImmutableMap.of("a", "apple", "b", "banana")); ServiceDescriptor actual = serviceDescriptor(expected.getType()) .setId(expected.getId()) .setLocation(expected.getLocation()) .setNodeInfo(nodeInfo) .setState(expected.getState()) .addProperties(expected.getProperties()) .build(); assertDescriptorEquals(expected, actual); }
public ServiceDescriptor toServiceDescriptor(NodeInfo nodeInfo) { return serviceDescriptor(type) .setId(id) .setNodeInfo(nodeInfo) .setLocation(nodeInfo.getLocation()) .setState(ServiceState.RUNNING) .addProperties(properties) .build(); }
public ServiceDescriptor toServiceDescriptor(NodeInfo nodeInfo) { return serviceDescriptor(type) .setId(id) .setNodeInfo(nodeInfo) .setLocation(nodeInfo.getLocation()) .setState(ServiceState.RUNNING) .addProperties(properties) .build(); }