@Deprecated
	public static QuotaResponse getQuota(LimitAPI limitAPI, String namespace, String service, int count,
			Map<String, String> labels, String method) {
		// build quota request
		QuotaRequest quotaRequest = new QuotaRequest();
		quotaRequest.setNamespace(namespace);
		quotaRequest.setService(service);
		quotaRequest.setCount(count);
		quotaRequest.setLabels(labels);
		quotaRequest.setMethod(method);

		try {
			return limitAPI.getQuota(quotaRequest);
		}
		catch (Throwable throwable) {
			LOG.error("fail to invoke getQuota of LimitAPI with QuotaRequest[{}].", quotaRequest, throwable);
			return new QuotaResponse(new QuotaResult(QuotaResult.Code.QuotaResultOk, 0, "get quota failed"));
		}
	}
@Test
	public void testGetQuota() {
		// Pass
		String serviceName = "TestApp1";
		QuotaResponse quotaResponse = QuotaCheckUtils.getQuota(limitAPI, null, serviceName, 1, new HashMap<>(), null);
		assertThat(quotaResponse.getCode()).isEqualTo(QuotaResultCode.QuotaResultOk);
		assertThat(quotaResponse.getWaitMs()).isEqualTo(0);
		assertThat(quotaResponse.getInfo()).isEqualTo("QuotaResultOk");

		// Unirate waiting 1000ms
		serviceName = "TestApp2";
		quotaResponse = QuotaCheckUtils.getQuota(limitAPI, null, serviceName, 1, new HashMap<>(), null);
		assertThat(quotaResponse.getCode()).isEqualTo(QuotaResultCode.QuotaResultOk);
		assertThat(quotaResponse.getWaitMs()).isEqualTo(1000);
		assertThat(quotaResponse.getInfo()).isEqualTo("QuotaResultOk");

		// Rate limited
		serviceName = "TestApp3";
		quotaResponse = QuotaCheckUtils.getQuota(limitAPI, null, serviceName, 1, new HashMap<>(), null);
		assertThat(quotaResponse.getCode()).isEqualTo(QuotaResultCode.QuotaResultLimited);
		assertThat(quotaResponse.getWaitMs()).isEqualTo(0);
		assertThat(quotaResponse.getInfo()).isEqualTo("QuotaResultLimited");

		// Exception
		serviceName = "TestApp4";
		quotaResponse = QuotaCheckUtils.getQuota(limitAPI, null, serviceName, 1, new HashMap<>(), null);
		assertThat(quotaResponse.getCode()).isEqualTo(QuotaResultCode.QuotaResultOk);
		assertThat(quotaResponse.getWaitMs()).isEqualTo(0);
		assertThat(quotaResponse.getInfo()).isEqualTo("get quota failed");
	}