Package com.squareup.okhttp.mockwebserver

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


      DropletApi dropletApi = api.getDropletApi();

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

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


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

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

      DropletApi dropletApi = api.getDropletApi();

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

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

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

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

      DropletApi dropletApi = api.getDropletApi();

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

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

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

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

      DropletApi dropletApi = api.getDropletApi();

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

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

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

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

      KeyPairApi keyPairApi = api.getKeyPairApi();

      try {
         List<SshKey> keys = keyPairApi.list();

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

      KeyPairApi keyPairApi = api.getKeyPairApi();

      try {
         SshKey key = keyPairApi.get(47);

         assertRequestHasCommonFields(server.takeRequest(), "/ssh_keys/47");
         assertEquals(key.getId(), 47);
         assertEquals(key.getName(), "my_key");
         assertNotNull(key.getPublicKey());
      } finally {
         api.close();
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.