@Test public void testDelete() throws IOException { putSync(HttpRequest.createTestRequest("http: assertEquals(tenantRepository.getTenant(a).getName(), a); TenantDeleteResponse delResp = (TenantDeleteResponse) handler.handleDELETE( HttpRequest.createTestRequest("http: assertResponseEquals(delResp, "{\"message\":\"Tenant a deleted.\"}"); assertNull(tenantRepository.getTenant(a)); }
@Override protected HttpResponse handleDELETE(HttpRequest request) { final TenantName tenantName = getTenantNameFromRequest(request); Utils.checkThatTenantExists(tenantRepository, tenantName); applicationRepository.deleteTenant(tenantName); return new TenantDeleteResponse(tenantName); }
TenantHandler extends HttpHandler { @Override protected HttpResponse handleDELETE(HttpRequest request) { final TenantName tenantName = getTenantNameFromRequest(request); Utils.checkThatTenantExists(tenantRepository, tenantName); applicationRepository.deleteTenant(tenantName); return new TenantDeleteResponse(tenantName); } }
TenantHandler extends HttpHandler { @Override protected HttpResponse handleDELETE(HttpRequest request) { final TenantName tenantName = getTenantNameFromRequest(request); Utils.checkThatTenantExists(tenantRepository, tenantName); applicationRepository.deleteTenant(tenantName); return new TenantDeleteResponse(tenantName); } @Inject  TenantHandler(Context ctx, ApplicationRepository applicationRepository); }
TenantHandler extends HttpHandler { @Override protected HttpResponse handleDELETE(HttpRequest request) { final TenantName tenantName = getTenantNameFromRequest(request); Utils.checkThatTenantExists(tenantRepository, tenantName); applicationRepository.deleteTenant(tenantName); return new TenantDeleteResponse(tenantName); } @Inject  TenantHandler(Context ctx, ApplicationRepository applicationRepository);  }
TenantHandler extends HttpHandler { @Override protected HttpResponse handleDELETE(HttpRequest request) { final TenantName tenantName = getTenantNameFromRequest(request); Utils.checkThatTenantExists(tenantRepository, tenantName); applicationRepository.deleteTenant(tenantName); return new TenantDeleteResponse(tenantName); } @Inject  TenantHandler(Context ctx, ApplicationRepository applicationRepository);   }