Search in sources :

Example 51 with PropertyDto

use of org.sonar.db.property.PropertyDto in project sonarqube by SonarSource.

the class SetActionTest method assertGlobalSetting.

private void assertGlobalSetting(String key, String value) {
    PropertyDto result = dbClient.propertiesDao().selectGlobalProperty(key);
    assertThat(result).extracting(PropertyDto::getKey, PropertyDto::getValue, PropertyDto::getResourceId).containsExactly(key, value, null);
}
Also used : PropertyTesting.newComponentPropertyDto(org.sonar.db.property.PropertyTesting.newComponentPropertyDto) PropertyTesting.newGlobalPropertyDto(org.sonar.db.property.PropertyTesting.newGlobalPropertyDto) PropertyDto(org.sonar.db.property.PropertyDto)

Example 52 with PropertyDto

use of org.sonar.db.property.PropertyDto in project sonarqube by SonarSource.

the class LogServerIdTest method log_partial_information_if_property_is_set_without_value.

@Test
public void log_partial_information_if_property_is_set_without_value() {
    setProperty(CoreProperties.PERMANENT_SERVER_ID, "123456789");
    PropertyDto dto = new PropertyDto().setKey(CoreProperties.ORGANISATION).setValue(null);
    when(dbClient.propertiesDao().selectGlobalProperty(any(DbSession.class), eq(CoreProperties.ORGANISATION))).thenReturn(dto);
    underTest.start();
    verifyLog("\"123456789\"", "-", "-");
}
Also used : DbSession(org.sonar.db.DbSession) PropertyDto(org.sonar.db.property.PropertyDto) Test(org.junit.Test)

Example 53 with PropertyDto

use of org.sonar.db.property.PropertyDto in project sonarqube by SonarSource.

the class LogServerIdTest method setProperty.

private void setProperty(String propertyKey, @Nullable String propertyValue) {
    PropertyDto dto = null;
    if (propertyValue != null) {
        dto = new PropertyDto().setKey(propertyKey).setValue(propertyValue);
    }
    when(dbClient.propertiesDao().selectGlobalProperty(any(DbSession.class), eq(propertyKey))).thenReturn(dto);
}
Also used : DbSession(org.sonar.db.DbSession) PropertyDto(org.sonar.db.property.PropertyDto)

Example 54 with PropertyDto

use of org.sonar.db.property.PropertyDto in project sonarqube by SonarSource.

the class ClearRulesOverloadedDebtTest method insertSqaleProperty.

private void insertSqaleProperty() {
    dbClient.propertiesDao().saveProperty(dbSession, new PropertyDto().setKey("sonar.sqale.licenseHash.secured").setValue("ABCD"));
    dbSession.commit();
}
Also used : PropertyDto(org.sonar.db.property.PropertyDto)

Example 55 with PropertyDto

use of org.sonar.db.property.PropertyDto in project sonarqube by SonarSource.

the class GenerateActionTest method assertGlobalSetting.

private void assertGlobalSetting(String key, String value) {
    PropertyDto result = dbClient.propertiesDao().selectGlobalProperty(key);
    assertThat(result).extracting(PropertyDto::getKey, PropertyDto::getValue, PropertyDto::getResourceId).containsExactly(key, value, null);
}
Also used : PropertyDto(org.sonar.db.property.PropertyDto)

Aggregations

PropertyDto (org.sonar.db.property.PropertyDto)57 Test (org.junit.Test)25 ComponentDto (org.sonar.db.component.ComponentDto)23 OrganizationDto (org.sonar.db.organization.OrganizationDto)13 ProjectRepositories (org.sonar.scanner.protocol.input.ProjectRepositories)13 DbSession (org.sonar.db.DbSession)8 QualityGateDto (org.sonar.db.qualitygate.QualityGateDto)6 MapSettings (org.sonar.api.config.MapSettings)3 Settings (org.sonar.api.config.Settings)3 PropertyTesting.newComponentPropertyDto (org.sonar.db.property.PropertyTesting.newComponentPropertyDto)2 PropertyTesting.newGlobalPropertyDto (org.sonar.db.property.PropertyTesting.newGlobalPropertyDto)2 UserDto (org.sonar.db.user.UserDto)2 Date (java.util.Date)1 Matchers.anyString (org.mockito.Matchers.anyString)1 PropertyDefinition (org.sonar.api.config.PropertyDefinition)1 FilePathWithHashDto (org.sonar.db.component.FilePathWithHashDto)1 SnapshotDto (org.sonar.db.component.SnapshotDto)1 PropertyQuery (org.sonar.db.property.PropertyQuery)1 UserTesting.newUserDto (org.sonar.db.user.UserTesting.newUserDto)1 TestResponse (org.sonar.server.ws.TestResponse)1