@Test
public void should_Execute_On_Project_only_if_exec_exists() {

  when(configuration.getItReportPath()).thenReturn("it.exec");
  when(pathResolver.relativeFile(any(File.class), eq("it.exec"))).thenReturn(jacocoExecutionData);
  assertThat(sensor.shouldExecuteOnProject()).isTrue();
  when(pathResolver.relativeFile(any(File.class), eq("it.exec"))).thenReturn(jacocoExecutionData.getParentFile());
  assertThat(sensor.shouldExecuteOnProject()).isFalse();
  File outputDir = TestUtils.getResource(JaCoCoSensorTest.class, ".");
  File fakeExecFile = new File(outputDir, "it.not.found.exec");
  when(pathResolver.relativeFile(any(File.class), eq("it.exec"))).thenReturn(fakeExecFile);
  assertThat(sensor.shouldExecuteOnProject()).isFalse();
  when(pathResolver.relativeFile(any(File.class), eq("it.exec"))).thenReturn(fakeExecFile);
  when(configuration.shouldExecuteOnProject(false)).thenReturn(true);
  assertThat(sensor.shouldExecuteOnProject()).isTrue();
}