FortifySensorConfiguration implements BatchExtension { public boolean isActive(Collection<String> languages) { int activeRuleCount = 0; for (String language : languages) { activeRuleCount += this.profile.getActiveRulesByRepository(FortifyConstants.fortifyRepositoryKey(language)).size(); } return activeRuleCount > 0; } FortifySensorConfiguration(RulesProfile profile, Settings settings); boolean isActive(Collection<String> languages); String getReportPath();  }
@Test public void testIsActive() { when(this.profile.getActiveRulesByRepository(anyString())).thenReturn(Collections.<ActiveRule>emptyList()); assertThat(this.fortifySensorConfiguration.isActive(Collections.singletonList("java"))).isFalse(); when(this.profile.getActiveRulesByRepository(anyString())).thenReturn(Collections.singletonList((ActiveRule) null)); assertThat(this.fortifySensorConfiguration.isActive(Collections.singletonList("java"))).isTrue(); }