@Test
public void getCauseOfBlockage() throws Exception {

    CauseOfBlockage blockage = mock(CauseOfBlockage.class);
    CauseOfBlockage taskBlockage = mock(CauseOfBlockage.class);
    FlowNode stage = mock(FlowNode.class);
    FlowNode nodeBlock = mock(FlowNode.class);
    Queue.Item item = mock(Queue.Item.class);
    mockStatic(QueueItemAction.class);
    String cause = null;
    cause = PipelineNodeUtil.getCauseOfBlockage(stage, null);
    assertNull(cause);
    when(nodeBlock.getParents()).thenReturn(ImmutableList.of());
    cause = PipelineNodeUtil.getCauseOfBlockage(stage, null);
    assertNull(cause);
    when(nodeBlock.getParents()).thenReturn(ImmutableList.of(stage));
    when(QueueItemAction.getQueueItem(nodeBlock)).thenReturn(null);
    cause = PipelineNodeUtil.getCauseOfBlockage(stage, null);
    assertNull(cause);
    when(QueueItemAction.getQueueItem(nodeBlock)).thenReturn(item);
    when(item.getCauseOfBlockage()).thenReturn(null);
    cause = PipelineNodeUtil.getCauseOfBlockage(stage, null);
    assertNull(cause);
    when(blockage.getShortDescription()).thenReturn("test");
    when(item.getCauseOfBlockage()).thenReturn(blockage);
    cause = PipelineNodeUtil.getCauseOfBlockage(stage, nodeBlock);
    assertEquals("test", cause);
    when(blockage.getShortDescription()).thenReturn(null);
    cause = PipelineNodeUtil.getCauseOfBlockage(stage, null);
    assertNull(cause);
    when(taskBlockage.getShortDescription()).thenReturn("test1");
    Whitebox.setInternalState(item,"task", mock(Queue.Task.class));
    when(item.task.getCauseOfBlockage()).thenReturn(taskBlockage);
    cause = PipelineNodeUtil.getCauseOfBlockage(stage, nodeBlock);
    assertEquals("test1", cause);
}