when(abstractProjectMock.getTrigger(GerritTrigger.class)).thenReturn(gerritTriggerMock);
abstractProjectDependencyMock = mock(AbstractProject.class);
when(abstractProjectDependencyMock.getTrigger(GerritTrigger.class)).thenReturn(gerritTriggerMock);
when(gerritTriggerMock.getDependencyJobsNames()).thenReturn(dependency);
when(jenkinsMock.getItem(eq("upstream"), any(Item.class), Item.class)).thenReturn(abstractProjectDependencyMock);
WaitingItem waitingItem = PowerMockito.spy(new WaitingItem(Calendar.getInstance(),
abstractProjectMock, actions));
when(waitingItem.getInQueueSince()).thenReturn(System.currentTimeMillis()
- TimeUnit.SECONDS.toMillis(GerritDefaultValues.DEFAULT_BUILD_SCHEDULE_DELAY));
return waitingItem;
}