@Test
public void testCheckingForSuccessSkipsNonTentativeMetrics() throws Exception {
DataflowPipelineJob job = spy(new DataflowPipelineJob(mockClient, "test-job", options, null));
Pipeline p = TestPipeline.create(options);
PCollection<Integer> pc = p.apply(Create.of(1, 2, 3));
PAssert.that(pc).containsInAnyOrder(1, 2, 3);
when(mockClient.getJobMetrics(anyString()))
.thenReturn(
buildJobMetrics(generateMockMetrics(true , false )));
TestDataflowRunner runner = TestDataflowRunner.fromOptionsAndClient(options, mockClient);
runner.updatePAssertCount(p);
doReturn(State.RUNNING).when(job).getState();
assertThat(runner.checkForPAssertSuccess(job), equalTo(Optional.<Boolean>absent()));
}