hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/node/TestNodeManager.java
@Test
  public void testScmCheckForErrorOnNullDatanodeDetails() throws IOException,
      InterruptedException, TimeoutException {
    try (SCMNodeManager nodeManager = createNodeManager(getConf())) {
      nodeManager.sendHeartbeat(null, null, reportState);
    } catch (NullPointerException npe) {
      GenericTestUtils.assertExceptionContains("Heartbeat is missing " +
          "DatanodeDetails.", npe);
    }
  }
/**
   * Check for NPE when datanodeDetails is passed null for sendHeartbeat.
   *
   * @throws IOException
   * @throws InterruptedException
   * @throws TimeoutException
   */
Check for NPE when datanodeDetails is passed null for sendHeartbeat.
Check for NPE when datanodeDetails is passed null for sendHeartbeat .
@Test
  public void testScmCheckForErrorOnNullDatanodeDetails() throws IOException,
      InterruptedException, TimeoutException {
    try (SCMNodeManager nodeManager = createNodeManager(getConf())) {
      nodeManager.sendHeartbeat(null, null, reportState);
    } catch (NullPointerException npe) {
      GenericTestUtils.assertExceptionContains("Heartbeat is missing " +
          "DatanodeDetails.", npe);
    }
  }
@ Test public void testScmCheckForErrorOnNullDatanodeDetails ( ) throws IOException , InterruptedException , TimeoutException { try ( SCMNodeManager nodeManager = createNodeManager ( getConf ( ) ) ) { nodeManager . sendHeartbeat ( null , null , reportState ) ; } catch ( NullPointerException npe ) { GenericTestUtils . assertExceptionContains ( "Heartbeat is missing " + "DatanodeDetails." , npe ) ; } }
Check for NPE when datanodeDetails is passed null for sendHeartbeat.
Check for NPE when datanodeDetails is passed null for sendHeartbeat .