BCSalesService { public BCCouponTemplatesResult queryCouponTemplates(BCCouponTemplateCriteria templateCriteria) { String url = BCHttpClientUtil.BEECLOUD_HOST + "/2/rest/coupon/template"; return (BCCouponTemplatesResult) BCHttpClientUtil.queryRestObjects(url, BCHttpClientUtil.objectToMap(templateCriteria), BCCouponTemplatesResult.class, true, true); }  BCCouponResult createCoupon(String templateId, String userId); BCCouponResult queryCoupon(String id); BCCouponsResult queryCoupons(BCCouponCriteria couponCriteria); BCCouponTemplateResult queryCouponTemplate(String id); BCCouponTemplatesResult queryCouponTemplates(BCCouponTemplateCriteria templateCriteria);  }
@Test public void testQueryCouponTemplates() { BCCouponTemplateCriteria templateCriteria = new BCCouponTemplateCriteria(); templateCriteria.setName("111111111111"); BCCouponTemplatesResult templatesResult = couponService.queryCouponTemplates(templateCriteria); Assert.assertTrue(templatesResult.getResultCode() == 0); List<BCCouponTemplate> couponTemplates = templatesResult.getCouponTemplates(); System.out.println(couponTemplates.size()); if (couponTemplates.size() > 0) { BCCouponTemplate couponTemplate = couponTemplates.get(0); Assert.assertTrue(couponTemplate.getName().equals("111111111111")); } }