Package org.sonar.wsclient.internal

Examples of org.sonar.wsclient.internal.HttpRequestFactory


        );
  }

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

    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);

    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
    client.setDefault(666L);
View Full Code Here


        );
  }

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

    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);

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

    assertThat(httpServer.requestParams()).isEmpty();
  }

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

    httpServer.stubResponseBody("{\"id\":42,\"metric\":\"new_coverage\",\"op\":\"LT\",\"warning\":\"90\",\"error\":\"80\",\"period\":3}");

    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
    QualityGateCondition result = client.createCondition(NewCondition.create(12345L)
View Full Code Here

    assertThat(result.id()).isEqualTo(42L);
  }

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

    httpServer.stubResponseBody("{\"id\":12345,\"metric\":\"ncloc\",\"op\":\"GT\",\"warning\":\"1000\",\"error\":\"2000\",\"period\":1}");

    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
    QualityGateCondition result = client.updateCondition(UpdateCondition.create(12345L)
View Full Code Here

    assertThat(result.id()).isEqualTo(12345L);
  }

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

    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);

    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
    client.deleteCondition(666L);;
View Full Code Here

        );
  }

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

    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);

    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
    client.selectProject(666L, 999L);
View Full Code Here

        );
  }

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

    httpServer.stubStatusCode(HttpURLConnection.HTTP_NO_CONTENT);

    QualityGateClient client = new DefaultQualityGateClient(requestFactory);
    client.deselectProject(666L, 999L);
View Full Code Here

  @Rule
  public MockHttpServerInterceptor httpServer = new MockHttpServerInterceptor();

  @Test
  public void should_find_action_plans() {
    HttpRequestFactory requestFactory = new HttpRequestFactory(httpServer.url());
    httpServer.stubResponseBody("{\"actionPlans\": [{\"key\": \"382f6f2e-ad9d-424a-b973-9b065e04348a\",\n" +
      "\"name\": \"Long term\",\n" +
      "\"desc\": \"Long term acton plan\",\n" +
      "\"status\": \"CLOSED\",\n" +
      "\"project\": \"com.sonarsource.it.samples:simple-sample\",\n" +
View Full Code Here

    assertThat(actionPlan.updatedAt()).isNotNull();
  }

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

    ActionPlanClient client = new DefaultActionPlanClient(requestFactory);
    ActionPlan result = client.create(
      NewActionPlan.create().name("Short term").project("org.sonar.Sample").description("Short term issues").deadLine(stringToDate("2014-01-01")));
View Full Code Here

    assertThat(result).isNotNull();
  }

  @Test
  public void should_update_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.update(
      UpdateActionPlan.create().key("382f6f2e-ad9d-424a-b973-9b065e04348a").name("Short term").description("Short term issues").deadLine(stringToDate("2014-01-01")));
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.