@Test
public void testInsertJobOrFetchDuplicateBasicInsert() throws IOException {

  when(mockBigqueryJobsInsert.execute()).thenReturn(jobHandle);
  assertThat(helper.insertJobOrFetchDuplicate(jobProjectId, jobHandle)).isEqualTo(jobHandle);
  verify(mockBigquery, times(1)).jobs();
  ArgumentCaptor<Job> jobCaptor = ArgumentCaptor.forClass(Job.class);
  verify(mockBigqueryJobs, times(1)).insert(eq(jobProjectId), jobCaptor.capture());
  Job job = jobCaptor.getValue();
  assertThat(job).isEqualTo(jobHandle);
  verify(mockBigqueryJobsInsert, times(1)).execute();
}