### Question:
OzoneContainer { public StorageContainerDatanodeProtocolProtos.NodeReportProto getNodeReport() throws IOException { StorageLocationReport[] reports = volumeSet.getStorageReport(); StorageContainerDatanodeProtocolProtos.NodeReportProto.Builder nrb = StorageContainerDatanodeProtocolProtos. NodeReportProto.newBuilder(); for (int i = 0; i < reports.length; i++) { nrb.addStorageReport(reports[i].getProtoBufMessage()); } List<StorageContainerDatanodeProtocolProtos. MetadataStorageReportProto> metadataReport = writeChannel.getStorageReport(); if (metadataReport != null) { nrb.addAllMetadataStorageReport(metadataReport); } return nrb.build(); } OzoneContainer(DatanodeDetails datanodeDetails, ConfigurationSource
      conf, StateContext context, CertificateClient certClient); GrpcTlsConfig getTlsClientConfig(); void start(String scmId); void stop(); void handleVolumeFailures(); @VisibleForTesting ContainerSet getContainerSet(); PipelineReportsProto getPipelineReport(); XceiverServerSpi getWriteChannel(); XceiverServerSpi getReadChannel(); ContainerController getController(); StorageContainerDatanodeProtocolProtos.NodeReportProto getNodeReport(); @VisibleForTesting ContainerDispatcher getDispatcher(); MutableVolumeSet getVolumeSet();  }### Answer:
@Test public void testBuildNodeReport() throws Exception { String path = folder.getRoot() .getAbsolutePath(); conf.set(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATANODE_STORAGE_DIR, String.join(",", path + "/ratis1", path + "/ratis2", path + "ratis3")); DatanodeStateMachine stateMachine = Mockito.mock( DatanodeStateMachine.class); StateContext context = Mockito.mock(StateContext.class); Mockito.when(stateMachine.getDatanodeDetails()).thenReturn(datanodeDetails); Mockito.when(context.getParent()).thenReturn(stateMachine); OzoneContainer ozoneContainer = new OzoneContainer(datanodeDetails, conf, context, null); Assert.assertEquals(volumeSet.getVolumesList().size(), ozoneContainer.getNodeReport().getStorageReportList().size()); Assert.assertEquals(3, ozoneContainer.getNodeReport().getMetadataStorageReportList() .size()); }
@Test public void testBuildNodeReportWithDefaultRatisLogDir() throws Exception { DatanodeStateMachine stateMachine = Mockito.mock( DatanodeStateMachine.class); StateContext context = Mockito.mock(StateContext.class); Mockito.when(stateMachine.getDatanodeDetails()).thenReturn(datanodeDetails); Mockito.when(context.getParent()).thenReturn(stateMachine); OzoneContainer ozoneContainer = new OzoneContainer(datanodeDetails, conf, context, null); Assert.assertEquals(volumeSet.getVolumesList().size(), ozoneContainer.getNodeReport().getStorageReportList().size()); Assert.assertEquals(1, ozoneContainer.getNodeReport().getMetadataStorageReportList() .size()); }