Package com.squareup.okhttp.mockwebserver

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


         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         TemporaryUrlSigner.checkApiEvery(api.accountApiInRegion("DFW"), 10000)
            .sign("GET","/v1/AUTH_account/container/object", 1323479485l);
      } finally {
         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         assertEquals(server.takeRequest().getRequestLine(),
               "HEAD /v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/ HTTP/1.1");
         server.shutdown();
      }
   }
View Full Code Here


         TemporaryUrlSigner.checkApiEvery(api.accountApiInRegion("DFW"), 10000)
            .sign("GET","/v1/AUTH_account/container/object", 1323479485l);
      } finally {
         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         assertEquals(server.takeRequest().getRequestLine(),
               "HEAD /v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/ HTTP/1.1");
         server.shutdown();
      }
   }
}
View Full Code Here

      DropletApi dropletApi = api.getDropletApi();

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

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

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

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

      DropletApi dropletApi = api.getDropletApi();

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

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

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

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

      DropletApi dropletApi = api.getDropletApi();

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

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

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

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

      DropletApi dropletApi = api.getDropletApi();

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

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

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

         assertRequestHasParameters(server.takeRequest(), "/droplets/1/snapshot", ImmutableMultimap.of("name", "foo"));
      } 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.