@Override
    public DataNodeDto resetNode(String nodeId) throws NodeNotFoundException {
        final DataNodeDto node = nodeService.byNodeId(nodeId);
        if (node.getDataNodeStatus() != DataNodeStatus.REMOVED) {
            throw new IllegalArgumentException("Only previously removed data nodes can rejoin the cluster.");
        }
        DataNodeLifecycleEvent e = DataNodeLifecycleEvent.create(node.getNodeId(), DataNodeLifecycleTrigger.RESET);
        clusterEventBus.post(e);
        return node;
    }
@Test
    public void resetNodePublishesClusterEvent() throws NodeNotFoundException {
        final String testNodeId = "node";
        nodeService.registerServer(buildTestNode(testNodeId, DataNodeStatus.REMOVED));
        classUnderTest.resetNode(testNodeId);
        verify(clusterEventBus).post(DataNodeLifecycleEvent.create(testNodeId, DataNodeLifecycleTrigger.RESET));
    }