208209210211212213214215216217218
assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/power_cycle"); assertTrue(event > 0); } finally { api.close(); server.shutdown(); } } public void testPowerCycleNonexistentDroplet() throws Exception { MockWebServer server = mockWebServer();
230231232233234235236237238239240
} assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/power_cycle"); } finally { api.close(); server.shutdown(); } } public void testShutdownDroplet() throws Exception { MockWebServer server = mockWebServer();
248249250251252253254255256257258
assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/shutdown"); assertTrue(event > 0); } finally { api.close(); server.shutdown(); } } public void testShutdownNonexistentDroplet() throws Exception { MockWebServer server = mockWebServer();
270271272273274275276277278279280
} assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/shutdown"); } finally { api.close(); server.shutdown(); } } public void testPowerOffDroplet() throws Exception { MockWebServer server = mockWebServer();
288289290291292293294295296297298
assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/power_off"); assertTrue(event > 0); } finally { api.close(); server.shutdown(); } } public void testPowerOffNonexistentDroplet() throws Exception { MockWebServer server = mockWebServer();
310311312313314315316317318319320
} assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/power_off"); } finally { api.close(); server.shutdown(); } } public void testPowerOnDroplet() throws Exception { MockWebServer server = mockWebServer();
328329330331332333334335336337338
assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/power_on"); assertTrue(event > 0); } finally { api.close(); server.shutdown(); } } public void testPowerOnNonexistentDroplet() throws Exception { MockWebServer server = mockWebServer();
350351352353354355356357358359360
} assertRequestHasCommonFields(server.takeRequest(), "/droplets/1/power_on"); } finally { api.close(); server.shutdown(); } } public void testResetPasswordForDroplet() throws Exception { MockWebServer server = mockWebServer();
5556575859606162636465
assertRequestHasCommonFields(server.takeRequest(), "/ssh_keys"); assertEquals(keys.size(), 1); } finally { api.close(); server.shutdown(); } } public void testGetKey() throws Exception { MockWebServer server = mockWebServer();
7576777879808182838485
assertEquals(key.getId(), 47); assertEquals(key.getName(), "my_key"); assertNotNull(key.getPublicKey()); } finally { api.close(); server.shutdown(); } } public void testGetUnexistingKey() throws Exception { MockWebServer server = mockWebServer();