public void testSnapshot() throws InterruptedException { server.enqueue(jsonResponse("/snapshot.json")); Action action = api.dropletApi().snapshot(1, "foo"); assertEquals(action, actionFromResource("/snapshot.json")); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/droplets/1/actions", "{\"type\":\"snapshot\",\"name\":\"foo\"}"); }
public void testReboot() throws InterruptedException { server.enqueue(jsonResponse("/reboot.json")); Action action = api.dropletApi().reboot(1); assertEquals(action, actionFromResource("/reboot.json")); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/droplets/1/actions", "{\"type\":\"reboot\"}"); }
public void testPowerOn() throws InterruptedException { server.enqueue(jsonResponse("/power-on.json")); Action action = api.dropletApi().powerOn(1); assertEquals(action, actionFromResource("/power-on.json")); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/droplets/1/actions", "{\"type\":\"power_on\"}"); }
public void testShutdown() throws InterruptedException { server.enqueue(jsonResponse("/shutdown.json")); Action action = api.dropletApi().shutdown(1); assertEquals(action, actionFromResource("/shutdown.json")); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/droplets/1/actions", "{\"type\":\"shutdown\"}"); }
public void testPowerCycleDroplet() throws InterruptedException { server.enqueue(jsonResponse("/power-cycle.json")); Action action = api.dropletApi().powerCycle(1); assertEquals(action, actionFromResource("/power-cycle.json")); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/droplets/1/actions", "{\"type\":\"power_cycle\"}"); }
public void testPowerOff() throws InterruptedException { server.enqueue(jsonResponse("/power-off.json")); Action action = api.dropletApi().powerOff(1); assertEquals(action, actionFromResource("/power-off.json")); assertEquals(server.getRequestCount(), 1); assertSent(server, "POST", "/droplets/1/actions", "{\"type\":\"power_off\"}"); }