Package com.squareup.okhttp.mockwebserver

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


      DropletApi dropletApi = api.getDropletApi();

      try {
         int event = dropletApi.restore(1, 3);

         assertRequestHasParameters(server.takeRequest(), "/droplets/1/restore", ImmutableMultimap.of("image_id", "3"));
         assertTrue(event > 0);
      } finally {
         api.close();
         server.shutdown();
      }
View Full Code Here


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

         assertRequestHasParameters(server.takeRequest(), "/droplets/1/restore", ImmutableMultimap.of("image_id", "3"));
      } finally {
         api.close();
         server.shutdown();
      }
   }
View Full Code Here

      DropletApi dropletApi = api.getDropletApi();

      try {
         int event = dropletApi.rebuild(1, 3);

         assertRequestHasParameters(server.takeRequest(), "/droplets/1/rebuild", ImmutableMultimap.of("image_id", "3"));
         assertTrue(event > 0);
      } finally {
         api.close();
         server.shutdown();
      }
View Full Code Here

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

         assertRequestHasParameters(server.takeRequest(), "/droplets/1/rebuild", ImmutableMultimap.of("image_id", "3"));
      } finally {
         api.close();
         server.shutdown();
      }
   }
View Full Code Here

      DropletApi dropletApi = api.getDropletApi();

      try {
         int event = dropletApi.rename(1, "foo");

         assertRequestHasParameters(server.takeRequest(), "/droplets/1/rename", ImmutableMultimap.of("name", "foo"));
         assertTrue(event > 0);
      } finally {
         api.close();
         server.shutdown();
      }
View Full Code Here

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

         assertRequestHasParameters(server.takeRequest(), "/droplets/1/rename", ImmutableMultimap.of("name", "foo"));
      } finally {
         api.close();
         server.shutdown();
      }
   }
View Full Code Here

      DropletApi dropletApi = api.getDropletApi();

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

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

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

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

      DropletApi dropletApi = api.getDropletApi();

      try {
         int event = dropletApi.destroy(1, true);

         assertRequestHasParameters(server.takeRequest(), "/droplets/1/destroy",
               ImmutableMultimap.of("scrub_data", "true"));
         assertTrue(event > 0);
      } finally {
         api.close();
         server.shutdown();
View Full Code Here

            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.