Program: 63908
Project: 63908
Buggy source:
@Test public void callWithInProgressAndMissingNodes() throws Exception {
  String jobId="String_Node_Str";
  SaltConnector saltConnector=Mockito.mock(SaltConnector.class);
  SaltJobRunner saltJobRunner=Mockito.mock(BaseSaltJobRunner.class);
  when(saltJobRunner.getJid()).thenReturn(JobId.jobId(jobId));
  when(saltJobRunner.getJobState()).thenCallRealMethod();
  doCallRealMethod().when(saltJobRunner).setJobState(any());
  when(saltJobRunner.submit(any(SaltConnector.class))).thenReturn(jobId);
  saltJobRunner.setJobState(JobState.IN_PROGRESS);
  Set<String> targets=new HashSet<>();
  targets.add("String_Node_Str");
  targets.add("String_Node_Str");
  targets.add("String_Node_Str");
  when(saltJobRunner.getTarget()).thenReturn(targets);
  PowerMockito.mockStatic(SaltStates.class);
  PowerMockito.when(SaltStates.jobIsRunning(any(),any(),any())).thenReturn(false);
  Multimap<String,String> missingNodesWithReason=ArrayListMultimap.create();
  String missingMachine="String_Node_Str";
  String errorMessage="String_Node_Str";
  missingNodesWithReason.put(missingMachine,errorMessage);
  PowerMockito.when(SaltStates.jidInfo(any(),any(),any(),any())).thenReturn(missingNodesWithReason);
  SaltJobIdTracker saltJobIdTracker=new SaltJobIdTracker(saltConnector,saltJobRunner);
  try {
    saltJobIdTracker.call();
    fail("String_Node_Str");
  }
 catch (  CloudbreakOrchestratorFailedException e) {
    assertThat(e.getMessage(),both(containsString(missingMachine)).and(containsString(errorMessage)));
  }
  PowerMockito.verifyStatic();
  SaltStates.jobIsRunning(any(),eq(jobId),targetCaptor.capture());
  checkTargets(targets,targetCaptor.getAllValues());
}

Fixed version (ground truth):
@Test public void callWithInProgressAndMissingNodes() throws Exception {
  String jobId="String_Node_Str";
  SaltConnector saltConnector=Mockito.mock(SaltConnector.class);
  SaltJobRunner saltJobRunner=Mockito.mock(BaseSaltJobRunner.class);
  when(saltJobRunner.getJid()).thenReturn(JobId.jobId(jobId));
  when(saltJobRunner.getJobState()).thenCallRealMethod();
  doCallRealMethod().when(saltJobRunner).setJobState(any());
  when(saltJobRunner.submit(any(SaltConnector.class))).thenReturn(jobId);
  saltJobRunner.setJobState(JobState.IN_PROGRESS);
  Set<String> targets=new HashSet<>();
  targets.add("String_Node_Str");
  targets.add("String_Node_Str");
  targets.add("String_Node_Str");
  when(saltJobRunner.getTarget()).thenReturn(targets);
  PowerMockito.mockStatic(SaltStates.class);
  PowerMockito.when(SaltStates.jobIsRunning(any(),any(),any())).thenReturn(false);
  Multimap<String,String> missingNodesWithReason=ArrayListMultimap.create();
  String missingMachine="String_Node_Str";
  String errorMessage="String_Node_Str";
  missingNodesWithReason.put(missingMachine,errorMessage);
  when(saltJobRunner.getNodesWithError()).thenReturn(missingNodesWithReason);
  SaltJobIdTracker saltJobIdTracker=new SaltJobIdTracker(saltConnector,saltJobRunner);
  try {
    saltJobIdTracker.call();
    fail("String_Node_Str");
  }
 catch (  CloudbreakOrchestratorFailedException e) {
    assertThat(e.getMessage(),both(containsString(missingMachine)).and(containsString(errorMessage)));
  }
  PowerMockito.verifyStatic();
  SaltStates.jobIsRunning(any(),eq(jobId),targetCaptor.capture());
  checkTargets(targets,targetCaptor.getAllValues());
}