Package org.jclouds.http

Examples of org.jclouds.http.HttpRequest$ConcreteBuilder


      assertNull(api.delete("jclouds-test"));
   }

   public void testListNetworksResponseIs2xx() {
      HttpRequest list = HttpRequest
              .builder()
              .method("GET")
              .endpoint("https://www.googleapis" +
                      ".com/compute/v1beta13/projects/myproject/networks")
              .addHeader("Accept", "application/json")
View Full Code Here


      assertEquals(api.listFirstPage().toString(),
              new ParseNetworkListTest().expected().toString());
   }

   public void testListNetworksResponseIs4xx() {
      HttpRequest list = HttpRequest
              .builder()
              .method("GET")
              .endpoint("https://www.googleapis" +
                      ".com/compute/v1beta13/projects/myproject/networks")
              .addHeader("Accept", "application/json")
View Full Code Here

   public static final HttpResponse LIST_PROJECT_IMAGES_RESPONSE = HttpResponse.builder().statusCode(200)
           .payload(staticPayloadFromResource("/image_list.json")).build();

   public void testGetImageResponseIs2xx() throws Exception {
      HttpRequest get = HttpRequest
              .builder()
              .method("GET")
              .endpoint("https://www.googleapis" +
                      ".com/compute/v1beta13/projects/google/images/centos-6-2-v20120326")
              .addHeader("Accept", "application/json")
View Full Code Here

      assertEquals(imageApi.get("centos-6-2-v20120326"),
              new ParseImageTest().expected());
   }

   public void testGetImageResponseIs4xx() throws Exception {
      HttpRequest get = HttpRequest
              .builder()
              .method("GET")
              .endpoint("https://www.googleapis" +
                      ".com/compute/v1beta13/projects/google/images/centos-6-2-v20120326")
              .addHeader("Accept", "application/json")
View Full Code Here

      assertNull(imageApi.get("centos-6-2-v20120326"));
   }

   public void testDeleteImageResponseIs2xx() {
      HttpRequest delete = HttpRequest
              .builder()
              .method("DELETE")
              .endpoint("https://www.googleapis" +
                      ".com/compute/v1beta13/projects/myproject/images/centos-6-2-v20120326")
              .addHeader("Accept", "application/json")
View Full Code Here

      assertEquals(imageApi.delete("centos-6-2-v20120326"),
              new ParseOperationTest().expected());
   }

   public void testDeleteImageResponseIs4xx() {
      HttpRequest delete = HttpRequest
              .builder()
              .method("DELETE")
              .endpoint("https://www.googleapis" +
                      ".com/compute/v1beta13/projects/myproject/images/centos-6-2-v20120326")
              .addHeader("Accept", "application/json")
View Full Code Here

      assertNull(api.get("test-1"));
   }

   public void testGetInstanceSerialPortOutput() throws Exception {
      HttpRequest get = HttpRequest
              .builder()
              .method("GET")
              .endpoint("https://www.googleapis" +
                      ".com/compute/v1beta13/projects/myproject/instances/test-1/serialPort")
              .addHeader("Accept", "application/json")
View Full Code Here

      assertEquals(api.getSerialPortOutput("test-1"), new ParseInstanceSerialOutputTest().expected());
   }

   public void testInsertInstanceResponseIs2xxNoOptions() {
      HttpRequest insert = HttpRequest
              .builder()
              .method("POST")
              .endpoint("https://www.googleapis.com/compute/v1beta13/projects/myproject/instances")
              .addHeader("Accept", "application/json")
              .addHeader("Authorization", "Bearer " + TOKEN)
View Full Code Here

      assertEquals(api.createInZone("test-1", options, "us-central1-a"), new ParseOperationTest().expected());
   }

   public void testInsertInstanceResponseIs2xxAllOptions() {
      HttpRequest insert = HttpRequest
              .builder()
              .method("POST")
              .endpoint("https://www.googleapis.com/compute/v1beta13/projects/myproject/instances")
              .addHeader("Accept", "application/json")
              .addHeader("Authorization", "Bearer " + TOKEN)
View Full Code Here

      assertEquals(api.createInZone("test-0", options, "us-central1-a"),
              new ParseOperationTest().expected());
   }

   public void testDeleteInstanceResponseIs2xx() {
      HttpRequest delete = HttpRequest
              .builder()
              .method("DELETE")
              .endpoint("https://www.googleapis" +
                      ".com/compute/v1beta13/projects/myproject/instances/test-1")
              .addHeader("Accept", "application/json")
View Full Code Here

TOP

Related Classes of org.jclouds.http.HttpRequest$ConcreteBuilder

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.