Package org.sonar.wsclient.internal

Examples of org.sonar.wsclient.internal.HttpRequestFactory


    assertThat(result).isNotNull();
  }

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

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


    assertThat(result).isNotNull();
  }

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

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

    assertThat(result).isNotNull();
  }

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

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

    assertThat(result).isNotNull();
  }

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

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

    assertThat(result).isNotNull();
  }

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

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

    assertThat(result).isNotNull();
  }

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

    IssueClient client = new DefaultIssueClient(requestFactory);
    Issue result = client.create(NewIssue.create().component("Action.java").rule("squid:AvoidCycle"));
View Full Code Here

    assertThat(result).isNotNull();
  }

  @Test
  public void should_get_transitions() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\n" +
      "  \"transitions\": [\n" +
      "    \"resolve\",\n" +
      "    \"falsepositive\"\n" +
      "  ]\n" +
View Full Code Here

    assertThat(transitions).containsOnly("resolve", "falsepositive");
  }

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

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

    assertThat(result).isNotNull();
  }

  @Test
  public void should_add_comment() throws Exception {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody(IOUtils.toString(getClass().getResourceAsStream("/org/sonar/wsclient/issue/internal/DefaultIssueClientTest/add_comment_result.json")));

    IssueClient client = new DefaultIssueClient(requestFactory);
    IssueComment comment = client.addComment("ISSUE-1", "this is my comment");
View Full Code Here

    assertThat(comment.createdAt().getDate()).isEqualTo(18);
  }

  @Test
  public void should_get_actions() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\n" +
      "  \"actions\": [\n" +
      "    \"link-to-jira\",\n" +
      "    \"tweet\"\n" +
      "  ]\n" +
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.