use of org.sonar.api.server.ws.internal.SimpleGetRequest in project sonarqube by SonarSource.
the class QProfileRefTest method create_name_ref_from_ws_request.
@Test
public void create_name_ref_from_ws_request() {
SimpleGetRequest req = new SimpleGetRequest();
req.setParam("language", "js");
req.setParam("profileName", "Sonar way");
QProfileRef ref = QProfileRef.from(req);
assertThat(ref.getLanguage()).isEqualTo("js");
assertThat(ref.getName()).isEqualTo("Sonar way");
}
use of org.sonar.api.server.ws.internal.SimpleGetRequest in project sonarqube by SonarSource.
the class QProfileRefTest method create_key_ref_from_ws_request.
@Test
public void create_key_ref_from_ws_request() {
SimpleGetRequest req = new SimpleGetRequest();
req.setParam("profileKey", "foo");
QProfileRef ref = QProfileRef.from(req);
assertThat(ref.getKey()).isEqualTo("foo");
}
use of org.sonar.api.server.ws.internal.SimpleGetRequest in project sonarqube by SonarSource.
the class QProfileRefTest method throw_IAE_if_request_does_not_define_ref.
@Test
public void throw_IAE_if_request_does_not_define_ref() {
SimpleGetRequest req = new SimpleGetRequest();
expectedException.expect(IllegalArgumentException.class);
QProfileRef.from(req);
}
use of org.sonar.api.server.ws.internal.SimpleGetRequest in project sonarqube by SonarSource.
the class QProfileRefTest method create_name_ref_throws_IAE_if_language_is_missing.
@Test
public void create_name_ref_throws_IAE_if_language_is_missing() {
SimpleGetRequest req = new SimpleGetRequest();
req.setParam(QProfileRef.PARAM_PROFILE_KEY, "the key");
req.setParam(QProfileRef.PARAM_PROFILE_NAME, "the name");
expectedException.expect(IllegalArgumentException.class);
QProfileRef.from(req);
}
Aggregations