Examples of DigitalOceanApi


Examples of org.jclouds.digitalocean.DigitalOceanApi

   public void testDestroyWithOptionsNonexistentDroplet() throws Exception {
      MockWebServer server = mockWebServer();
      server.enqueue(new MockResponse().setResponseCode(404));

      DigitalOceanApi api = api(server.getUrl("/"));
      DropletApi dropletApi = api.getDropletApi();

      try {
         try {
            dropletApi.destroy(1, true);
            fail("Destroy droplet should fail on 404");
         } catch (ResourceNotFoundException ex) {
            // Expected exception
         }

         assertRequestHasParameters(server.takeRequest(), "/droplets/1/destroy",
               ImmutableMultimap.of("scrub_data", "true"));
      } finally {
         api.close();
         server.shutdown();
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.