Search in sources :

Example 1 with Setting

use of org.sonarqube.ws.Settings.Setting in project sonarqube by SonarSource.

the class SettingsTest method get_default_value.

@Test
public void get_default_value() {
    Setting setting = getSetting(PLUGIN_SETTING_KEY, anonymousSettingsService);
    assertThat(setting.getValue()).isEqualTo("aDefaultValue");
    assertThat(setting.getInherited()).isTrue();
}
Also used : Setting(org.sonarqube.ws.Settings.Setting) Test(org.junit.Test)

Example 2 with Setting

use of org.sonarqube.ws.Settings.Setting in project sonarqube by SonarSource.

the class SettingsTest method getSetting.

@CheckForNull
private static Setting getSetting(String key, SettingsService settingsService) {
    ValuesWsResponse response = settingsService.values(ValuesRequest.builder().setKeys(key).build());
    List<Settings.Setting> settings = response.getSettingsList();
    return settings.isEmpty() ? null : settings.get(0);
}
Also used : ValuesWsResponse(org.sonarqube.ws.Settings.ValuesWsResponse) Setting(org.sonarqube.ws.Settings.Setting) CheckForNull(javax.annotation.CheckForNull)

Aggregations

Setting (org.sonarqube.ws.Settings.Setting)2 CheckForNull (javax.annotation.CheckForNull)1 Test (org.junit.Test)1 ValuesWsResponse (org.sonarqube.ws.Settings.ValuesWsResponse)1