use of org.sonar.api.config.Configuration in project sonarqube by SonarSource.
the class ConfigurationProviderTest method getStringArray_on_multivalue_properties_ignores_empty_fields_differently_from_settings.
@Test
@UseDataProvider("emptyFields3")
public void getStringArray_on_multivalue_properties_ignores_empty_fields_differently_from_settings(String emptyFields, String[] expected) {
settings.setProperty(multivalueKey, emptyFields);
Configuration configuration = underTest.provide(settings);
getStringArrayBehaviorDiffers(configuration, multivalueKey, expected);
}
use of org.sonar.api.config.Configuration in project sonarqube by SonarSource.
the class ConfigurationProviderTest method getStringArray_supports_quoted_strings_when_settings_does_not.
@Test
@UseDataProvider("quotedStrings1")
public void getStringArray_supports_quoted_strings_when_settings_does_not(String str, String[] configurationExpected, String[] settingsExpected) {
settings.setProperty(nonDeclaredKey, str);
settings.setProperty(nonMultivalueKey, str);
settings.setProperty(multivalueKey, str);
Configuration configuration = underTest.provide(settings);
getStringArrayBehaviorDiffers(configuration, nonDeclaredKey, configurationExpected, settingsExpected);
getStringArrayBehaviorDiffers(configuration, nonMultivalueKey, configurationExpected, settingsExpected);
getStringArrayBehaviorDiffers(configuration, multivalueKey, configurationExpected, settingsExpected);
}
use of org.sonar.api.config.Configuration in project sonarqube by SonarSource.
the class WebhookQGChangeEventListenerTest method onIssueChangesCallsWebhookOnBranch.
public void onIssueChangesCallsWebhookOnBranch(BranchType branchType) {
ProjectAndBranch nonMainBranch = insertBranch(branchType, "foo");
SnapshotDto analysis = insertAnalysisTask(nonMainBranch);
Configuration configuration = mock(Configuration.class);
QGChangeEvent qualityGateEvent = newQGChangeEvent(nonMainBranch, analysis, configuration, null);
mockWebhookEnabled(qualityGateEvent.getProject());
underTest.onIssueChanges(qualityGateEvent, CHANGED_ISSUES_ARE_IGNORED);
verifyWebhookCalled(nonMainBranch, analysis, qualityGateEvent.getProject());
}
use of org.sonar.api.config.Configuration in project sonarqube by SonarSource.
the class WebhookQGChangeEventListenerTest method onIssueChanges_has_no_effect_if_event_has_neither_previousQGStatus_nor_qualityGate.
@Test
public void onIssueChanges_has_no_effect_if_event_has_neither_previousQGStatus_nor_qualityGate() {
Configuration configuration = mock(Configuration.class);
QGChangeEvent qualityGateEvent = newQGChangeEvent(configuration, null, null);
mockWebhookEnabled(qualityGateEvent.getProject());
underTest.onIssueChanges(qualityGateEvent, CHANGED_ISSUES_ARE_IGNORED);
verifyZeroInteractions(webhookPayloadFactory, mockedDbClient);
}
use of org.sonar.api.config.Configuration in project sonarqube by SonarSource.
the class WebhookQGChangeEventListenerTest method onIssueChanges_has_no_effect_if_event_has_same_status_in_previous_and_new_QG.
@Test
public void onIssueChanges_has_no_effect_if_event_has_same_status_in_previous_and_new_QG() {
Configuration configuration = mock(Configuration.class);
Metric.Level previousStatus = randomLevel();
when(newQualityGate.getStatus()).thenReturn(previousStatus);
QGChangeEvent qualityGateEvent = newQGChangeEvent(configuration, previousStatus, newQualityGate);
mockWebhookEnabled(qualityGateEvent.getProject());
underTest.onIssueChanges(qualityGateEvent, CHANGED_ISSUES_ARE_IGNORED);
verifyZeroInteractions(webhookPayloadFactory, mockedDbClient);
}
Aggregations