@Test
public void testGenerateNodeIdWithNodeIdSet() throws Exception {

    DefaultNodeIdCreator generator = new DefaultNodeIdCreator(new MockParameterService(), new MockNodeService(), SecurityServiceFactory.create());
    Node node = new Node();
    final String EXPECTED_NODE_ID = "10001";
    node.setExternalId(EXPECTED_NODE_ID);
    node.setNodeId(EXPECTED_NODE_ID);
    String selectedNodeId = generator.generateNodeId(node, null, null);
    assertEquals(EXPECTED_NODE_ID, selectedNodeId);
}