use of org.sonar.db.property.PropertyDto in project sonarqube by SonarSource.
the class ProjectSettingsFactoryTest method return_project_settings.
@Test
public void return_project_settings() {
when(dbClient.propertiesDao().selectProjectProperties(PROJECT_KEY)).thenReturn(newArrayList(new PropertyDto().setKey("1").setValue("val1"), new PropertyDto().setKey("2").setValue("val2"), new PropertyDto().setKey("3").setValue("val3")));
Settings projectSettings = underTest.newProjectSettings(PROJECT_KEY);
assertThat(projectSettings.getString("1")).isEqualTo("val1");
assertThat(projectSettings.getString("2")).isEqualTo("val2");
assertThat(projectSettings.getString("3")).isEqualTo("val3");
}
use of org.sonar.db.property.PropertyDto in project sonarqube by SonarSource.
the class ProjectSettingsFactoryTest method project_settings_override_global_settings.
@Test
public void project_settings_override_global_settings() {
settings.setProperty("key", "value");
when(dbClient.propertiesDao().selectProjectProperties(PROJECT_KEY)).thenReturn(newArrayList(new PropertyDto().setKey("key").setValue("value2")));
Settings projectSettings = underTest.newProjectSettings(PROJECT_KEY);
assertThat(projectSettings.getString("key")).isEqualTo("value2");
}
Aggregations