Search in sources :

Example 41 with PostRequest

use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.

the class ProjectLinksServiceTest method create_does_POST_request.

@Test
public void create_does_POST_request() {
    underTest.create(new CreateWsRequest().setProjectId(PROJECT_ID_VALUE).setProjectKey(PROJECT_KEY_VALUE).setName(NAME_VALUE).setUrl(URL_VALUE));
    assertThat(serviceTester.getPostParser()).isSameAs(CreateWsResponse.parser());
    PostRequest postRequest = serviceTester.getPostRequest();
    serviceTester.assertThat(postRequest).hasPath("create").hasParam(PARAM_PROJECT_ID, PROJECT_ID_VALUE).hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_VALUE).hasParam(PARAM_NAME, NAME_VALUE).hasParam(PARAM_URL, URL_VALUE).andNoOtherParam();
}
Also used : PostRequest(org.sonarqube.ws.client.PostRequest) Test(org.junit.Test)

Example 42 with PostRequest

use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.

the class ProjectLinksServiceTest method delete_does_POST_request.

@Test
public void delete_does_POST_request() {
    underTest.delete(new DeleteWsRequest().setId(ID_VALUE));
    assertThat(serviceTester.getPostParser()).isNull();
    PostRequest postRequest = serviceTester.getPostRequest();
    serviceTester.assertThat(postRequest).hasPath("delete").hasParam(PARAM_ID, String.valueOf(ID_VALUE)).andNoOtherParam();
}
Also used : PostRequest(org.sonarqube.ws.client.PostRequest) Test(org.junit.Test)

Example 43 with PostRequest

use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.

the class QualityGatesServiceTest method create.

@Test
public void create() {
    underTest.create("Default");
    PostRequest request = serviceTester.getPostRequest();
    assertThat(serviceTester.getPostParser()).isSameAs(CreateWsResponse.parser());
    serviceTester.assertThat(request).hasParam(PARAM_NAME, "Default").andNoOtherParam();
}
Also used : PostRequest(org.sonarqube.ws.client.PostRequest) Test(org.junit.Test)

Example 44 with PostRequest

use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.

the class IssuesServiceTest method set_type.

@Test
public void set_type() {
    underTest.setType(new SetTypeRequest("ABCD", "bugs"));
    PostRequest request = serviceTester.getPostRequest();
    assertThat(serviceTester.getPostParser()).isSameAs(Issues.Operation.parser());
    serviceTester.assertThat(request).hasParam("issue", "ABCD").hasParam("type", "bugs").andNoOtherParam();
}
Also used : PostRequest(org.sonarqube.ws.client.PostRequest) Test(org.junit.Test)

Aggregations

PostRequest (org.sonarqube.ws.client.PostRequest)44 Test (org.junit.Test)33 MimeMessage (javax.mail.internet.MimeMessage)2 Before (org.junit.Before)2 WsClient (org.sonarqube.ws.client.WsClient)2 WsResponse (org.sonarqube.ws.client.WsResponse)2 WiserMessage (org.subethamail.wiser.WiserMessage)2 ItUtils.newAdminWsClient (util.ItUtils.newAdminWsClient)2 ItUtils.newUserWsClient (util.ItUtils.newUserWsClient)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 SonarScanner (com.sonar.orchestrator.build.SonarScanner)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 BeforeClass (org.junit.BeforeClass)1 ProjectDefinition (org.sonar.api.batch.bootstrap.ProjectDefinition)1 MessageException (org.sonar.api.utils.MessageException)1 QualityGate (org.sonar.wsclient.qualitygate.QualityGate)1 HttpException (org.sonarqube.ws.client.HttpException)1 Wiser (org.subethamail.wiser.Wiser)1 ProjectsPage (pageobjects.projects.ProjectsPage)1