### Question:
ReconPipelineReportHandler extends PipelineReportHandler { @Override protected void processPipelineReport(PipelineReport report, DatanodeDetails dn, EventPublisher publisher) throws IOException { ReconPipelineManager reconPipelineManager = (ReconPipelineManager)getPipelineManager(); PipelineID pipelineID = PipelineID.getFromProtobuf(report.getPipelineID()); if (!reconPipelineManager.containsPipeline(pipelineID)) { LOG.info("Unknown pipeline {}. Trying to get from SCM.", pipelineID); Pipeline pipelineFromScm = scmServiceProvider.getPipeline(report.getPipelineID()); LOG.info("Adding new pipeline {} to Recon pipeline metadata.", pipelineFromScm); reconPipelineManager.addPipeline(pipelineFromScm); } Pipeline pipeline = null; try { pipeline = reconPipelineManager.getPipeline(pipelineID); } catch (PipelineNotFoundException ex) { LOG.warn("Pipeline {} not found in Recon.", pipelineID); return; } setReportedDatanode(pipeline, dn); setPipelineLeaderId(report, pipeline, dn); if (pipeline.getPipelineState() == Pipeline.PipelineState.ALLOCATED) { LOG.info("Pipeline {} {} reported by {}", pipeline.getFactor(), pipeline.getId(), dn); if (pipeline.isHealthy()) { reconPipelineManager.openPipeline(pipelineID); } } } ReconPipelineReportHandler(SafeModeManager scmSafeModeManager,
      PipelineManager pipelineManager,
      ConfigurationSource conf,
      StorageContainerServiceProvider scmServiceProvider);   }### Answer:
@Test public void testProcessPipelineReport() throws IOException { Pipeline pipeline = getRandomPipeline(); PipelineID pipelineID = pipeline.getId(); HddsProtos.PipelineID pipelineIDProto = pipelineID.getProtobuf(); ReconPipelineManager reconPipelineManagerMock = mock( ReconPipelineManager.class); when(reconPipelineManagerMock.getPipeline(pipelineID)).thenReturn(pipeline); StorageContainerServiceProvider scmServiceProviderMock = mock( StorageContainerServiceProvider.class); when(scmServiceProviderMock.getPipeline(pipelineIDProto)) .thenReturn(pipeline); OzoneConfiguration configuration = new OzoneConfiguration(); ReconPipelineReportHandler handler = new ReconPipelineReportHandler(new ReconSafeModeManager(), reconPipelineManagerMock, configuration, scmServiceProviderMock); EventPublisher eventPublisherMock = mock(EventPublisher.class); PipelineReport report = mock(PipelineReport.class); when(report.getPipelineID()).thenReturn(pipelineIDProto); handler.processPipelineReport(report, pipeline.getNodes().get(0), eventPublisherMock); verify(reconPipelineManagerMock, times(1)) .addPipeline(pipeline); verify(reconPipelineManagerMock, times(1)) .getPipeline(pipelineID); pipeline = getRandomPipeline(); pipelineID = pipeline.getId(); pipelineIDProto = pipelineID.getProtobuf(); when(reconPipelineManagerMock.containsPipeline(pipelineID)) .thenReturn(true); when(reconPipelineManagerMock.getPipeline(pipelineID)) .thenReturn(pipeline); when(report.getPipelineID()).thenReturn(pipelineIDProto); handler.processPipelineReport(report, pipeline.getNodes().get(0), eventPublisherMock); verify(reconPipelineManagerMock, times(0)) .addPipeline(pipeline); verify(reconPipelineManagerMock, times(1)) .getPipeline(pipelineID); }