Package org.sonar.wsclient.internal

Examples of org.sonar.wsclient.internal.HttpRequestFactory


    assertThat(result).isNotNull();
  }

  @Test
  public void should_delete_action_plan() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());

    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    client.delete("382f6f2e-ad9d-424a-b973-9b065e04348a");

    assertThat(httpServer.requestedPath()).isEqualTo("/api/action_plans/delete");
View Full Code Here


    );
  }

  @Test
  public void should_fail_to_delete_action_plan() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubStatusCode(500);

    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    try {
      client.delete("382f6f2e-ad9d-424a-b973-9b065e04348a");
View Full Code Here

    }
  }

  @Test
  public void should_open_action_plan() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");

    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    ActionPlan result = client.open("382f6f2e-ad9d-424a-b973-9b065e04348a");
View Full Code Here

    assertThat(result).isNotNull();
  }

  @Test
  public void should_close_action_plan() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"actionPlan\": {\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\"}}");

    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    ActionPlan result = client.close("382f6f2e-ad9d-424a-b973-9b065e04348a");
View Full Code Here

  @Rule
  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();

  @Before
  public void setUp() {
    requestFactory = new HttpRequestFactory(httpServer.url());
    client = new DefaultUserClient(requestFactory);
  }
View Full Code Here

  @Rule
  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();

  @Test
  public void should_create_qualitygate() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());

    httpServer.stubResponseBody("{\"id\":666,\"name\":\"Ninth\"}");

    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
    QualityGate result = client.create("Ninth");
View Full Code Here

    assertThat(result.name()).isEqualTo("Ninth");
  }

  @Test
  public void should_list_qualitygates() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());

    httpServer.stubResponseBody(
        "{\"qualitygates\":[{\"id\":666,\"name\":\"Ninth\"},{\"id\":42,\"name\":\"Golden\"},{\"id\":43,\"name\":\"Star\"}],\"default\":42}");

    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
View Full Code Here

  @Rule
  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();

  @Test
  public void should_find_issues() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"issues\": [{\"key\": \"ABCDE\"}]}");

    IssueClient client = new DefaultIssueClient(requestFactory);
    IssueQuery query = IssueQuery.create().issues("ABCDE");
    Issues issues = client.find(query);
View Full Code Here

    assertThat(issues.list().get(0).key()).isEqualTo("ABCDE");
  }

  @Test
  public void should_fail_to_find_issues() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubStatusCode(500);

    IssueClient client = new DefaultIssueClient(requestFactory);
    try {
      client.find(IssueQuery.create());
View Full Code Here

    }
  }

  @Test
  public void should_set_severity() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"issue\": {\"key\": \"ABCDE\"}}");

    IssueClient client = new DefaultIssueClient(requestFactory);
    Issue result = client.setSeverity("ABCDE", "BLOCKER");
View Full Code Here

TOP

Related Classes of org.sonar.wsclient.internal.HttpRequestFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.