use of org.sonarqube.ws.QualityProfiles.SearchWsResponse.QualityProfile in project sonarqube by SonarSource.
the class SearchActionTest method filter_on_language.
@Test
public void filter_on_language() {
QProfileDto profile1OnXoo1 = db.qualityProfiles().insert(p -> p.setLanguage(XOO1.getKey()));
QProfileDto profile2OnXoo1 = db.qualityProfiles().insert(p -> p.setLanguage(XOO1.getKey()));
QProfileDto profileOnXoo2 = db.qualityProfiles().insert(p -> p.setLanguage(XOO2.getKey()));
SearchWsResponse result = call(ws.newRequest().setParam(PARAM_LANGUAGE, XOO1.getKey()));
assertThat(result.getProfilesList()).extracting(QualityProfile::getKey).containsExactlyInAnyOrder(profile1OnXoo1.getKee(), profile2OnXoo1.getKee()).doesNotContain(profileOnXoo2.getKee());
}
use of org.sonarqube.ws.QualityProfiles.SearchWsResponse.QualityProfile in project sonarqube by SonarSource.
the class SearchActionTest method filter_on_profile_name.
@Test
public void filter_on_profile_name() {
QProfileDto sonarWayOnXoo1 = db.qualityProfiles().insert(p -> p.setName("Sonar way").setLanguage(XOO1.getKey()));
QProfileDto sonarWayOnXoo2 = db.qualityProfiles().insert(p -> p.setName("Sonar way").setLanguage(XOO1.getKey()));
QProfileDto sonarWayInCamelCase = db.qualityProfiles().insert(p -> p.setName("Sonar Way").setLanguage(XOO2.getKey()));
QProfileDto anotherProfile = db.qualityProfiles().insert(p -> p.setName("Another").setLanguage(XOO2.getKey()));
SearchWsResponse result = call(ws.newRequest().setParam(PARAM_QUALITY_PROFILE, "Sonar way"));
assertThat(result.getProfilesList()).extracting(QualityProfile::getKey).containsExactlyInAnyOrder(sonarWayOnXoo1.getKee(), sonarWayOnXoo2.getKee()).doesNotContain(anotherProfile.getKee(), sonarWayInCamelCase.getKee());
}
use of org.sonarqube.ws.QualityProfiles.SearchWsResponse.QualityProfile in project sonarqube by SonarSource.
the class SearchActionTest method filter_on_defaults_and_name.
@Test
public void filter_on_defaults_and_name() {
QProfileDto sonarWayOnXoo1 = db.qualityProfiles().insert(p -> p.setName("Sonar way").setLanguage(XOO1.getKey()));
QProfileDto sonarWayOnXoo2 = db.qualityProfiles().insert(p -> p.setName("Sonar way").setLanguage(XOO2.getKey()));
QProfileDto anotherProfile = db.qualityProfiles().insert(p -> p.setName("Another").setLanguage(XOO2.getKey()));
db.qualityProfiles().setAsDefault(sonarWayOnXoo1, anotherProfile);
SearchWsResponse result = call(ws.newRequest().setParam(PARAM_DEFAULTS, "true").setParam(PARAM_QUALITY_PROFILE, "Sonar way"));
assertThat(result.getProfilesList()).extracting(QualityProfile::getKey).containsExactlyInAnyOrder(sonarWayOnXoo1.getKee()).doesNotContain(sonarWayOnXoo2.getKee(), anotherProfile.getKee());
}
Aggregations