### Question:
GenericCoverageSensor implements Sensor { @Override public boolean shouldExecuteOnProject(Project project) { return StringUtils.isNotEmpty(coverageReportPath(null)) || StringUtils.isNotEmpty(itReportPath()) || StringUtils.isNotEmpty(overallReportPath()) || StringUtils.isNotEmpty(unitTestReportPath()); } GenericCoverageSensor(Settings settings, FileSystem fs, ResourcePerspectives perspectives); @Override boolean shouldExecuteOnProject(Project project); @Override void analyse(Project project, SensorContext context); void analyseWithLogger(SensorContext context, Logger logger); @Override String toString();  }### Answer:
@Test public void should_execute_when_report_path_is_provided() throws Exception { configureReportPaths("my-report"); assertThat(sensor.shouldExecuteOnProject(project)).isTrue(); configureReportPaths(""); configureITReportPaths("my-report"); assertThat(sensor.shouldExecuteOnProject(project)).isTrue(); configureReportPaths(""); configureITReportPaths(""); configureOverallReportPaths("my-report"); assertThat(sensor.shouldExecuteOnProject(project)).isTrue(); configureReportPaths(""); configureITReportPaths(""); configureOverallReportPaths(""); configureUTReportPaths("my-report"); assertThat(sensor.shouldExecuteOnProject(project)).isTrue(); }
@Test public void should_not_execute_when_report_path_is_empty() throws Exception { configureReportPaths(""); configureITReportPaths(""); configureUTReportPaths(""); configureOverallReportPaths(""); assertThat(sensor.shouldExecuteOnProject(project)).isFalse(); }
@Test public void analyse_report_with_deprecated_key_and_no_logger() throws Exception { configureOldReportPath("coverage.xml"); assertThat(sensor.shouldExecuteOnProject(project)).isTrue(); }