InstancesResource { @PUT @Path("/pause") @Consumes(APPLICATION_JSON) public Response pauseInstances(List<String> instanceIds) { instancesService.pauseInstances(instanceIds); return ok(); } @Autowired  InstancesResource(InstancesService instancesService); @GET @Path("/{instanceId}") Response getInstanceById(@PathParam("instanceId") String instanceId); @POST @Consumes(APPLICATION_JSON) Response launchInstances(List<Instance> instances); @PUT @Path("/start") @Consumes(APPLICATION_JSON) Response startInstances(List<String> instanceIds); @PUT @Path("/shutdown") @Consumes(APPLICATION_JSON) Response shutdownInstances(List<String> instanceIds); @PUT @Path("/pause") @Consumes(APPLICATION_JSON) Response pauseInstances(List<String> instanceIds); @PUT @Path("/resume") @Consumes(APPLICATION_JSON) Response resumeInstances(List<String> instanceIds); @PUT @Path("/suspend") @Consumes(APPLICATION_JSON) Response suspendInstances(List<String> instanceIds); @PUT @Path("/resize/{flavorId}") @Consumes(APPLICATION_JSON) Response resizeInstances(@PathParam("flavorId") String flavorId, List<String> instanceIds); @PUT @Path("/rebuild/{imageId}") @Consumes(APPLICATION_JSON) Response rebuildInstances(@PathParam("imageId") String imageId, List<String> instanceIds); @PUT @Path("/rename") @Consumes(APPLICATION_JSON) Response renameInstances(Map<String, String> newNames); @PUT @Path("/reboot") @Consumes(APPLICATION_JSON) Response rebootInstances(List<String> instanceIds); @PUT @Path("/hard-reboot") @Consumes(APPLICATION_JSON) Response hardRebootInstances(List<String> instanceIds); @POST @Path("/delete") @Consumes(APPLICATION_JSON) Response deleteInstances(List<String> instanceIds);  }
@Test public void testPauseInstances() throws Exception { testResponseIsSuccessful(instancesApi -> instancesApi.pause(getInstanceIds())); }