use of org.sonar.api.config.Configuration in project sonarqube by SonarSource.
the class ComponentIssuesLoaderTest method loadClosedIssues_returns_empty_without_querying_DB_if_property_is_0.
@Test
public void loadClosedIssues_returns_empty_without_querying_DB_if_property_is_0() {
System2 system2 = mock(System2.class);
DbClient dbClient = mock(DbClient.class);
Configuration configuration = newConfiguration("0");
String componentUuid = randomAlphabetic(15);
ComponentIssuesLoader underTest = new ComponentIssuesLoader(dbClient, null, /* not used in loadClosedIssues */
null, /* not used in loadClosedIssues */
configuration, system2);
assertThat(underTest.loadClosedIssues(componentUuid)).isEmpty();
verifyZeroInteractions(dbClient, system2);
}
use of org.sonar.api.config.Configuration in project sonarqube by SonarSource.
the class ComponentIssuesLoaderTest method loadClosedIssues_returns_only_closed_issues_with_close_date_is_from_30_days_ago_if_property_is_empty.
@Test
public void loadClosedIssues_returns_only_closed_issues_with_close_date_is_from_30_days_ago_if_property_is_empty() {
Configuration configuration = newConfiguration(null);
ComponentIssuesLoader underTest = newComponentIssuesLoader(configuration);
loadClosedIssues_returns_only_closed_issues_with_close_date_is_from_30_days_ago(underTest);
}
use of org.sonar.api.config.Configuration in project sonarqube by SonarSource.
the class ComponentIssuesLoaderTest method loadClosedIssues_returns_only_closed_with_close_date_is_from_30_days_ago_if_property_is_30.
@Test
public void loadClosedIssues_returns_only_closed_with_close_date_is_from_30_days_ago_if_property_is_30() {
Configuration configuration = newConfiguration("30");
ComponentIssuesLoader underTest = newComponentIssuesLoader(configuration);
loadClosedIssues_returns_only_closed_issues_with_close_date_is_from_30_days_ago(underTest);
}
use of org.sonar.api.config.Configuration in project sonarqube by SonarSource.
the class IndexDefinitionHashTest method hash_changes_if_refreshInterval_changes.
@Test
public void hash_changes_if_refreshInterval_changes() {
Index index = Index.simple("foo");
IndexMainType mainType = IndexMainType.main(index, "bar");
Configuration emptySettings = new MapSettings().asConfig();
SettingsConfiguration defaultRefreshInterval = SettingsConfiguration.newBuilder(emptySettings).build();
SettingsConfiguration noRefreshInterval = SettingsConfiguration.newBuilder(emptySettings).setRefreshInterval(-1).build();
SettingsConfiguration refreshInterval30 = SettingsConfiguration.newBuilder(emptySettings).setRefreshInterval(30).build();
SettingsConfiguration someRefreshInterval = SettingsConfiguration.newBuilder(emptySettings).setRefreshInterval(56).build();
assertThat(hashOf(new TestNewIndex(mainType, defaultRefreshInterval))).isEqualTo(hashOf(new TestNewIndex(mainType, defaultRefreshInterval))).isEqualTo(hashOf(new TestNewIndex(mainType, refreshInterval30))).isNotEqualTo(hashOf(new TestNewIndex(mainType, noRefreshInterval))).isNotEqualTo(hashOf(new TestNewIndex(mainType, someRefreshInterval)));
assertThat(hashOf(new TestNewIndex(mainType, noRefreshInterval))).isNotEqualTo(hashOf(new TestNewIndex(mainType, someRefreshInterval)));
}
use of org.sonar.api.config.Configuration in project sonarqube by SonarSource.
the class ConfigurationProviderTest method getStringArray_on_multivalue_properties_ignores_subsequent_commas_differently_from_Settings.
@Test
@UseDataProvider("subsequentCommas3")
public void getStringArray_on_multivalue_properties_ignores_subsequent_commas_differently_from_Settings(String subsequentCommas, String[] expected) {
settings.setProperty(multivalueKey, subsequentCommas);
Configuration configuration = underTest.provide(settings);
getStringArrayBehaviorDiffers(configuration, multivalueKey, expected);
}
Aggregations