use of org.sonarqube.ws.Settings.FieldValues.Value.Builder in project sonarqube by SonarSource.
the class DefaultSettingsLoaderTest method should_load_global_propertyset_settings.
@Test
public void should_load_global_propertyset_settings() {
Builder valuesBuilder = Value.newBuilder();
valuesBuilder.getMutableValue().put("filepattern", "**/*.xml");
valuesBuilder.getMutableValue().put("rulepattern", "*:S12345");
Value value1 = valuesBuilder.build();
valuesBuilder.clear();
valuesBuilder.getMutableValue().put("filepattern", "**/*.java");
valuesBuilder.getMutableValue().put("rulepattern", "*:S456");
Value value2 = valuesBuilder.build();
assertThat(DefaultSettingsLoader.toMap(asList(Setting.newBuilder().setKey("sonar.issue.exclusions.multicriteria").setFieldValues(FieldValues.newBuilder().addFieldValues(value1).addFieldValues(value2)).build()))).containsOnly(entry("sonar.issue.exclusions.multicriteria", "1,2"), entry("sonar.issue.exclusions.multicriteria.1.filepattern", "**/*.xml"), entry("sonar.issue.exclusions.multicriteria.1.rulepattern", "*:S12345"), entry("sonar.issue.exclusions.multicriteria.2.filepattern", "**/*.java"), entry("sonar.issue.exclusions.multicriteria.2.rulepattern", "*:S456"));
}