jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds-labs] add docker NetworkAPI (#221)
Date Wed, 11 Nov 2015 10:49:54 GMT
> +
> +      try {
> +         api.removeNetwork(networkId);
> +         assertSent(server, "DELETE", "/networks/" + networkId);
> +
> +      } finally {
> +         server.shutdown();
> +      }
> +   }
> +
> +   public void testConnectContainerToNetwork() throws Exception {
> +      MockWebServer server = mockWebServer(new MockResponse().setResponseCode(200));
> +      NetworkApi api = api(DockerApi.class, server.getUrl("/").toString()).getNetworkApi();
> +      try {
> +         api.connectContainerToNetwork("1", "containerName");
> +         assertSent(server, "POST", "/networks/1/connect");

What I mean, is that the call generates a body; not only a requestLine. The assertSent should
also verify that it is sending the right payload. Take as an example the [GCE mock tests](https://github.com/jclouds/jclouds/blob/master/providers/google-compute-engine/src/test/java/org/jclouds/googlecomputeengine/features/InstanceApiMockTest.java#L85-L117).
This should be applied to all mock test classes, but let's fix just the network mock in this
PR.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/221/files#r44520654
Mime
View raw message