CoberturaSensor implements Sensor { boolean shouldExecuteOnProject() { return groovyFileSystem.hasGroovyFiles(); } CoberturaSensor(Settings settings, FileSystem fileSystem); @Override void describe(SensorDescriptor descriptor); @Override void execute(SensorContext context); void analyse(SensorContext context); @Override String toString();  }
@Test public void should_execute_on_project() { fileSystem.add(new DefaultInputFile("", "fake.groovy").setLanguage(Groovy.KEY)); assertThat(sensor.shouldExecuteOnProject()).isTrue(); }
@Test public void should_not_execute_if_no_groovy_files() { assertThat(sensor.shouldExecuteOnProject()).isFalse(); }