### Question:
PipelineActionHandler implements EventHandler<PipelineActionsFromDatanode> { @Override public void onMessage(PipelineActionsFromDatanode report, EventPublisher publisher) { report.getReport().getPipelineActionsList().forEach(action -> processPipelineAction(report.getDatanodeDetails(), action, publisher)); } PipelineActionHandler(PipelineManager pipelineManager,
      OzoneConfiguration conf); @Override void onMessage(PipelineActionsFromDatanode report,
      EventPublisher publisher); static final Logger LOG; }### Answer:
@Test public void testCloseActionForMissingPipeline() throws PipelineNotFoundException { final PipelineManager manager = Mockito.mock(PipelineManager.class); final EventQueue queue = Mockito.mock(EventQueue.class); Mockito.when(manager.getPipeline(Mockito.any(PipelineID.class))) .thenThrow(new PipelineNotFoundException()); final PipelineActionHandler actionHandler = new PipelineActionHandler(manager, null); final PipelineActionsProto actionsProto = PipelineActionsProto.newBuilder() .addPipelineActions(PipelineAction.newBuilder() .setClosePipeline(ClosePipelineInfo.newBuilder() .setPipelineID(HddsProtos.PipelineID.newBuilder() .setId(UUID.randomUUID().toString()).build()) .setReason(ClosePipelineInfo.Reason.PIPELINE_FAILED)) .setAction(PipelineAction.Action.CLOSE).build()) .build(); final PipelineActionsFromDatanode pipelineActions = new PipelineActionsFromDatanode( MockDatanodeDetails.randomDatanodeDetails(), actionsProto); actionHandler.onMessage(pipelineActions, queue); Mockito.verify(queue, Mockito.times(1)) .fireEvent(Mockito.any(), Mockito.any(CommandForDatanode.class)); }