Package org.jclouds.azure.management

Examples of org.jclouds.azure.management.AzureManagementApi


           
      HttpResponse createResponse = HttpResponse.builder()
                                                .addHeader("x-ms-request-id", "171f77920784404db208200702e59227")
                                                .statusCode(201).build();

      AzureManagementApi apiWhenExist = requestSendsResponse(create, createResponse);

      assertEquals(
               apiWhenExist.getHostedServiceApi().createServiceWithLabelInLocation(SERVICE_NAME, "service mine",
                        "West US"), "171f77920784404db208200702e59227");
   }
View Full Code Here


      HttpResponse createResponse = HttpResponse.builder()
                                                .addHeader("x-ms-request-id", "171f77920784404db208200702e59227")
                                                .statusCode(201).build();
     
      AzureManagementApi apiWhenExist = requestSendsResponse(create, createResponse);
     
      assertEquals(
               apiWhenExist.getHostedServiceApi().createServiceWithLabelInLocation(SERVICE_NAME, "service mine",
                        "West US",
                        description("my description").extendedProperties(ImmutableMap.of("Role", "Production"))),
               "171f77920784404db208200702e59227");
   }
View Full Code Here

  
   public void testGetWhenResponseIs2xx() throws Exception {
      HttpResponse getResponse = HttpResponse.builder().statusCode(200)
               .payload(payloadFromResourceWithContentType("/hostedservice.xml", "application")).build();

      AzureManagementApi apiWhenExist = requestSendsResponse(get, getResponse);

      assertEquals(apiWhenExist.getHostedServiceApi().get(SERVICE_NAME).toString(), new GetHostedServiceTest().expected().toString());
   }
View Full Code Here

   }

   public void testGetWhenResponseIs404() throws Exception {
      HttpResponse getResponse = HttpResponse.builder().statusCode(404).build();

      AzureManagementApi apiWhenDontExist = requestSendsResponse(get, getResponse);

      assertNull(apiWhenDontExist.getHostedServiceApi().get(SERVICE_NAME));
   }
View Full Code Here

  
   public void testGetDetailsWhenResponseIs2xx() throws Exception {
      HttpResponse getResponse = HttpResponse.builder().statusCode(200)
               .payload(payloadFromResourceWithContentType("/hostedservice_details.xml", "application")).build();

      AzureManagementApi apiWhenExist = requestSendsResponse(getDetails, getResponse);

      assertEquals(apiWhenExist.getHostedServiceApi().getDetails(SERVICE_NAME).toString(), new GetHostedServiceDetailsTest().expected().toString());
   }
View Full Code Here

   }

   public void testGetDetailsWhenResponseIs404() throws Exception {
      HttpResponse getResponse = HttpResponse.builder().statusCode(404).build();

      AzureManagementApi apiWhenDontExist = requestSendsResponse(getDetails, getResponse);

      assertNull(apiWhenDontExist.getHostedServiceApi().getDetails(SERVICE_NAME));
   }
View Full Code Here

   public void testDeleteWhenResponseIs2xx() throws Exception {
      HttpResponse deleteResponse = HttpResponse.builder()
                                                .addHeader("x-ms-request-id", "171f77920784404db208200702e59227")
                                                .statusCode(200).build();

      AzureManagementApi apiWhenExist = requestSendsResponse(delete, deleteResponse);

      assertEquals(apiWhenExist.getHostedServiceApi().delete(SERVICE_NAME), "171f77920784404db208200702e59227");
   }
View Full Code Here

   }

   public void testDeleteWhenResponseIs404() throws Exception {
      HttpResponse deleteResponse = HttpResponse.builder().statusCode(404).build();

      AzureManagementApi apiWhenDontExist = requestSendsResponse(delete, deleteResponse);

      assertNull(apiWhenDontExist.getHostedServiceApi().delete(SERVICE_NAME));
   }
View Full Code Here

TOP

Related Classes of org.jclouds.azure.management.AzureManagementApi

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.