ApplicationHandler extends HttpHandler { private HttpResponse restart(HttpRequest request, ApplicationId applicationId) { if (getBindingMatch(request).groupCount() != 7) throw new NotFoundException("Illegal POST restart request '" + request.getUri() + "': Must have 6 arguments but had " + ( getBindingMatch(request).groupCount()-1 ) ); applicationRepository.restart(applicationId, hostFilterFrom(request)); return new JSONResponse(Response.Status.OK); } @Inject  ApplicationHandler(HttpHandler.Context ctx,
                              Zone zone,
                              ApplicationRepository applicationRepository); @Override HttpResponse handleDELETE(HttpRequest request); @Override HttpResponse handleGET(HttpRequest request); @Override HttpResponse handlePOST(HttpRequest request);  }
@Test public void testRestart() throws Exception { applicationRepository.deploy(testApp, prepareParams(applicationId)); assertFalse(provisioner.restarted); restart(applicationId, Zone.defaultZone()); assertTrue(provisioner.restarted); assertEquals(applicationId, provisioner.lastApplicationId); }