### Question:
ReconNodeManager extends SCMNodeManager { @Override public void onMessage(CommandForDatanode commandForDatanode, EventPublisher ignored) { if (ALLOWED_COMMANDS.contains( commandForDatanode.getCommand().getType())) { super.onMessage(commandForDatanode, ignored); } else { LOG.info("Ignoring unsupported command {} for Datanode {}.", commandForDatanode.getCommand().getType(), commandForDatanode.getDatanodeId()); } } ReconNodeManager(OzoneConfiguration conf,
                          SCMStorageConfig scmStorageConfig,
                          EventPublisher eventPublisher,
                          NetworkTopology networkTopology,
                          Table<UUID, DatanodeDetails> nodeDB); void addNodeToDB(DatanodeDetails datanodeDetails); long getLastHeartbeat(DatanodeDetails datanodeDetails); @Override void onMessage(CommandForDatanode commandForDatanode,
                        EventPublisher ignored); @Override List<SCMCommand> processHeartbeat(DatanodeDetails datanodeDetails); static final Logger LOG; }### Answer:
@Test public void testReconNodeDB() throws IOException { ReconStorageConfig scmStorageConfig = new ReconStorageConfig(conf); EventQueue eventQueue = new EventQueue(); NetworkTopology clusterMap = new NetworkTopologyImpl(conf); Table<UUID, DatanodeDetails> nodeTable = ReconSCMDBDefinition.NODES.getTable(store); ReconNodeManager reconNodeManager = new ReconNodeManager(conf, scmStorageConfig, eventQueue, clusterMap, nodeTable); ReconNewNodeHandler reconNewNodeHandler = new ReconNewNodeHandler(reconNodeManager); assertTrue(reconNodeManager.getAllNodes().isEmpty()); DatanodeDetails datanodeDetails = randomDatanodeDetails(); String uuidString = datanodeDetails.getUuidString(); reconNodeManager.register(datanodeDetails, null, null); reconNewNodeHandler.onMessage(reconNodeManager.getNodeByUuid(uuidString), null); assertEquals(1, reconNodeManager.getAllNodes().size()); assertNotNull(reconNodeManager.getNodeByUuid(uuidString)); eventQueue.close(); reconNodeManager.close(); reconNodeManager = new ReconNodeManager(conf, scmStorageConfig, eventQueue, clusterMap, nodeTable); assertEquals(1, reconNodeManager.getAllNodes().size()); assertNotNull( reconNodeManager.getNodeByUuid(datanodeDetails.getUuidString())); }