Package com.squareup.okhttp.mockwebserver

Examples of com.squareup.okhttp.mockwebserver.MockWebServer.takeRequest()


      EventApi eventApi = api.getEventApi();

      try {
         Event event = eventApi.get(7499);

         assertRequestHasCommonFields(server.takeRequest(), "/events/7499");
         assertNotNull(event);
         assertEquals(event.getStatus(), Status.DONE);
      } finally {
         api.close();
         server.shutdown();
View Full Code Here


      EventApi eventApi = api.getEventApi();

      try {
         Event event = eventApi.get(7499);

         assertRequestHasCommonFields(server.takeRequest(), "/events/7499");
         assertNotNull(event);
         assertEquals(event.getStatus(), Status.PENDING);
      } finally {
         api.close();
         server.shutdown();
View Full Code Here

      EventApi eventApi = api.getEventApi();

      try {
         Event event = eventApi.get(7499);

         assertRequestHasCommonFields(server.takeRequest(), "/events/7499");
         assertNull(event);
      } finally {
         api.close();
         server.shutdown();
      }
View Full Code Here

      DropletApi dropletApi = api.getDropletApi();

      try {
         List<Droplet> sizes = dropletApi.list();

         assertRequestHasCommonFields(server.takeRequest(), "/droplets");
         assertEquals(sizes.size(), 1);
      } finally {
         api.close();
         server.shutdown();
      }
View Full Code Here

      DropletApi dropletApi = api.getDropletApi();

      try {
         Droplet droplet = dropletApi.get(100823);

         assertRequestHasCommonFields(server.takeRequest(), "/droplets/100823");
         assertNotNull(droplet);
         assertNotNull(droplet.getBackups());
         assertNotNull(droplet.getSnapshots());
         assertEquals(droplet.getName(), "test222");
         assertEquals(droplet.getStatus(), Status.ACTIVE);
View Full Code Here

      DropletApi dropletApi = api.getDropletApi();

      try {
         Droplet droplet = dropletApi.get(100823);

         assertRequestHasCommonFields(server.takeRequest(), "/droplets/100823");
         assertNull(droplet);
      } finally {
         api.close();
         server.shutdown();
      }
View Full Code Here

      DropletApi dropletApi = api.getDropletApi();

      try {
         DropletCreation droplet = dropletApi.create("test", 419, 32, 1);

         assertRequestHasParameters(server.takeRequest(), "/droplets/new",
               ImmutableMultimap.of("name", "test", "image_id", "419", "size_id", "32", "region_id", "1"));

         assertNotNull(droplet);
         assertEquals(droplet.getName(), "test");
      } finally {
View Full Code Here

         params.put("region_id", "1");
         params.put("ssh_key_ids", "5,4");
         params.put("private_networking", "true");
         params.put("backups_enabled", "false");

         assertRequestHasParameters(server.takeRequest(), "/droplets/new", params.build());

         assertNotNull(droplet);
         assertEquals(droplet.getName(), "test");
      } finally {
         api.close();
View Full Code Here

      DropletApi dropletApi = api.getDropletApi();

      try {
         int event = dropletApi.reboot(1);

         assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/reboot");
         assertTrue(event > 0);
      } finally {
         api.close();
         server.shutdown();
      }
View Full Code Here

            fail("Reboot droplet should fail on 404");
         } catch (ResourceNotFoundException ex) {
            // Expected exception
         }

         assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/reboot");
      } 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.