@Test(expected=NotFoundException.class) public void testGetNonExisting() { handler.handleGET(HttpRequest.createTestRequest("http: }
@Override protected HttpResponse handleGET(HttpRequest request) { if (isGetTenantRequest(request)) { final TenantName tenantName = getTenantNameFromRequest(request); Utils.checkThatTenantExists(tenantRepository, tenantName); return new TenantGetResponse(tenantName); } else if (isListTenantsRequest(request)) { return new ListTenantsResponse(ImmutableSet.copyOf(tenantRepository.getAllTenantNames())); } else { throw new BadRequestException(request.getUri().toString()); } }
TenantHandler extends HttpHandler { @Override protected HttpResponse handleGET(HttpRequest request) { if (isGetTenantRequest(request)) { final TenantName tenantName = getTenantNameFromRequest(request); Utils.checkThatTenantExists(tenantRepository, tenantName); return new TenantGetResponse(tenantName); } else if (isListTenantsRequest(request)) { return new ListTenantsResponse(ImmutableSet.copyOf(tenantRepository.getAllTenantNames())); } else { throw new BadRequestException(request.getUri().toString()); } } }
TenantHandler extends HttpHandler { @Override protected HttpResponse handleGET(HttpRequest request) { if (isGetTenantRequest(request)) { final TenantName tenantName = getTenantNameFromRequest(request); Utils.checkThatTenantExists(tenantRepository, tenantName); return new TenantGetResponse(tenantName); } else if (isListTenantsRequest(request)) { return new ListTenantsResponse(ImmutableSet.copyOf(tenantRepository.getAllTenantNames())); } else { throw new BadRequestException(request.getUri().toString()); } } @Inject  TenantHandler(Context ctx, ApplicationRepository applicationRepository); }
TenantHandler extends HttpHandler { @Override protected HttpResponse handleGET(HttpRequest request) { if (isGetTenantRequest(request)) { final TenantName tenantName = getTenantNameFromRequest(request); Utils.checkThatTenantExists(tenantRepository, tenantName); return new TenantGetResponse(tenantName); } else if (isListTenantsRequest(request)) { return new ListTenantsResponse(ImmutableSet.copyOf(tenantRepository.getAllTenantNames())); } else { throw new BadRequestException(request.getUri().toString()); } } @Inject  TenantHandler(Context ctx, ApplicationRepository applicationRepository);  }
TenantHandler extends HttpHandler { @Override protected HttpResponse handleGET(HttpRequest request) { if (isGetTenantRequest(request)) { final TenantName tenantName = getTenantNameFromRequest(request); Utils.checkThatTenantExists(tenantRepository, tenantName); return new TenantGetResponse(tenantName); } else if (isListTenantsRequest(request)) { return new ListTenantsResponse(ImmutableSet.copyOf(tenantRepository.getAllTenantNames())); } else { throw new BadRequestException(request.getUri().toString()); } } @Inject  TenantHandler(Context ctx, ApplicationRepository applicationRepository);   }