@Override
    public boolean registerServer(String nodeId, boolean isLeader, URI httpPublishUri, String clusterUri, String hostname) {
        ServerNodeDto dto = ServerNodeDto.Builder.builder()
                .setId(nodeId)
                .setLeader(isLeader)
                .setTransportAddress(httpPublishUri.toString())
                .setHostname(hostname)
                .build();
        return delegate.registerServer(dto);
    }
@Test
    @MongoDBFixtures("NodeServiceImplTest-empty.json")
    public void testRegisterServer() throws Exception {
        assertThat(nodeService.allActive())
                .describedAs("The collection should be empty")
                .isEmpty();

        nodeService.registerServer(nodeId.getNodeId(), true, TRANSPORT_URI, LOCAL_CANONICAL_HOSTNAME);

        final Node node = nodeService.byNodeId(nodeId);

        assertThat(node).isNotNull();
        assertThat(node.getHostname()).isEqualTo(LOCAL_CANONICAL_HOSTNAME);
        assertThat(node.getTransportAddress()).isEqualTo(TRANSPORT_URI.toString());
        assertThat(node.isLeader()).isTrue();
    }