> + */
> +@Test(groups = "unit", testName = "KeysApiMockTest")
> +public class KeysApiMockTest extends BaseEtcdMockTest {
> +
> + public void testCreateKey() throws Exception {
> + MockWebServer server = mockEtcdJavaWebServer();
> +
> + server.enqueue(new
> MockResponse().setBody(payloadFromResource("/keys-create.json")).setResponseCode(201));
> + EtcdApi etcdApi = api(server.getUrl("/"));
> + KeysApi api = etcdApi.keysApi();
> + try {
> + Key createdKey = api.createKey("hello", "world");
> + assertNotNull(createdKey);
> + assertTrue(createdKey.node().key().equals("/hello"));
> + assertTrue(createdKey.node().value().equals("world"));
> + assertSent(server, "PUT", "/" + EtcdApiMetadata.API_VERSION +
> "/keys/hello");
You need to verify that the body (the form params in this case) are also
properly sent.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/234/files#r52989196