target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testGetSandboxSignKey() throws Exception { final String signKey = this.payService.getSandboxSignKey(); assertNotNull(signKey); this.logger.info(signKey); }
@Override public String getSandboxSignKey() throws WxPayException { WxPayDefaultRequest request = new WxPayDefaultRequest(); request.checkAndSign(this.getConfig()); String url = "https: String responseContent = this.post(url, request.toXML(), false); WxPaySandboxSignKeyResult result = WxPayBaseResult.fromXML(responseCo...
WxPayServiceImpl implements WxPayService { @Override public String getSandboxSignKey() throws WxPayException { WxPayDefaultRequest request = new WxPayDefaultRequest(); request.checkAndSign(this.getConfig()); String url = "https: String responseContent = this.post(url, request.toXML(), false); WxPaySandboxSignKeyResult ...
WxPayServiceImpl implements WxPayService { @Override public String getSandboxSignKey() throws WxPayException { WxPayDefaultRequest request = new WxPayDefaultRequest(); request.checkAndSign(this.getConfig()); String url = "https: String responseContent = this.post(url, request.toXML(), false); WxPaySandboxSignKeyResult ...
WxPayServiceImpl implements WxPayService { @Override public String getSandboxSignKey() throws WxPayException { WxPayDefaultRequest request = new WxPayDefaultRequest(); request.checkAndSign(this.getConfig()); String url = "https: String responseContent = this.post(url, request.toXML(), false); WxPaySandboxSignKeyResult ...
WxPayServiceImpl implements WxPayService { @Override public String getSandboxSignKey() throws WxPayException { WxPayDefaultRequest request = new WxPayDefaultRequest(); request.checkAndSign(this.getConfig()); String url = "https: String responseContent = this.post(url, request.toXML(), false); WxPaySandboxSignKeyResult ...
@Test public void testInitSSLContext() throws Exception { payConfig.setMchId("123"); payConfig.setKeyPath("classpath:/abc.p12"); payConfig.initSSLContext(); }
public SSLContext initSSLContext() throws WxPayException { if (StringUtils.isBlank(mchId)) { throw new IllegalArgumentException("请确保商户号mchId已设置"); } if (StringUtils.isBlank(this.keyPath)) { throw new IllegalArgumentException("请确保证书文件地址keyPath已配置"); } InputStream inputStream; final String prefix = "classpath:"; if (this...
WxPayConfig { public SSLContext initSSLContext() throws WxPayException { if (StringUtils.isBlank(mchId)) { throw new IllegalArgumentException("请确保商户号mchId已设置"); } if (StringUtils.isBlank(this.keyPath)) { throw new IllegalArgumentException("请确保证书文件地址keyPath已配置"); } InputStream inputStream; final String prefix = "classpa...
WxPayConfig { public SSLContext initSSLContext() throws WxPayException { if (StringUtils.isBlank(mchId)) { throw new IllegalArgumentException("请确保商户号mchId已设置"); } if (StringUtils.isBlank(this.keyPath)) { throw new IllegalArgumentException("请确保证书文件地址keyPath已配置"); } InputStream inputStream; final String prefix = "classpa...
WxPayConfig { public SSLContext initSSLContext() throws WxPayException { if (StringUtils.isBlank(mchId)) { throw new IllegalArgumentException("请确保商户号mchId已设置"); } if (StringUtils.isBlank(this.keyPath)) { throw new IllegalArgumentException("请确保证书文件地址keyPath已配置"); } InputStream inputStream; final String prefix = "classpa...
WxPayConfig { public SSLContext initSSLContext() throws WxPayException { if (StringUtils.isBlank(mchId)) { throw new IllegalArgumentException("请确保商户号mchId已设置"); } if (StringUtils.isBlank(this.keyPath)) { throw new IllegalArgumentException("请确保证书文件地址keyPath已配置"); } InputStream inputStream; final String prefix = "classpa...
@Test public void loadSuccessResult() { final String successSample = "<xml>\n" + "<return_code><![CDATA[SUCCESS]]></return_code>\n" + "<return_msg><![CDATA[发放成功.]]></return_msg>\n" + "<result_code><![CDATA[SUCCESS]]></result_code>\n" + "<err_code><![CDATA[0]]></err_code>\n" + "<err_code_des><![CDATA[发放成功.]]></err_code_...
public String getSendTime() { return this.sendTime; }
WxPaySendRedpackResult extends WxPayBaseResult implements Serializable { public String getSendTime() { return this.sendTime; } }
WxPaySendRedpackResult extends WxPayBaseResult implements Serializable { public String getSendTime() { return this.sendTime; } }
WxPaySendRedpackResult extends WxPayBaseResult implements Serializable { public String getSendTime() { return this.sendTime; } String getMchBillno(); void setMchBillno(String mchBillno); String getWxappid(); void setWxappid(String wxappid); String getReOpenid(); void setReOpenid(String reOpenid); int getTotalAmount();...
WxPaySendRedpackResult extends WxPayBaseResult implements Serializable { public String getSendTime() { return this.sendTime; } String getMchBillno(); void setMchBillno(String mchBillno); String getWxappid(); void setWxappid(String wxappid); String getReOpenid(); void setReOpenid(String reOpenid); int getTotalAmount();...
@Test public void testComposeCoupons() throws Exception { String xmlString = "<xml>\n" + " <return_code><![CDATA[SUCCESS]]></return_code>\n" + " <return_msg><![CDATA[OK]]></return_msg>\n" + " <appid><![CDATA[wx2421b1c4370ec43b]]></appid>\n" + " <mch_id><![CDATA[10000100]]></mch_id>\n" + " <device_info><![CDATA[1000]]><...
public void composeCoupons() { if (this.couponCount != null && this.couponCount > 0) { this.coupons = Lists.newArrayList(); for (int i = 0; i < this.couponCount; i++) { this.coupons.add(new Coupon(this.getXmlValue("xml/coupon_type_" + i), this.getXmlValue("xml/coupon_id_" + i), this.getXmlValueAsInt("xml/coupon_fee_" +...
WxPayOrderQueryResult extends WxPayBaseResult { public void composeCoupons() { if (this.couponCount != null && this.couponCount > 0) { this.coupons = Lists.newArrayList(); for (int i = 0; i < this.couponCount; i++) { this.coupons.add(new Coupon(this.getXmlValue("xml/coupon_type_" + i), this.getXmlValue("xml/coupon_id_"...
WxPayOrderQueryResult extends WxPayBaseResult { public void composeCoupons() { if (this.couponCount != null && this.couponCount > 0) { this.coupons = Lists.newArrayList(); for (int i = 0; i < this.couponCount; i++) { this.coupons.add(new Coupon(this.getXmlValue("xml/coupon_type_" + i), this.getXmlValue("xml/coupon_id_"...
WxPayOrderQueryResult extends WxPayBaseResult { public void composeCoupons() { if (this.couponCount != null && this.couponCount > 0) { this.coupons = Lists.newArrayList(); for (int i = 0; i < this.couponCount; i++) { this.coupons.add(new Coupon(this.getXmlValue("xml/coupon_type_" + i), this.getXmlValue("xml/coupon_id_"...
WxPayOrderQueryResult extends WxPayBaseResult { public void composeCoupons() { if (this.couponCount != null && this.couponCount > 0) { this.coupons = Lists.newArrayList(); for (int i = 0; i < this.couponCount; i++) { this.coupons.add(new Coupon(this.getXmlValue("xml/coupon_type_" + i), this.getXmlValue("xml/coupon_id_"...
@Test public void testGetXmlValue() throws Exception { }
protected String getXmlValue(String... path) { Document doc = this.getXmlDoc(); String expression = String.format("/%s try { return (String) XPathFactory .newInstance() .newXPath() .compile(expression) .evaluate(doc, XPathConstants.STRING); } catch (XPathExpressionException e) { throw new RuntimeException("未找到相应路径的文本:"...
WxPayBaseResult { protected String getXmlValue(String... path) { Document doc = this.getXmlDoc(); String expression = String.format("/%s try { return (String) XPathFactory .newInstance() .newXPath() .compile(expression) .evaluate(doc, XPathConstants.STRING); } catch (XPathExpressionException e) { throw new RuntimeExcep...
WxPayBaseResult { protected String getXmlValue(String... path) { Document doc = this.getXmlDoc(); String expression = String.format("/%s try { return (String) XPathFactory .newInstance() .newXPath() .compile(expression) .evaluate(doc, XPathConstants.STRING); } catch (XPathExpressionException e) { throw new RuntimeExcep...
WxPayBaseResult { protected String getXmlValue(String... path) { Document doc = this.getXmlDoc(); String expression = String.format("/%s try { return (String) XPathFactory .newInstance() .newXPath() .compile(expression) .evaluate(doc, XPathConstants.STRING); } catch (XPathExpressionException e) { throw new RuntimeExcep...
WxPayBaseResult { protected String getXmlValue(String... path) { Document doc = this.getXmlDoc(); String expression = String.format("/%s try { return (String) XPathFactory .newInstance() .newXPath() .compile(expression) .evaluate(doc, XPathConstants.STRING); } catch (XPathExpressionException e) { throw new RuntimeExcep...
@Test public void testToMap() throws Exception { WxPayOrderQueryResult result = new WxPayOrderQueryResult(); result.setXmlString("<xml>\n" + " <return_code><![CDATA[SUCCESS]]></return_code>\n" + " <return_msg><![CDATA[OK]]></return_msg>\n" + " <appid><![CDATA[wx2421b1c4370ec43b]]></appid>\n" + " <mch_id><![CDATA[100001...
public Map<String, String> toMap() { if (StringUtils.isBlank(this.xmlString)) { throw new RuntimeException("xml数据有问题,请核实!"); } Map<String, String> result = Maps.newHashMap(); Document doc = this.getXmlDoc(); try { NodeList list = (NodeList) XPathFactory.newInstance().newXPath() .compile("/xml/*") .evaluate(doc, XPathCo...
WxPayBaseResult { public Map<String, String> toMap() { if (StringUtils.isBlank(this.xmlString)) { throw new RuntimeException("xml数据有问题,请核实!"); } Map<String, String> result = Maps.newHashMap(); Document doc = this.getXmlDoc(); try { NodeList list = (NodeList) XPathFactory.newInstance().newXPath() .compile("/xml/*") .eva...
WxPayBaseResult { public Map<String, String> toMap() { if (StringUtils.isBlank(this.xmlString)) { throw new RuntimeException("xml数据有问题,请核实!"); } Map<String, String> result = Maps.newHashMap(); Document doc = this.getXmlDoc(); try { NodeList list = (NodeList) XPathFactory.newInstance().newXPath() .compile("/xml/*") .eva...
WxPayBaseResult { public Map<String, String> toMap() { if (StringUtils.isBlank(this.xmlString)) { throw new RuntimeException("xml数据有问题,请核实!"); } Map<String, String> result = Maps.newHashMap(); Document doc = this.getXmlDoc(); try { NodeList list = (NodeList) XPathFactory.newInstance().newXPath() .compile("/xml/*") .eva...
WxPayBaseResult { public Map<String, String> toMap() { if (StringUtils.isBlank(this.xmlString)) { throw new RuntimeException("xml数据有问题,请核实!"); } Map<String, String> result = Maps.newHashMap(); Document doc = this.getXmlDoc(); try { NodeList list = (NodeList) XPathFactory.newInstance().newXPath() .compile("/xml/*") .eva...
@Test(dataProvider = "menuData") public void testCreate(WxMenu wxMenu) throws Exception { this.wxService.getMenuService().create(wxMenu); }
@Override public void create(WxMenu menu) throws WxErrorException { this.create(this.mainService.getWxCpConfigStorage().getAgentId(), menu); }
WxCpMenuServiceImpl implements WxCpMenuService { @Override public void create(WxMenu menu) throws WxErrorException { this.create(this.mainService.getWxCpConfigStorage().getAgentId(), menu); } }
WxCpMenuServiceImpl implements WxCpMenuService { @Override public void create(WxMenu menu) throws WxErrorException { this.create(this.mainService.getWxCpConfigStorage().getAgentId(), menu); } WxCpMenuServiceImpl(WxCpService mainService); }
WxCpMenuServiceImpl implements WxCpMenuService { @Override public void create(WxMenu menu) throws WxErrorException { this.create(this.mainService.getWxCpConfigStorage().getAgentId(), menu); } WxCpMenuServiceImpl(WxCpService mainService); @Override void create(WxMenu menu); @Override void create(Integer agentId, WxMenu ...
WxCpMenuServiceImpl implements WxCpMenuService { @Override public void create(WxMenu menu) throws WxErrorException { this.create(this.mainService.getWxCpConfigStorage().getAgentId(), menu); } WxCpMenuServiceImpl(WxCpService mainService); @Override void create(WxMenu menu); @Override void create(Integer agentId, WxMenu ...
@Test public void composeRefundRecords() throws Exception { String xmlString = "<xml>\n" + " <appid><![CDATA[wx2421b1c4370ec43b]]></appid>\n" + " <mch_id><![CDATA[10000100]]></mch_id>\n" + " <nonce_str><![CDATA[TeqClE3i0mvn3DrK]]></nonce_str>\n" + " <out_refund_no_0><![CDATA[1415701182]]></out_refund_no_0>\n" + " <out_...
public void composeRefundRecords() { if (this.refundCount != null && this.refundCount > 0) { this.refundRecords = Lists.newArrayList(); for (int i = 0; i < this.refundCount; i++) { RefundRecord refundRecord = new RefundRecord(); this.refundRecords.add(refundRecord); refundRecord.setOutRefundNo(this.getXmlValue("xml/out...
WxPayRefundQueryResult extends WxPayBaseResult { public void composeRefundRecords() { if (this.refundCount != null && this.refundCount > 0) { this.refundRecords = Lists.newArrayList(); for (int i = 0; i < this.refundCount; i++) { RefundRecord refundRecord = new RefundRecord(); this.refundRecords.add(refundRecord); refu...
WxPayRefundQueryResult extends WxPayBaseResult { public void composeRefundRecords() { if (this.refundCount != null && this.refundCount > 0) { this.refundRecords = Lists.newArrayList(); for (int i = 0; i < this.refundCount; i++) { RefundRecord refundRecord = new RefundRecord(); this.refundRecords.add(refundRecord); refu...
WxPayRefundQueryResult extends WxPayBaseResult { public void composeRefundRecords() { if (this.refundCount != null && this.refundCount > 0) { this.refundRecords = Lists.newArrayList(); for (int i = 0; i < this.refundCount; i++) { RefundRecord refundRecord = new RefundRecord(); this.refundRecords.add(refundRecord); refu...
WxPayRefundQueryResult extends WxPayBaseResult { public void composeRefundRecords() { if (this.refundCount != null && this.refundCount > 0) { this.refundRecords = Lists.newArrayList(); for (int i = 0; i < this.refundCount; i++) { RefundRecord refundRecord = new RefundRecord(); this.refundRecords.add(refundRecord); refu...
@Test public void testFromXML() throws Exception { String xmlString = "<xml>\n" + " <appid><![CDATA[wx2421b1c4370ec43b]]></appid>\n" + " <attach><![CDATA[支付测试]]></attach>\n" + " <bank_type><![CDATA[CFT]]></bank_type>\n" + " <fee_type><![CDATA[CNY]]></fee_type>\n" + " <is_subscribe><![CDATA[Y]]></is_subscribe>\n" + " <m...
public static WxPayOrderNotifyResult fromXML(String xmlString) { XStream xstream = XStreamInitializer.getInstance(); xstream.processAnnotations(WxPayOrderNotifyResult.class); xstream.registerConverter(new WxPayOrderNotifyResultConverter(xstream.getMapper(), xstream.getReflectionProvider())); WxPayOrderNotifyResult resu...
WxPayOrderNotifyResult extends WxPayBaseResult implements Serializable { public static WxPayOrderNotifyResult fromXML(String xmlString) { XStream xstream = XStreamInitializer.getInstance(); xstream.processAnnotations(WxPayOrderNotifyResult.class); xstream.registerConverter(new WxPayOrderNotifyResultConverter(xstream.ge...
WxPayOrderNotifyResult extends WxPayBaseResult implements Serializable { public static WxPayOrderNotifyResult fromXML(String xmlString) { XStream xstream = XStreamInitializer.getInstance(); xstream.processAnnotations(WxPayOrderNotifyResult.class); xstream.registerConverter(new WxPayOrderNotifyResultConverter(xstream.ge...
WxPayOrderNotifyResult extends WxPayBaseResult implements Serializable { public static WxPayOrderNotifyResult fromXML(String xmlString) { XStream xstream = XStreamInitializer.getInstance(); xstream.processAnnotations(WxPayOrderNotifyResult.class); xstream.registerConverter(new WxPayOrderNotifyResultConverter(xstream.ge...
WxPayOrderNotifyResult extends WxPayBaseResult implements Serializable { public static WxPayOrderNotifyResult fromXML(String xmlString) { XStream xstream = XStreamInitializer.getInstance(); xstream.processAnnotations(WxPayOrderNotifyResult.class); xstream.registerConverter(new WxPayOrderNotifyResultConverter(xstream.ge...
@Test public void testGen() throws Exception { final String result = SHA1.gen("123", "345"); assertNotNull(result); assertEquals(result,"9f537aeb751ec72605f57f94a2f6dc3e3958e1dd"); }
public static String gen(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (String a : arr) { sb.append(a); } return DigestUtils.sha1Hex(sb.toString()); }
SHA1 { public static String gen(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (String a : arr) { sb.append(a); } return DigestUtils.sha1Hex(sb.toString()); } }
SHA1 { public static String gen(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (String a : arr) { sb.append(a); } return DigestUtils.sha1Hex(sb.toString()); } }
SHA1 { public static String gen(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (String a : arr) { sb.append(a); } return DigestUtils.sha1Hex(sb.toString()); } static Stri...
SHA1 { public static String gen(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (String a : arr) { sb.append(a); } return DigestUtils.sha1Hex(sb.toString()); } static Stri...
@Test(expectedExceptions = {IllegalArgumentException.class}) public void testGen_illegalArguments() { final String result = SHA1.gen(null, "", "345"); assertNotNull(result); }
public static String gen(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (String a : arr) { sb.append(a); } return DigestUtils.sha1Hex(sb.toString()); }
SHA1 { public static String gen(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (String a : arr) { sb.append(a); } return DigestUtils.sha1Hex(sb.toString()); } }
SHA1 { public static String gen(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (String a : arr) { sb.append(a); } return DigestUtils.sha1Hex(sb.toString()); } }
SHA1 { public static String gen(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (String a : arr) { sb.append(a); } return DigestUtils.sha1Hex(sb.toString()); } static Stri...
SHA1 { public static String gen(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (String a : arr) { sb.append(a); } return DigestUtils.sha1Hex(sb.toString()); } static Stri...
@Test public void testGenWithAmple() throws Exception { final String result = SHA1.genWithAmple("123", "345"); assertNotNull(result); assertEquals(result,"20b896ccbd5a72dde5dbe0878ff985e4069771c6"); }
public static String genWithAmple(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (int i = 0; i < arr.length; i++) { String a = arr[i]; sb.append(a); if (i != arr.length - ...
SHA1 { public static String genWithAmple(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (int i = 0; i < arr.length; i++) { String a = arr[i]; sb.append(a); if (i != arr.le...
SHA1 { public static String genWithAmple(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (int i = 0; i < arr.length; i++) { String a = arr[i]; sb.append(a); if (i != arr.le...
SHA1 { public static String genWithAmple(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (int i = 0; i < arr.length; i++) { String a = arr[i]; sb.append(a); if (i != arr.le...
SHA1 { public static String genWithAmple(String... arr) { if (StringUtils.isAnyEmpty(arr)) { throw new IllegalArgumentException("非法请求参数,有部分参数为空 : " + Arrays.toString(arr)); } Arrays.sort(arr); StringBuilder sb = new StringBuilder(); for (int i = 0; i < arr.length; i++) { String a = arr[i]; sb.append(a); if (i != arr.le...
@Test(invocationCount = 5, threadPoolSize = 3) public void testSendTemplateMsg() throws WxErrorException { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); TestConfig config = (TestConfig) this.wxService.getWxMaConfig(); WxMaTemplateMessage templateMessage = WxMaTemplateMessage.newBuilder(...
@Override public String sendTemplateMsg(WxMaTemplateMessage templateMessage) throws WxErrorException { String responseContent = this.wxMaService.post(TEMPLATE_MSG_SEND_URL, templateMessage.toJson()); JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObject(); if (jsonObject.get("errcode").getAsInt() =...
WxMaMsgServiceImpl implements WxMaMsgService { @Override public String sendTemplateMsg(WxMaTemplateMessage templateMessage) throws WxErrorException { String responseContent = this.wxMaService.post(TEMPLATE_MSG_SEND_URL, templateMessage.toJson()); JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObjec...
WxMaMsgServiceImpl implements WxMaMsgService { @Override public String sendTemplateMsg(WxMaTemplateMessage templateMessage) throws WxErrorException { String responseContent = this.wxMaService.post(TEMPLATE_MSG_SEND_URL, templateMessage.toJson()); JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObjec...
WxMaMsgServiceImpl implements WxMaMsgService { @Override public String sendTemplateMsg(WxMaTemplateMessage templateMessage) throws WxErrorException { String responseContent = this.wxMaService.post(TEMPLATE_MSG_SEND_URL, templateMessage.toJson()); JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObjec...
WxMaMsgServiceImpl implements WxMaMsgService { @Override public String sendTemplateMsg(WxMaTemplateMessage templateMessage) throws WxErrorException { String responseContent = this.wxMaService.post(TEMPLATE_MSG_SEND_URL, templateMessage.toJson()); JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObjec...
@Test public void testGetSessionKey() throws Exception { assertNotNull(this.wxService.getUserService().getSessionInfo("aaa")); }
@Override public WxMaJscode2SessionResult getSessionInfo(String jsCode) throws WxErrorException { final WxMaConfig config = service.getWxMaConfig(); Map<String, String> params = new HashMap<>(); params.put("appid", config.getAppid()); params.put("secret", config.getSecret()); params.put("js_code", jsCode); params.put("...
WxMaUserServiceImpl implements WxMaUserService { @Override public WxMaJscode2SessionResult getSessionInfo(String jsCode) throws WxErrorException { final WxMaConfig config = service.getWxMaConfig(); Map<String, String> params = new HashMap<>(); params.put("appid", config.getAppid()); params.put("secret", config.getSecre...
WxMaUserServiceImpl implements WxMaUserService { @Override public WxMaJscode2SessionResult getSessionInfo(String jsCode) throws WxErrorException { final WxMaConfig config = service.getWxMaConfig(); Map<String, String> params = new HashMap<>(); params.put("appid", config.getAppid()); params.put("secret", config.getSecre...
WxMaUserServiceImpl implements WxMaUserService { @Override public WxMaJscode2SessionResult getSessionInfo(String jsCode) throws WxErrorException { final WxMaConfig config = service.getWxMaConfig(); Map<String, String> params = new HashMap<>(); params.put("appid", config.getAppid()); params.put("secret", config.getSecre...
WxMaUserServiceImpl implements WxMaUserService { @Override public WxMaJscode2SessionResult getSessionInfo(String jsCode) throws WxErrorException { final WxMaConfig config = service.getWxMaConfig(); Map<String, String> params = new HashMap<>(); params.put("appid", config.getAppid()); params.put("secret", config.getSecre...
@Test public void testGetUserInfo() throws Exception { WxMaUserInfo userInfo = this.wxService.getUserService().getUserInfo("tiihtNczf5v6AKRyjwEUhQ==", "CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8...
@Override public WxMaUserInfo getUserInfo(String sessionKey, String encryptedData, String ivStr) { return WxMaUserInfo.fromJson(WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr)); }
WxMaUserServiceImpl implements WxMaUserService { @Override public WxMaUserInfo getUserInfo(String sessionKey, String encryptedData, String ivStr) { return WxMaUserInfo.fromJson(WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr)); } }
WxMaUserServiceImpl implements WxMaUserService { @Override public WxMaUserInfo getUserInfo(String sessionKey, String encryptedData, String ivStr) { return WxMaUserInfo.fromJson(WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr)); } WxMaUserServiceImpl(WxMaService service); }
WxMaUserServiceImpl implements WxMaUserService { @Override public WxMaUserInfo getUserInfo(String sessionKey, String encryptedData, String ivStr) { return WxMaUserInfo.fromJson(WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr)); } WxMaUserServiceImpl(WxMaService service); @Override WxMaJscode2SessionResult getSe...
WxMaUserServiceImpl implements WxMaUserService { @Override public WxMaUserInfo getUserInfo(String sessionKey, String encryptedData, String ivStr) { return WxMaUserInfo.fromJson(WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr)); } WxMaUserServiceImpl(WxMaService service); @Override WxMaJscode2SessionResult getSe...
@Test public void testCheckUserInfo() throws Exception { assertTrue(this.wxService.getUserService().checkUserInfo("HyVFkGl5F5OQWJZZaNzBBg==", "{\"nickName\":\"Band\",\"gender\":1,\"language\":\"zh_CN\",\"city\":\"Guangzhou\",\"province\":\"Guangdong\",\"country\":\"CN\",\"avatarUrl\":\"http: "75e81ceda165f4ffa64f4068af...
@Override public boolean checkUserInfo(String sessionKey, String rawData, String signature) { final String generatedSignature = DigestUtils.sha1Hex(rawData + sessionKey); System.out.println(generatedSignature); return generatedSignature.equals(signature); }
WxMaUserServiceImpl implements WxMaUserService { @Override public boolean checkUserInfo(String sessionKey, String rawData, String signature) { final String generatedSignature = DigestUtils.sha1Hex(rawData + sessionKey); System.out.println(generatedSignature); return generatedSignature.equals(signature); } }
WxMaUserServiceImpl implements WxMaUserService { @Override public boolean checkUserInfo(String sessionKey, String rawData, String signature) { final String generatedSignature = DigestUtils.sha1Hex(rawData + sessionKey); System.out.println(generatedSignature); return generatedSignature.equals(signature); } WxMaUserServi...
WxMaUserServiceImpl implements WxMaUserService { @Override public boolean checkUserInfo(String sessionKey, String rawData, String signature) { final String generatedSignature = DigestUtils.sha1Hex(rawData + sessionKey); System.out.println(generatedSignature); return generatedSignature.equals(signature); } WxMaUserServi...
WxMaUserServiceImpl implements WxMaUserService { @Override public boolean checkUserInfo(String sessionKey, String rawData, String signature) { final String generatedSignature = DigestUtils.sha1Hex(rawData + sessionKey); System.out.println(generatedSignature); return generatedSignature.equals(signature); } WxMaUserServi...
@Test public void testCreateQrCode() throws Exception { final File qrCode = this.wxService.getQrcodeService().createQrcode("111", 122); System.out.println(qrCode); }
@Override public File createQrcode(String path, int width) throws WxErrorException { String url = "https: return this.wxMaService.execute(new QrCodeRequestExecutor(this.wxMaService.getRequestHttp()), url, new WxMaQrcode(path, width)); }
WxMaQrcodeServiceImpl implements WxMaQrcodeService { @Override public File createQrcode(String path, int width) throws WxErrorException { String url = "https: return this.wxMaService.execute(new QrCodeRequestExecutor(this.wxMaService.getRequestHttp()), url, new WxMaQrcode(path, width)); } }
WxMaQrcodeServiceImpl implements WxMaQrcodeService { @Override public File createQrcode(String path, int width) throws WxErrorException { String url = "https: return this.wxMaService.execute(new QrCodeRequestExecutor(this.wxMaService.getRequestHttp()), url, new WxMaQrcode(path, width)); } WxMaQrcodeServiceImpl(WxMaServ...
WxMaQrcodeServiceImpl implements WxMaQrcodeService { @Override public File createQrcode(String path, int width) throws WxErrorException { String url = "https: return this.wxMaService.execute(new QrCodeRequestExecutor(this.wxMaService.getRequestHttp()), url, new WxMaQrcode(path, width)); } WxMaQrcodeServiceImpl(WxMaServ...
WxMaQrcodeServiceImpl implements WxMaQrcodeService { @Override public File createQrcode(String path, int width) throws WxErrorException { String url = "https: return this.wxMaService.execute(new QrCodeRequestExecutor(this.wxMaService.getRequestHttp()), url, new WxMaQrcode(path, width)); } WxMaQrcodeServiceImpl(WxMaServ...
@Test(dependsOnMethods = "testCreate") public void testGet() throws Exception { WxMenu menu = this.wxService.getMenuService().get(); assertNotNull(menu); System.out.println(menu.toJson()); }
@Override public WxMenu get() throws WxErrorException { return this.get(this.mainService.getWxCpConfigStorage().getAgentId()); }
WxCpMenuServiceImpl implements WxCpMenuService { @Override public WxMenu get() throws WxErrorException { return this.get(this.mainService.getWxCpConfigStorage().getAgentId()); } }
WxCpMenuServiceImpl implements WxCpMenuService { @Override public WxMenu get() throws WxErrorException { return this.get(this.mainService.getWxCpConfigStorage().getAgentId()); } WxCpMenuServiceImpl(WxCpService mainService); }
WxCpMenuServiceImpl implements WxCpMenuService { @Override public WxMenu get() throws WxErrorException { return this.get(this.mainService.getWxCpConfigStorage().getAgentId()); } WxCpMenuServiceImpl(WxCpService mainService); @Override void create(WxMenu menu); @Override void create(Integer agentId, WxMenu menu); @Overri...
WxCpMenuServiceImpl implements WxCpMenuService { @Override public WxMenu get() throws WxErrorException { return this.get(this.mainService.getWxCpConfigStorage().getAgentId()); } WxCpMenuServiceImpl(WxCpService mainService); @Override void create(WxMenu menu); @Override void create(Integer agentId, WxMenu menu); @Overri...
@Test public void testUploadMedia() throws WxErrorException, IOException { String mediaType = "image"; String fileType = "png"; String fileName = "tmp.png"; try (InputStream inputStream = ClassLoader.getSystemResourceAsStream(fileName)) { WxMediaUploadResult res = this.wxService.getMediaService().uploadMedia(mediaType,...
@Override public WxMediaUploadResult uploadMedia(String mediaType, String fileType, InputStream inputStream) throws WxErrorException { try { return this.uploadMedia(mediaType, FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType)); } catch (IOException e) { e.printStackTrace(); throw new WxErrorE...
WxMaMediaServiceImpl implements WxMaMediaService { @Override public WxMediaUploadResult uploadMedia(String mediaType, String fileType, InputStream inputStream) throws WxErrorException { try { return this.uploadMedia(mediaType, FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType)); } catch (IOExc...
WxMaMediaServiceImpl implements WxMaMediaService { @Override public WxMediaUploadResult uploadMedia(String mediaType, String fileType, InputStream inputStream) throws WxErrorException { try { return this.uploadMedia(mediaType, FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType)); } catch (IOExc...
WxMaMediaServiceImpl implements WxMaMediaService { @Override public WxMediaUploadResult uploadMedia(String mediaType, String fileType, InputStream inputStream) throws WxErrorException { try { return this.uploadMedia(mediaType, FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType)); } catch (IOExc...
WxMaMediaServiceImpl implements WxMaMediaService { @Override public WxMediaUploadResult uploadMedia(String mediaType, String fileType, InputStream inputStream) throws WxErrorException { try { return this.uploadMedia(mediaType, FileUtils.createTmpFile(inputStream, UUID.randomUUID().toString(), fileType)); } catch (IOExc...
@Test(dependsOnMethods = {"testUploadMedia"}) public void testGetMedia() throws WxErrorException { File file = this.wxService.getMediaService().getMedia(this.mediaId); assertNotNull(file); System.out.println(file.getAbsolutePath()); }
@Override public File getMedia(String mediaId) throws WxErrorException { try { RequestExecutor<File, String> executor = MediaDownloadRequestExecutor .create(this.wxMaService.getRequestHttp(), Files.createTempDirectory("wxma").toFile()); return this.wxMaService.execute(executor, MEDIA_GET_URL, "media_id=" + mediaId); } ...
WxMaMediaServiceImpl implements WxMaMediaService { @Override public File getMedia(String mediaId) throws WxErrorException { try { RequestExecutor<File, String> executor = MediaDownloadRequestExecutor .create(this.wxMaService.getRequestHttp(), Files.createTempDirectory("wxma").toFile()); return this.wxMaService.execute(...
WxMaMediaServiceImpl implements WxMaMediaService { @Override public File getMedia(String mediaId) throws WxErrorException { try { RequestExecutor<File, String> executor = MediaDownloadRequestExecutor .create(this.wxMaService.getRequestHttp(), Files.createTempDirectory("wxma").toFile()); return this.wxMaService.execute(...
WxMaMediaServiceImpl implements WxMaMediaService { @Override public File getMedia(String mediaId) throws WxErrorException { try { RequestExecutor<File, String> executor = MediaDownloadRequestExecutor .create(this.wxMaService.getRequestHttp(), Files.createTempDirectory("wxma").toFile()); return this.wxMaService.execute(...
WxMaMediaServiceImpl implements WxMaMediaService { @Override public File getMedia(String mediaId) throws WxErrorException { try { RequestExecutor<File, String> executor = MediaDownloadRequestExecutor .create(this.wxMaService.getRequestHttp(), Files.createTempDirectory("wxma").toFile()); return this.wxMaService.execute(...
@Test public void testToJson() throws Exception { WxMaTemplateMessage tm = WxMaTemplateMessage.newBuilder() .toUser("OPENID") .formId("FORMID") .page("index") .data(Lists.newArrayList( new WxMaTemplateMessage.Data("keyword1", "339208499", "#173177"), new WxMaTemplateMessage.Data("keyword2", "2015年01月05日12:30", "#173177...
public String toJson() { return WxMaGsonBuilder.create().toJson(this); }
WxMaTemplateMessage implements Serializable { public String toJson() { return WxMaGsonBuilder.create().toJson(this); } }
WxMaTemplateMessage implements Serializable { public String toJson() { return WxMaGsonBuilder.create().toJson(this); } private WxMaTemplateMessage(Builder builder); }
WxMaTemplateMessage implements Serializable { public String toJson() { return WxMaGsonBuilder.create().toJson(this); } private WxMaTemplateMessage(Builder builder); static Builder newBuilder(); String toJson(); String getToUser(); void setToUser(String toUser); String getTemplateId(); void setTemplateId(String templat...
WxMaTemplateMessage implements Serializable { public String toJson() { return WxMaGsonBuilder.create().toJson(this); } private WxMaTemplateMessage(Builder builder); static Builder newBuilder(); String toJson(); String getToUser(); void setToUser(String toUser); String getTemplateId(); void setTemplateId(String templat...
@Test(enabled = false) public void prepare(boolean async, StringBuffer sb, WxMpMessageRouter router) { router .rule() .async(async) .msgType(WxConsts.XML_MSG_TEXT).event(WxConsts.EVT_CLICK).eventKey("KEY_1").content("CONTENT_1") .handler(new WxEchoMpMessageHandler(sb, "COMBINE_4")) .end() .rule() .async(async) .msgType...
public WxMpMessageRouterRule rule() { return new WxMpMessageRouterRule(this); }
WxMpMessageRouter { public WxMpMessageRouterRule rule() { return new WxMpMessageRouterRule(this); } }
WxMpMessageRouter { public WxMpMessageRouterRule rule() { return new WxMpMessageRouterRule(this); } WxMpMessageRouter(WxMpService wxMpService); }
WxMpMessageRouter { public WxMpMessageRouterRule rule() { return new WxMpMessageRouterRule(this); } WxMpMessageRouter(WxMpService wxMpService); void setExecutorService(ExecutorService executorService); void setMessageDuplicateChecker(WxMessageDuplicateChecker messageDuplicateChecker); void setSessionManager(WxSessionMa...
WxMpMessageRouter { public WxMpMessageRouterRule rule() { return new WxMpMessageRouterRule(this); } WxMpMessageRouter(WxMpService wxMpService); void setExecutorService(ExecutorService executorService); void setMessageDuplicateChecker(WxMessageDuplicateChecker messageDuplicateChecker); void setSessionManager(WxSessionMa...
@Test(dataProvider = "messages-1") public void testSync(WxMpXmlMessage message, String expected) { StringBuffer sb = new StringBuffer(); WxMpMessageRouter router = new WxMpMessageRouter(null); prepare(false, sb, router); router.route(message); Assert.assertEquals(sb.toString(), expected); }
public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) { if (isMsgDuplicated(wxMessage)) { return null; } final List<WxMpMessageRouterRule> matchRules = new ArrayList<>(); for (final WxMpMessageRouterRule rule : this.rules) { if (rule.test(wxMessage)) { matchRules.add(rule); i...
WxMpMessageRouter { public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) { if (isMsgDuplicated(wxMessage)) { return null; } final List<WxMpMessageRouterRule> matchRules = new ArrayList<>(); for (final WxMpMessageRouterRule rule : this.rules) { if (rule.test(wxMessage)) { mat...
WxMpMessageRouter { public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) { if (isMsgDuplicated(wxMessage)) { return null; } final List<WxMpMessageRouterRule> matchRules = new ArrayList<>(); for (final WxMpMessageRouterRule rule : this.rules) { if (rule.test(wxMessage)) { mat...
WxMpMessageRouter { public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) { if (isMsgDuplicated(wxMessage)) { return null; } final List<WxMpMessageRouterRule> matchRules = new ArrayList<>(); for (final WxMpMessageRouterRule rule : this.rules) { if (rule.test(wxMessage)) { mat...
WxMpMessageRouter { public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) { if (isMsgDuplicated(wxMessage)) { return null; } final List<WxMpMessageRouterRule> matchRules = new ArrayList<>(); for (final WxMpMessageRouterRule rule : this.rules) { if (rule.test(wxMessage)) { mat...
@Test(dataProvider = "messages-1") public void testAsync(WxMpXmlMessage message, String expected) throws InterruptedException { StringBuffer sb = new StringBuffer(); WxMpMessageRouter router = new WxMpMessageRouter(null); prepare(true, sb, router); router.route(message); Thread.sleep(500l); Assert.assertEquals(sb.toStr...
public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) { if (isMsgDuplicated(wxMessage)) { return null; } final List<WxMpMessageRouterRule> matchRules = new ArrayList<>(); for (final WxMpMessageRouterRule rule : this.rules) { if (rule.test(wxMessage)) { matchRules.add(rule); i...
WxMpMessageRouter { public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) { if (isMsgDuplicated(wxMessage)) { return null; } final List<WxMpMessageRouterRule> matchRules = new ArrayList<>(); for (final WxMpMessageRouterRule rule : this.rules) { if (rule.test(wxMessage)) { mat...
WxMpMessageRouter { public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) { if (isMsgDuplicated(wxMessage)) { return null; } final List<WxMpMessageRouterRule> matchRules = new ArrayList<>(); for (final WxMpMessageRouterRule rule : this.rules) { if (rule.test(wxMessage)) { mat...
WxMpMessageRouter { public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) { if (isMsgDuplicated(wxMessage)) { return null; } final List<WxMpMessageRouterRule> matchRules = new ArrayList<>(); for (final WxMpMessageRouterRule rule : this.rules) { if (rule.test(wxMessage)) { mat...
WxMpMessageRouter { public WxMpXmlOutMessage route(final WxMpXmlMessage wxMessage, final Map<String, Object> context) { if (isMsgDuplicated(wxMessage)) { return null; } final List<WxMpMessageRouterRule> matchRules = new ArrayList<>(); for (final WxMpMessageRouterRule rule : this.rules) { if (rule.test(wxMessage)) { mat...
@Test public void testGetBlacklist() throws Exception { TestConfigStorage configStorage = (TestConfigStorage) this.wxService .getWxMpConfigStorage(); WxMpUserBlacklistGetResult wxMpUserBlacklistGetResult = this.wxService.getBlackListService().getBlacklist(configStorage.getOpenid()); Assert.assertNotNull(wxMpUserBlackli...
@Override public WxMpUserBlacklistGetResult getBlacklist(String nextOpenid) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("begin_openid", nextOpenid); String url = API_BLACKLIST_PREFIX + "/getblacklist"; String responseContent = this.wxMpService.execute(SimplePostRequestExec...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public WxMpUserBlacklistGetResult getBlacklist(String nextOpenid) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("begin_openid", nextOpenid); String url = API_BLACKLIST_PREFIX + "/getblacklist"; Stri...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public WxMpUserBlacklistGetResult getBlacklist(String nextOpenid) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("begin_openid", nextOpenid); String url = API_BLACKLIST_PREFIX + "/getblacklist"; Stri...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public WxMpUserBlacklistGetResult getBlacklist(String nextOpenid) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("begin_openid", nextOpenid); String url = API_BLACKLIST_PREFIX + "/getblacklist"; Stri...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public WxMpUserBlacklistGetResult getBlacklist(String nextOpenid) throws WxErrorException { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("begin_openid", nextOpenid); String url = API_BLACKLIST_PREFIX + "/getblacklist"; Stri...
@Test public void testPushToBlacklist() throws Exception { TestConfigStorage configStorage = (TestConfigStorage) this.wxService .getWxMpConfigStorage(); List<String> openidList = new ArrayList<>(); openidList.add(configStorage.getOpenid()); this.wxService.getBlackListService().pushToBlacklist(openidList); }
@Override public void pushToBlacklist(List<String> openidList) throws WxErrorException { Map<String, Object> map = new HashMap<>(); map.put("openid_list", openidList); String url = API_BLACKLIST_PREFIX + "/batchblacklist"; this.wxMpService.execute(SimplePostRequestExecutor.create(this.wxMpService.getRequestHttp()), url...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public void pushToBlacklist(List<String> openidList) throws WxErrorException { Map<String, Object> map = new HashMap<>(); map.put("openid_list", openidList); String url = API_BLACKLIST_PREFIX + "/batchblacklist"; this.wxMpService.execute(Simpl...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public void pushToBlacklist(List<String> openidList) throws WxErrorException { Map<String, Object> map = new HashMap<>(); map.put("openid_list", openidList); String url = API_BLACKLIST_PREFIX + "/batchblacklist"; this.wxMpService.execute(Simpl...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public void pushToBlacklist(List<String> openidList) throws WxErrorException { Map<String, Object> map = new HashMap<>(); map.put("openid_list", openidList); String url = API_BLACKLIST_PREFIX + "/batchblacklist"; this.wxMpService.execute(Simpl...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public void pushToBlacklist(List<String> openidList) throws WxErrorException { Map<String, Object> map = new HashMap<>(); map.put("openid_list", openidList); String url = API_BLACKLIST_PREFIX + "/batchblacklist"; this.wxMpService.execute(Simpl...
@Test public void testPullFromBlacklist() throws Exception { TestConfigStorage configStorage = (TestConfigStorage) this.wxService .getWxMpConfigStorage(); List<String> openidList = new ArrayList<>(); openidList.add(configStorage.getOpenid()); this.wxService.getBlackListService().pullFromBlacklist(openidList); }
@Override public void pullFromBlacklist(List<String> openidList) throws WxErrorException { Map<String, Object> map = new HashMap<>(); map.put("openid_list", openidList); String url = API_BLACKLIST_PREFIX + "/batchunblacklist"; this.wxMpService.execute(SimplePostRequestExecutor.create(this.wxMpService.getRequestHttp()),...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public void pullFromBlacklist(List<String> openidList) throws WxErrorException { Map<String, Object> map = new HashMap<>(); map.put("openid_list", openidList); String url = API_BLACKLIST_PREFIX + "/batchunblacklist"; this.wxMpService.execute(S...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public void pullFromBlacklist(List<String> openidList) throws WxErrorException { Map<String, Object> map = new HashMap<>(); map.put("openid_list", openidList); String url = API_BLACKLIST_PREFIX + "/batchunblacklist"; this.wxMpService.execute(S...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public void pullFromBlacklist(List<String> openidList) throws WxErrorException { Map<String, Object> map = new HashMap<>(); map.put("openid_list", openidList); String url = API_BLACKLIST_PREFIX + "/batchunblacklist"; this.wxMpService.execute(S...
WxMpUserBlacklistServiceImpl implements WxMpUserBlacklistService { @Override public void pullFromBlacklist(List<String> openidList) throws WxErrorException { Map<String, Object> map = new HashMap<>(); map.put("openid_list", openidList); String url = API_BLACKLIST_PREFIX + "/batchunblacklist"; this.wxMpService.execute(S...
@Test(dataProvider = "productId") public void testGetQrcode(String productId) { try { WxDeviceQrCodeResult result = wxService.getDeviceService().getQrCode(productId); println(result.toJson()); } catch (WxErrorException e) { println(e.getMessage()); } }
@Override public WxDeviceQrCodeResult getQrCode(String productId) throws WxErrorException { String url = API_URL_PREFIX + "/getqrcode"; String response = this.wxMpService.get(url, "product_id=" + productId); return WxDeviceQrCodeResult.fromJson(response); }
WxMpDeviceServiceImpl implements WxMpDeviceService { @Override public WxDeviceQrCodeResult getQrCode(String productId) throws WxErrorException { String url = API_URL_PREFIX + "/getqrcode"; String response = this.wxMpService.get(url, "product_id=" + productId); return WxDeviceQrCodeResult.fromJson(response); } }
WxMpDeviceServiceImpl implements WxMpDeviceService { @Override public WxDeviceQrCodeResult getQrCode(String productId) throws WxErrorException { String url = API_URL_PREFIX + "/getqrcode"; String response = this.wxMpService.get(url, "product_id=" + productId); return WxDeviceQrCodeResult.fromJson(response); } WxMpDevic...
WxMpDeviceServiceImpl implements WxMpDeviceService { @Override public WxDeviceQrCodeResult getQrCode(String productId) throws WxErrorException { String url = API_URL_PREFIX + "/getqrcode"; String response = this.wxMpService.get(url, "product_id=" + productId); return WxDeviceQrCodeResult.fromJson(response); } WxMpDevic...
WxMpDeviceServiceImpl implements WxMpDeviceService { @Override public WxDeviceQrCodeResult getQrCode(String productId) throws WxErrorException { String url = API_URL_PREFIX + "/getqrcode"; String response = this.wxMpService.get(url, "product_id=" + productId); return WxDeviceQrCodeResult.fromJson(response); } WxMpDevic...
@Test(dependsOnMethods = {"testGet", "testCreate"}) public void testDelete() throws Exception { this.wxService.getMenuService().delete(); }
@Override public void delete() throws WxErrorException { this.delete(this.mainService.getWxCpConfigStorage().getAgentId()); }
WxCpMenuServiceImpl implements WxCpMenuService { @Override public void delete() throws WxErrorException { this.delete(this.mainService.getWxCpConfigStorage().getAgentId()); } }
WxCpMenuServiceImpl implements WxCpMenuService { @Override public void delete() throws WxErrorException { this.delete(this.mainService.getWxCpConfigStorage().getAgentId()); } WxCpMenuServiceImpl(WxCpService mainService); }
WxCpMenuServiceImpl implements WxCpMenuService { @Override public void delete() throws WxErrorException { this.delete(this.mainService.getWxCpConfigStorage().getAgentId()); } WxCpMenuServiceImpl(WxCpService mainService); @Override void create(WxMenu menu); @Override void create(Integer agentId, WxMenu menu); @Override ...
WxCpMenuServiceImpl implements WxCpMenuService { @Override public void delete() throws WxErrorException { this.delete(this.mainService.getWxCpConfigStorage().getAgentId()); } WxCpMenuServiceImpl(WxCpService mainService); @Override void create(WxMenu menu); @Override void create(Integer agentId, WxMenu menu); @Override ...
@Test public void testGetCardApiTicket() throws Exception { String cardApiTicket = this.wxService.getCardService().getCardApiTicket(); assertNotNull(cardApiTicket); System.out.println(cardApiTicket); }
@Override public String getCardApiTicket() throws WxErrorException { return getCardApiTicket(false); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardApiTicket() throws WxErrorException { return getCardApiTicket(false); } }
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardApiTicket() throws WxErrorException { return getCardApiTicket(false); } WxMpCardServiceImpl(WxMpService wxMpService); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardApiTicket() throws WxErrorException { return getCardApiTicket(false); } WxMpCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String getCardApiTicket(); @Override String getCardApiTicket(boolean for...
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardApiTicket() throws WxErrorException { return getCardApiTicket(false); } WxMpCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String getCardApiTicket(); @Override String getCardApiTicket(boolean for...
@Test public void testGetCardApiTicketWithParam() throws Exception { String cardApiTicket = this.wxService.getCardService().getCardApiTicket(true); assertNotNull(cardApiTicket); System.out.println(cardApiTicket); }
@Override public String getCardApiTicket() throws WxErrorException { return getCardApiTicket(false); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardApiTicket() throws WxErrorException { return getCardApiTicket(false); } }
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardApiTicket() throws WxErrorException { return getCardApiTicket(false); } WxMpCardServiceImpl(WxMpService wxMpService); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardApiTicket() throws WxErrorException { return getCardApiTicket(false); } WxMpCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String getCardApiTicket(); @Override String getCardApiTicket(boolean for...
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardApiTicket() throws WxErrorException { return getCardApiTicket(false); } WxMpCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String getCardApiTicket(); @Override String getCardApiTicket(boolean for...
@Test public void testCreateCardApiSignature() throws Exception { String[] param = {"123", this.cardId, "", this.code, this.openid, ""}; WxCardApiSignature cardApiSignature = this.wxService.getCardService().createCardApiSignature(param); assertNotNull(cardApiSignature); System.out.println(cardApiSignature); }
@Override public WxCardApiSignature createCardApiSignature(String... optionalSignParam) throws WxErrorException { long timestamp = System.currentTimeMillis() / 1000; String nonceStr = RandomUtils.getRandomStr(); String cardApiTicket = getCardApiTicket(false); String[] signParam = Arrays.copyOf(optionalSignParam, option...
WxMpCardServiceImpl implements WxMpCardService { @Override public WxCardApiSignature createCardApiSignature(String... optionalSignParam) throws WxErrorException { long timestamp = System.currentTimeMillis() / 1000; String nonceStr = RandomUtils.getRandomStr(); String cardApiTicket = getCardApiTicket(false); String[] si...
WxMpCardServiceImpl implements WxMpCardService { @Override public WxCardApiSignature createCardApiSignature(String... optionalSignParam) throws WxErrorException { long timestamp = System.currentTimeMillis() / 1000; String nonceStr = RandomUtils.getRandomStr(); String cardApiTicket = getCardApiTicket(false); String[] si...
WxMpCardServiceImpl implements WxMpCardService { @Override public WxCardApiSignature createCardApiSignature(String... optionalSignParam) throws WxErrorException { long timestamp = System.currentTimeMillis() / 1000; String nonceStr = RandomUtils.getRandomStr(); String cardApiTicket = getCardApiTicket(false); String[] si...
WxMpCardServiceImpl implements WxMpCardService { @Override public WxCardApiSignature createCardApiSignature(String... optionalSignParam) throws WxErrorException { long timestamp = System.currentTimeMillis() / 1000; String nonceStr = RandomUtils.getRandomStr(); String cardApiTicket = getCardApiTicket(false); String[] si...
@Test public void testDecryptCardCode() throws Exception { String encryptCode = "pd0vTUHSHc9tMUCL2gXABcUmINm6yxqJh0y9Phsy63E="; String cardCode = this.wxService.getCardService().decryptCardCode(encryptCode); assertNotNull(cardCode); System.out.println(cardCode); }
@Override public String decryptCardCode(String encryptCode) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("encrypt_code", encryptCode); String responseContent = this.wxMpService.post(CARD_CODE_DECRYPT, param.toString()); JsonElement tmpJsonElement = new JsonParser().parse(responseCont...
WxMpCardServiceImpl implements WxMpCardService { @Override public String decryptCardCode(String encryptCode) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("encrypt_code", encryptCode); String responseContent = this.wxMpService.post(CARD_CODE_DECRYPT, param.toString()); JsonElement tmp...
WxMpCardServiceImpl implements WxMpCardService { @Override public String decryptCardCode(String encryptCode) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("encrypt_code", encryptCode); String responseContent = this.wxMpService.post(CARD_CODE_DECRYPT, param.toString()); JsonElement tmp...
WxMpCardServiceImpl implements WxMpCardService { @Override public String decryptCardCode(String encryptCode) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("encrypt_code", encryptCode); String responseContent = this.wxMpService.post(CARD_CODE_DECRYPT, param.toString()); JsonElement tmp...
WxMpCardServiceImpl implements WxMpCardService { @Override public String decryptCardCode(String encryptCode) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("encrypt_code", encryptCode); String responseContent = this.wxMpService.post(CARD_CODE_DECRYPT, param.toString()); JsonElement tmp...
@Test public void testQueryCardCode() throws Exception { WxMpCardResult wxMpCardResult = this.wxService.getCardService().queryCardCode(this.cardId, this.code, false); assertNotNull(wxMpCardResult); System.out.println(wxMpCardResult); }
@Override public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); param.addProperty("code", code); param.addProperty("check_consume", checkConsume); String responseContent = this.wxMpServic...
WxMpCardServiceImpl implements WxMpCardService { @Override public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); param.addProperty("code", code); param.addProperty("check_consume", checkC...
WxMpCardServiceImpl implements WxMpCardService { @Override public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); param.addProperty("code", code); param.addProperty("check_consume", checkC...
WxMpCardServiceImpl implements WxMpCardService { @Override public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); param.addProperty("code", code); param.addProperty("check_consume", checkC...
WxMpCardServiceImpl implements WxMpCardService { @Override public WxMpCardResult queryCardCode(String cardId, String code, boolean checkConsume) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); param.addProperty("code", code); param.addProperty("check_consume", checkC...
@Test public void testConsumeCardCode() throws Exception { String result = this.wxService.getCardService().consumeCardCode(this.code); assertNotNull(result); System.out.println(result); }
@Override public String consumeCardCode(String code) throws WxErrorException { return consumeCardCode(code, null); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String consumeCardCode(String code) throws WxErrorException { return consumeCardCode(code, null); } }
WxMpCardServiceImpl implements WxMpCardService { @Override public String consumeCardCode(String code) throws WxErrorException { return consumeCardCode(code, null); } WxMpCardServiceImpl(WxMpService wxMpService); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String consumeCardCode(String code) throws WxErrorException { return consumeCardCode(code, null); } WxMpCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String getCardApiTicket(); @Override String getCardApiTick...
WxMpCardServiceImpl implements WxMpCardService { @Override public String consumeCardCode(String code) throws WxErrorException { return consumeCardCode(code, null); } WxMpCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String getCardApiTicket(); @Override String getCardApiTick...
@Test public void testConsumeCardCodeWithCardId() throws Exception { String result = this.wxService.getCardService().consumeCardCode(this.code, this.cardId); assertNotNull(result); System.out.println(result); }
@Override public String consumeCardCode(String code) throws WxErrorException { return consumeCardCode(code, null); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String consumeCardCode(String code) throws WxErrorException { return consumeCardCode(code, null); } }
WxMpCardServiceImpl implements WxMpCardService { @Override public String consumeCardCode(String code) throws WxErrorException { return consumeCardCode(code, null); } WxMpCardServiceImpl(WxMpService wxMpService); }
WxMpCardServiceImpl implements WxMpCardService { @Override public String consumeCardCode(String code) throws WxErrorException { return consumeCardCode(code, null); } WxMpCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String getCardApiTicket(); @Override String getCardApiTick...
WxMpCardServiceImpl implements WxMpCardService { @Override public String consumeCardCode(String code) throws WxErrorException { return consumeCardCode(code, null); } WxMpCardServiceImpl(WxMpService wxMpService); @Override WxMpService getWxMpService(); @Override String getCardApiTicket(); @Override String getCardApiTick...
@Test public void testMarkCardCode() throws Exception { this.wxService.getCardService().markCardCode(this.code, this.cardId, this.openid, true); System.out.println("done"); }
@Override public void markCardCode(String code, String cardId, String openId, boolean isMark) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("code", code); param.addProperty("card_id", cardId); param.addProperty("openid", openId); param.addProperty("is_mark", isMark); String responseCo...
WxMpCardServiceImpl implements WxMpCardService { @Override public void markCardCode(String code, String cardId, String openId, boolean isMark) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("code", code); param.addProperty("card_id", cardId); param.addProperty("openid", openId); param....
WxMpCardServiceImpl implements WxMpCardService { @Override public void markCardCode(String code, String cardId, String openId, boolean isMark) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("code", code); param.addProperty("card_id", cardId); param.addProperty("openid", openId); param....
WxMpCardServiceImpl implements WxMpCardService { @Override public void markCardCode(String code, String cardId, String openId, boolean isMark) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("code", code); param.addProperty("card_id", cardId); param.addProperty("openid", openId); param....
WxMpCardServiceImpl implements WxMpCardService { @Override public void markCardCode(String code, String cardId, String openId, boolean isMark) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("code", code); param.addProperty("card_id", cardId); param.addProperty("openid", openId); param....
@Test public void testGetCardDetail() throws Exception { String result = this.wxService.getCardService().getCardDetail(this.cardId); assertNotNull(result); System.out.println(result); }
@Override public String getCardDetail(String cardId) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String responseContent = this.wxMpService.post(CARD_GET, param.toString()); JsonObject json = (new JsonParser()).parse(responseContent).getAsJsonObject(); String errc...
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardDetail(String cardId) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String responseContent = this.wxMpService.post(CARD_GET, param.toString()); JsonObject json = (new JsonParser()).pars...
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardDetail(String cardId) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String responseContent = this.wxMpService.post(CARD_GET, param.toString()); JsonObject json = (new JsonParser()).pars...
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardDetail(String cardId) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String responseContent = this.wxMpService.post(CARD_GET, param.toString()); JsonObject json = (new JsonParser()).pars...
WxMpCardServiceImpl implements WxMpCardService { @Override public String getCardDetail(String cardId) throws WxErrorException { JsonObject param = new JsonObject(); param.addProperty("card_id", cardId); String responseContent = this.wxMpService.post(CARD_GET, param.toString()); JsonObject json = (new JsonParser()).pars...
@Test(invocationCount = 5, threadPoolSize = 3) public void testSendTemplateMsg() throws WxErrorException { SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss.SSS"); TestConfigStorage configStorage = (TestConfigStorage) this.wxService .getWxMpConfigStorage(); WxMpTemplateMessage templateMessage = W...
@Override public String sendTemplateMsg(WxMpTemplateMessage templateMessage) throws WxErrorException { String url = "https: String responseContent = this.wxMpService.post(url, templateMessage.toJson()); final JsonObject jsonObject = JSON_PARSER.parse(responseContent).getAsJsonObject(); if (jsonObject.get("errcode").get...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public String sendTemplateMsg(WxMpTemplateMessage templateMessage) throws WxErrorException { String url = "https: String responseContent = this.wxMpService.post(url, templateMessage.toJson()); final JsonObject jsonObject = JSON_PARSER.parse(respon...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public String sendTemplateMsg(WxMpTemplateMessage templateMessage) throws WxErrorException { String url = "https: String responseContent = this.wxMpService.post(url, templateMessage.toJson()); final JsonObject jsonObject = JSON_PARSER.parse(respon...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public String sendTemplateMsg(WxMpTemplateMessage templateMessage) throws WxErrorException { String url = "https: String responseContent = this.wxMpService.post(url, templateMessage.toJson()); final JsonObject jsonObject = JSON_PARSER.parse(respon...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public String sendTemplateMsg(WxMpTemplateMessage templateMessage) throws WxErrorException { String url = "https: String responseContent = this.wxMpService.post(url, templateMessage.toJson()); final JsonObject jsonObject = JSON_PARSER.parse(respon...
@Test public void testCreate() throws Exception { this.tagId = this.wxService.getTagService().create("测试标签" + System.currentTimeMillis()); System.out.println(this.tagId); }
@Override public String create(String tagName) throws WxErrorException { String url = "https: JsonObject o = new JsonObject(); o.addProperty("tagname", tagName); String responseContent = this.mainService.post(url, o.toString()); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return tmpJsonElement...
WxCpTagServiceImpl implements WxCpTagService { @Override public String create(String tagName) throws WxErrorException { String url = "https: JsonObject o = new JsonObject(); o.addProperty("tagname", tagName); String responseContent = this.mainService.post(url, o.toString()); JsonElement tmpJsonElement = new JsonParser(...
WxCpTagServiceImpl implements WxCpTagService { @Override public String create(String tagName) throws WxErrorException { String url = "https: JsonObject o = new JsonObject(); o.addProperty("tagname", tagName); String responseContent = this.mainService.post(url, o.toString()); JsonElement tmpJsonElement = new JsonParser(...
WxCpTagServiceImpl implements WxCpTagService { @Override public String create(String tagName) throws WxErrorException { String url = "https: JsonObject o = new JsonObject(); o.addProperty("tagname", tagName); String responseContent = this.mainService.post(url, o.toString()); JsonElement tmpJsonElement = new JsonParser(...
WxCpTagServiceImpl implements WxCpTagService { @Override public String create(String tagName) throws WxErrorException { String url = "https: JsonObject o = new JsonObject(); o.addProperty("tagname", tagName); String responseContent = this.mainService.post(url, o.toString()); JsonElement tmpJsonElement = new JsonParser(...
@Test public void testGetIndustry() throws Exception { final WxMpTemplateIndustry industry = this.wxService.getTemplateMsgService().getIndustry(); Assert.assertNotNull(industry); System.out.println(industry); }
@Override public WxMpTemplateIndustry getIndustry() throws WxErrorException { String url = API_URL_PREFIX + "/get_industry"; String responseContent = this.wxMpService.get(url, null); return WxMpTemplateIndustry.fromJson(responseContent); }
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public WxMpTemplateIndustry getIndustry() throws WxErrorException { String url = API_URL_PREFIX + "/get_industry"; String responseContent = this.wxMpService.get(url, null); return WxMpTemplateIndustry.fromJson(responseContent); } }
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public WxMpTemplateIndustry getIndustry() throws WxErrorException { String url = API_URL_PREFIX + "/get_industry"; String responseContent = this.wxMpService.get(url, null); return WxMpTemplateIndustry.fromJson(responseContent); } WxMpTemplateMsgSe...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public WxMpTemplateIndustry getIndustry() throws WxErrorException { String url = API_URL_PREFIX + "/get_industry"; String responseContent = this.wxMpService.get(url, null); return WxMpTemplateIndustry.fromJson(responseContent); } WxMpTemplateMsgSe...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public WxMpTemplateIndustry getIndustry() throws WxErrorException { String url = API_URL_PREFIX + "/get_industry"; String responseContent = this.wxMpService.get(url, null); return WxMpTemplateIndustry.fromJson(responseContent); } WxMpTemplateMsgSe...
@Test public void testSetIndustry() throws Exception { WxMpTemplateIndustry industry = new WxMpTemplateIndustry(new WxMpTemplateIndustry.Industry("1"), new WxMpTemplateIndustry.Industry("04")); boolean result = this.wxService.getTemplateMsgService().setIndustry(industry); Assert.assertTrue(result); }
@Override public boolean setIndustry(WxMpTemplateIndustry wxMpIndustry) throws WxErrorException { if (null == wxMpIndustry.getPrimaryIndustry() || null == wxMpIndustry.getPrimaryIndustry().getId() || null == wxMpIndustry.getSecondIndustry() || null == wxMpIndustry.getSecondIndustry().getId()) { throw new IllegalArgumen...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean setIndustry(WxMpTemplateIndustry wxMpIndustry) throws WxErrorException { if (null == wxMpIndustry.getPrimaryIndustry() || null == wxMpIndustry.getPrimaryIndustry().getId() || null == wxMpIndustry.getSecondIndustry() || null == wxMpI...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean setIndustry(WxMpTemplateIndustry wxMpIndustry) throws WxErrorException { if (null == wxMpIndustry.getPrimaryIndustry() || null == wxMpIndustry.getPrimaryIndustry().getId() || null == wxMpIndustry.getSecondIndustry() || null == wxMpI...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean setIndustry(WxMpTemplateIndustry wxMpIndustry) throws WxErrorException { if (null == wxMpIndustry.getPrimaryIndustry() || null == wxMpIndustry.getPrimaryIndustry().getId() || null == wxMpIndustry.getSecondIndustry() || null == wxMpI...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean setIndustry(WxMpTemplateIndustry wxMpIndustry) throws WxErrorException { if (null == wxMpIndustry.getPrimaryIndustry() || null == wxMpIndustry.getPrimaryIndustry().getId() || null == wxMpIndustry.getSecondIndustry() || null == wxMpI...
@Test public void testAddTemplate() throws Exception { String result = this.wxService.getTemplateMsgService().addTemplate("TM00015"); Assert.assertNotNull(result); System.err.println(result); }
@Override public String addTemplate(String shortTemplateId) throws WxErrorException { String url = API_URL_PREFIX + "/api_add_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id_short", shortTemplateId); String responseContent = this.wxMpService.post(url, jsonObject.toString()); fin...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public String addTemplate(String shortTemplateId) throws WxErrorException { String url = API_URL_PREFIX + "/api_add_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id_short", shortTemplateId); String responseC...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public String addTemplate(String shortTemplateId) throws WxErrorException { String url = API_URL_PREFIX + "/api_add_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id_short", shortTemplateId); String responseC...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public String addTemplate(String shortTemplateId) throws WxErrorException { String url = API_URL_PREFIX + "/api_add_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id_short", shortTemplateId); String responseC...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public String addTemplate(String shortTemplateId) throws WxErrorException { String url = API_URL_PREFIX + "/api_add_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id_short", shortTemplateId); String responseC...
@Test public void testGetAllPrivateTemplate() throws Exception { List<WxMpTemplate> result = this.wxService.getTemplateMsgService().getAllPrivateTemplate(); Assert.assertNotNull(result); System.err.println(result); }
@Override public List<WxMpTemplate> getAllPrivateTemplate() throws WxErrorException { String url = API_URL_PREFIX + "/get_all_private_template"; return WxMpTemplate.fromJson(this.wxMpService.get(url, null)); }
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public List<WxMpTemplate> getAllPrivateTemplate() throws WxErrorException { String url = API_URL_PREFIX + "/get_all_private_template"; return WxMpTemplate.fromJson(this.wxMpService.get(url, null)); } }
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public List<WxMpTemplate> getAllPrivateTemplate() throws WxErrorException { String url = API_URL_PREFIX + "/get_all_private_template"; return WxMpTemplate.fromJson(this.wxMpService.get(url, null)); } WxMpTemplateMsgServiceImpl(WxMpService wxMpServ...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public List<WxMpTemplate> getAllPrivateTemplate() throws WxErrorException { String url = API_URL_PREFIX + "/get_all_private_template"; return WxMpTemplate.fromJson(this.wxMpService.get(url, null)); } WxMpTemplateMsgServiceImpl(WxMpService wxMpServ...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public List<WxMpTemplate> getAllPrivateTemplate() throws WxErrorException { String url = API_URL_PREFIX + "/get_all_private_template"; return WxMpTemplate.fromJson(this.wxMpService.get(url, null)); } WxMpTemplateMsgServiceImpl(WxMpService wxMpServ...
@Test public void testDelPrivateTemplate() throws Exception { String templateId = "RPcTe7-4BkU5A2J3imC6W0b4JbjEERcJg0whOMKJKIc"; boolean result = this.wxService.getTemplateMsgService().delPrivateTemplate(templateId); Assert.assertTrue(result); }
@Override public boolean delPrivateTemplate(String templateId) throws WxErrorException { String url = API_URL_PREFIX + "/del_private_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id", templateId); String responseContent = this.wxMpService.post(url, jsonObject.toString()); WxError...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean delPrivateTemplate(String templateId) throws WxErrorException { String url = API_URL_PREFIX + "/del_private_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id", templateId); String responseConte...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean delPrivateTemplate(String templateId) throws WxErrorException { String url = API_URL_PREFIX + "/del_private_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id", templateId); String responseConte...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean delPrivateTemplate(String templateId) throws WxErrorException { String url = API_URL_PREFIX + "/del_private_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id", templateId); String responseConte...
WxMpTemplateMsgServiceImpl implements WxMpTemplateMsgService { @Override public boolean delPrivateTemplate(String templateId) throws WxErrorException { String url = API_URL_PREFIX + "/del_private_template"; JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("template_id", templateId); String responseConte...
@Test(dataProvider = "getKfAccount") public void testKfAccountAdd(String kfAccount) throws WxErrorException { WxMpKfAccountRequest request = WxMpKfAccountRequest.builder() .kfAccount(kfAccount).nickName("我晕").build(); Assert.assertTrue(this.wxService.getKefuService().kfAccountAdd(request)); }
@Override public boolean kfAccountAdd(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_ADD, request.toJson()); return responseContent != null; }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountAdd(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_ADD, request.toJson()); return responseContent != null; } }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountAdd(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_ADD, request.toJson()); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService); }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountAdd(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_ADD, request.toJson()); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService); @Override boolea...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountAdd(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_ADD, request.toJson()); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService); @Override boolea...
@Test(dependsOnMethods = { "testKfAccountAdd"}, dataProvider = "getKfAccount") public void testKfAccountUpdate(String kfAccount) throws WxErrorException { WxMpKfAccountRequest request = WxMpKfAccountRequest.builder() .kfAccount(kfAccount).nickName("我晕").build(); Assert.assertTrue(this.wxService.getKefuService().kfAccou...
@Override public boolean kfAccountUpdate(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_UPDATE, request.toJson()); return responseContent != null; }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountUpdate(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_UPDATE, request.toJson()); return responseContent != null; } }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountUpdate(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_UPDATE, request.toJson()); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService); }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountUpdate(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_UPDATE, request.toJson()); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService); @Override ...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountUpdate(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_UPDATE, request.toJson()); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService); @Override ...
@Test(dependsOnMethods = { "testKfAccountAdd"}, dataProvider = "getKfAccount") public void testKfAccountInviteWorker(String kfAccount) throws WxErrorException { WxMpKfAccountRequest request = WxMpKfAccountRequest.builder() .kfAccount(kfAccount).inviteWx(" ").build(); Assert.assertTrue(this.wxService.getKefuService().kf...
@Override public boolean kfAccountInviteWorker(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_INVITE_WORKER, request.toJson()); return responseContent != null; }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountInviteWorker(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_INVITE_WORKER, request.toJson()); return responseContent != null; } }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountInviteWorker(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_INVITE_WORKER, request.toJson()); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountInviteWorker(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_INVITE_WORKER, request.toJson()); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountInviteWorker(WxMpKfAccountRequest request) throws WxErrorException { String responseContent = this.wxMpService.post(KFACCOUNT_INVITE_WORKER, request.toJson()); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService...
@Test(dependsOnMethods = { "testKfAccountUpdate"}, dataProvider = "getKfAccount") public void testKfAccountUploadHeadImg(String kfAccount) throws WxErrorException { File imgFile = new File("src\\test\\resources\\mm.jpeg"); boolean result = this.wxService.getKefuService() .kfAccountUploadHeadImg(kfAccount, imgFile); Ass...
@Override public boolean kfAccountUploadHeadImg(String kfAccount, File imgFile) throws WxErrorException { WxMediaUploadResult responseContent = this.wxMpService .execute(MediaUploadRequestExecutor.create(this.wxMpService.getRequestHttp()), String.format(KFACCOUNT_UPLOAD_HEAD_IMG, kfAccount), imgFile); return responseCo...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountUploadHeadImg(String kfAccount, File imgFile) throws WxErrorException { WxMediaUploadResult responseContent = this.wxMpService .execute(MediaUploadRequestExecutor.create(this.wxMpService.getRequestHttp()), String.format(KFACCOUNT_UPLOAD_...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountUploadHeadImg(String kfAccount, File imgFile) throws WxErrorException { WxMediaUploadResult responseContent = this.wxMpService .execute(MediaUploadRequestExecutor.create(this.wxMpService.getRequestHttp()), String.format(KFACCOUNT_UPLOAD_...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountUploadHeadImg(String kfAccount, File imgFile) throws WxErrorException { WxMediaUploadResult responseContent = this.wxMpService .execute(MediaUploadRequestExecutor.create(this.wxMpService.getRequestHttp()), String.format(KFACCOUNT_UPLOAD_...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountUploadHeadImg(String kfAccount, File imgFile) throws WxErrorException { WxMediaUploadResult responseContent = this.wxMpService .execute(MediaUploadRequestExecutor.create(this.wxMpService.getRequestHttp()), String.format(KFACCOUNT_UPLOAD_...
@Test(dataProvider = "getKfAccount") public void testKfAccountDel(String kfAccount) throws WxErrorException { boolean result = this.wxService.getKefuService().kfAccountDel(kfAccount); Assert.assertTrue(result); }
@Override public boolean kfAccountDel(String kfAccount) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFACCOUNT_DEL, kfAccount), null); return responseContent != null; }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountDel(String kfAccount) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFACCOUNT_DEL, kfAccount), null); return responseContent != null; } }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountDel(String kfAccount) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFACCOUNT_DEL, kfAccount), null); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService); }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountDel(String kfAccount) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFACCOUNT_DEL, kfAccount), null); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService); @Override boole...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfAccountDel(String kfAccount) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFACCOUNT_DEL, kfAccount), null); return responseContent != null; } WxMpKefuServiceImpl(WxMpService wxMpService); @Override boole...
@Test(dependsOnMethods = "testCreate") public void testUpdate() throws Exception { this.wxService.getTagService().update(this.tagId, "测试标签-改名" + System.currentTimeMillis()); }
@Override public void update(String tagId, String tagName) throws WxErrorException { String url = "https: JsonObject o = new JsonObject(); o.addProperty("tagid", tagId); o.addProperty("tagname", tagName); this.mainService.post(url, o.toString()); }
WxCpTagServiceImpl implements WxCpTagService { @Override public void update(String tagId, String tagName) throws WxErrorException { String url = "https: JsonObject o = new JsonObject(); o.addProperty("tagid", tagId); o.addProperty("tagname", tagName); this.mainService.post(url, o.toString()); } }
WxCpTagServiceImpl implements WxCpTagService { @Override public void update(String tagId, String tagName) throws WxErrorException { String url = "https: JsonObject o = new JsonObject(); o.addProperty("tagid", tagId); o.addProperty("tagname", tagName); this.mainService.post(url, o.toString()); } WxCpTagServiceImpl(WxCpS...
WxCpTagServiceImpl implements WxCpTagService { @Override public void update(String tagId, String tagName) throws WxErrorException { String url = "https: JsonObject o = new JsonObject(); o.addProperty("tagid", tagId); o.addProperty("tagname", tagName); this.mainService.post(url, o.toString()); } WxCpTagServiceImpl(WxCpS...
WxCpTagServiceImpl implements WxCpTagService { @Override public void update(String tagId, String tagName) throws WxErrorException { String url = "https: JsonObject o = new JsonObject(); o.addProperty("tagid", tagId); o.addProperty("tagname", tagName); this.mainService.post(url, o.toString()); } WxCpTagServiceImpl(WxCpS...
@Test(dataProvider = "getKfAccountAndOpenid") public void testKfSessionCreate(String kfAccount, String openid) throws WxErrorException { boolean result = this.wxService.getKefuService().kfSessionCreate(openid, kfAccount); Assert.assertTrue(result); }
@Override public boolean kfSessionCreate(String openid, String kfAccount) throws WxErrorException { WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid); String responseContent = this.wxMpService.post(KFSESSION_CREATE, request.toJson()); return responseContent != null; }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfSessionCreate(String openid, String kfAccount) throws WxErrorException { WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid); String responseContent = this.wxMpService.post(KFSESSION_CREATE, request.toJson()); return resp...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfSessionCreate(String openid, String kfAccount) throws WxErrorException { WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid); String responseContent = this.wxMpService.post(KFSESSION_CREATE, request.toJson()); return resp...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfSessionCreate(String openid, String kfAccount) throws WxErrorException { WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid); String responseContent = this.wxMpService.post(KFSESSION_CREATE, request.toJson()); return resp...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfSessionCreate(String openid, String kfAccount) throws WxErrorException { WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid); String responseContent = this.wxMpService.post(KFSESSION_CREATE, request.toJson()); return resp...
@Test(dataProvider = "getKfAccountAndOpenid") public void testKfSessionClose(String kfAccount, String openid) throws WxErrorException { boolean result = this.wxService.getKefuService().kfSessionClose(openid, kfAccount); Assert.assertTrue(result); }
@Override public boolean kfSessionClose(String openid, String kfAccount) throws WxErrorException { WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid); String responseContent = this.wxMpService.post(KFSESSION_CLOSE, request.toJson()); return responseContent != null; }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfSessionClose(String openid, String kfAccount) throws WxErrorException { WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid); String responseContent = this.wxMpService.post(KFSESSION_CLOSE, request.toJson()); return respon...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfSessionClose(String openid, String kfAccount) throws WxErrorException { WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid); String responseContent = this.wxMpService.post(KFSESSION_CLOSE, request.toJson()); return respon...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfSessionClose(String openid, String kfAccount) throws WxErrorException { WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid); String responseContent = this.wxMpService.post(KFSESSION_CLOSE, request.toJson()); return respon...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public boolean kfSessionClose(String openid, String kfAccount) throws WxErrorException { WxMpKfSessionRequest request = new WxMpKfSessionRequest(kfAccount, openid); String responseContent = this.wxMpService.post(KFSESSION_CLOSE, request.toJson()); return respon...
@Test(dataProvider = "getKfAccountAndOpenid") public void testKfSessionGet(@SuppressWarnings("unused") String kfAccount, String openid) throws WxErrorException { WxMpKfSessionGetResult result = this.wxService.getKefuService() .kfSessionGet(openid); Assert.assertNotNull(result); System.err.println(result); }
@Override public WxMpKfSessionGetResult kfSessionGet(String openid) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFSESSION_GET_SESSION, openid), null); return WxMpKfSessionGetResult.fromJson(responseContent); }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionGetResult kfSessionGet(String openid) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFSESSION_GET_SESSION, openid), null); return WxMpKfSessionGetResult.fromJson(responseContent); } }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionGetResult kfSessionGet(String openid) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFSESSION_GET_SESSION, openid), null); return WxMpKfSessionGetResult.fromJson(responseContent); } WxMpKefuServiceImpl...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionGetResult kfSessionGet(String openid) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFSESSION_GET_SESSION, openid), null); return WxMpKfSessionGetResult.fromJson(responseContent); } WxMpKefuServiceImpl...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionGetResult kfSessionGet(String openid) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFSESSION_GET_SESSION, openid), null); return WxMpKfSessionGetResult.fromJson(responseContent); } WxMpKefuServiceImpl...
@Test(dataProvider = "getKfAccount") public void testKfSessionList(String kfAccount) throws WxErrorException { WxMpKfSessionList result = this.wxService.getKefuService() .kfSessionList(kfAccount); Assert.assertNotNull(result); System.err.println(result); }
@Override public WxMpKfSessionList kfSessionList(String kfAccount) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFSESSION_GET_SESSION_LIST, kfAccount), null); return WxMpKfSessionList.fromJson(responseContent); }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionList kfSessionList(String kfAccount) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFSESSION_GET_SESSION_LIST, kfAccount), null); return WxMpKfSessionList.fromJson(responseContent); } }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionList kfSessionList(String kfAccount) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFSESSION_GET_SESSION_LIST, kfAccount), null); return WxMpKfSessionList.fromJson(responseContent); } WxMpKefuServiceIm...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionList kfSessionList(String kfAccount) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFSESSION_GET_SESSION_LIST, kfAccount), null); return WxMpKfSessionList.fromJson(responseContent); } WxMpKefuServiceIm...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionList kfSessionList(String kfAccount) throws WxErrorException { String responseContent = this.wxMpService.get(String.format(KFSESSION_GET_SESSION_LIST, kfAccount), null); return WxMpKfSessionList.fromJson(responseContent); } WxMpKefuServiceIm...
@Test public void testKfSessionGetWaitCase() throws WxErrorException { WxMpKfSessionWaitCaseList result = this.wxService.getKefuService() .kfSessionGetWaitCase(); Assert.assertNotNull(result); System.err.println(result); }
@Override public WxMpKfSessionWaitCaseList kfSessionGetWaitCase() throws WxErrorException { String responseContent = this.wxMpService.get(KFSESSION_GET_WAIT_CASE, null); return WxMpKfSessionWaitCaseList.fromJson(responseContent); }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionWaitCaseList kfSessionGetWaitCase() throws WxErrorException { String responseContent = this.wxMpService.get(KFSESSION_GET_WAIT_CASE, null); return WxMpKfSessionWaitCaseList.fromJson(responseContent); } }
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionWaitCaseList kfSessionGetWaitCase() throws WxErrorException { String responseContent = this.wxMpService.get(KFSESSION_GET_WAIT_CASE, null); return WxMpKfSessionWaitCaseList.fromJson(responseContent); } WxMpKefuServiceImpl(WxMpService wxMpSer...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionWaitCaseList kfSessionGetWaitCase() throws WxErrorException { String responseContent = this.wxMpService.get(KFSESSION_GET_WAIT_CASE, null); return WxMpKfSessionWaitCaseList.fromJson(responseContent); } WxMpKefuServiceImpl(WxMpService wxMpSer...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfSessionWaitCaseList kfSessionGetWaitCase() throws WxErrorException { String responseContent = this.wxMpService.get(KFSESSION_GET_WAIT_CASE, null); return WxMpKfSessionWaitCaseList.fromJson(responseContent); } WxMpKefuServiceImpl(WxMpService wxMpSer...
@Test public void testKfMsgList() throws WxErrorException { Date startTime = DateTime.now().minusDays(1).toDate(); Date endTime = DateTime.now().minusDays(0).toDate(); WxMpKfMsgList result = this.wxService.getKefuService().kfMsgList(startTime, endTime, 1L, 50); Assert.assertNotNull(result); System.err.println(result); ...
@Override public WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException { if (number > 10000) { throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法参数请求,每次最多查询10000条记录!").build()); } if (startTime.after(endTime)) { throw new WxErrorException(WxError.newBuild...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException { if (number > 10000) { throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法参数请求,每次最多查询10000条记录!").build()); } if (startTime.after(endTim...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException { if (number > 10000) { throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法参数请求,每次最多查询10000条记录!").build()); } if (startTime.after(endTim...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException { if (number > 10000) { throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法参数请求,每次最多查询10000条记录!").build()); } if (startTime.after(endTim...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException { if (number > 10000) { throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法参数请求,每次最多查询10000条记录!").build()); } if (startTime.after(endTim...
@Test public void testKfMsgListAll() throws WxErrorException { Date startTime = DateTime.now().minusDays(1).toDate(); Date endTime = DateTime.now().minusDays(0).toDate(); WxMpKfMsgList result = this.wxService.getKefuService().kfMsgList(startTime, endTime); Assert.assertNotNull(result); System.err.println(result); }
@Override public WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException { if (number > 10000) { throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法参数请求,每次最多查询10000条记录!").build()); } if (startTime.after(endTime)) { throw new WxErrorException(WxError.newBuild...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException { if (number > 10000) { throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法参数请求,每次最多查询10000条记录!").build()); } if (startTime.after(endTim...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException { if (number > 10000) { throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法参数请求,每次最多查询10000条记录!").build()); } if (startTime.after(endTim...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException { if (number > 10000) { throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法参数请求,每次最多查询10000条记录!").build()); } if (startTime.after(endTim...
WxMpKefuServiceImpl implements WxMpKefuService { @Override public WxMpKfMsgList kfMsgList(Date startTime, Date endTime, Long msgId, Integer number) throws WxErrorException { if (number > 10000) { throw new WxErrorException(WxError.newBuilder().setErrorMsg("非法参数请求,每次最多查询10000条记录!").build()); } if (startTime.after(endTim...
@Test(dataProvider = "sevenDays") public void testGetUserSummary(Date beginDate, Date endDate) throws WxErrorException { List<WxDataCubeUserSummary> summaries = this.wxService.getDataCubeService() .getUserSummary(beginDate, endDate); Assert.assertNotNull(summaries); System.out.println(summaries); }
@Override public List<WxDataCubeUserSummary> getUserSummary(Date beginDate, Date endDate) throws WxErrorException { String responseContent = this.wxMpService.post(GET_USER_SUMMARY, buildParams(beginDate, endDate)); return WxDataCubeUserSummary.fromJson(responseContent); }
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeUserSummary> getUserSummary(Date beginDate, Date endDate) throws WxErrorException { String responseContent = this.wxMpService.post(GET_USER_SUMMARY, buildParams(beginDate, endDate)); return WxDataCubeUserSummary.fromJson(responseCo...
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeUserSummary> getUserSummary(Date beginDate, Date endDate) throws WxErrorException { String responseContent = this.wxMpService.post(GET_USER_SUMMARY, buildParams(beginDate, endDate)); return WxDataCubeUserSummary.fromJson(responseCo...
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeUserSummary> getUserSummary(Date beginDate, Date endDate) throws WxErrorException { String responseContent = this.wxMpService.post(GET_USER_SUMMARY, buildParams(beginDate, endDate)); return WxDataCubeUserSummary.fromJson(responseCo...
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeUserSummary> getUserSummary(Date beginDate, Date endDate) throws WxErrorException { String responseContent = this.wxMpService.post(GET_USER_SUMMARY, buildParams(beginDate, endDate)); return WxDataCubeUserSummary.fromJson(responseCo...
@Test(dataProvider = "sevenDays") public void testGetUserCumulate(Date beginDate, Date endDate) throws WxErrorException { List<WxDataCubeUserCumulate> result = this.wxService.getDataCubeService() .getUserCumulate(beginDate, endDate); Assert.assertNotNull(result); System.out.println(result); }
@Override public List<WxDataCubeUserCumulate> getUserCumulate(Date beginDate, Date endDate) throws WxErrorException { String responseContent = this.wxMpService.post(GET_USER_CUMULATE, buildParams(beginDate, endDate)); return WxDataCubeUserCumulate.fromJson(responseContent); }
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeUserCumulate> getUserCumulate(Date beginDate, Date endDate) throws WxErrorException { String responseContent = this.wxMpService.post(GET_USER_CUMULATE, buildParams(beginDate, endDate)); return WxDataCubeUserCumulate.fromJson(respon...
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeUserCumulate> getUserCumulate(Date beginDate, Date endDate) throws WxErrorException { String responseContent = this.wxMpService.post(GET_USER_CUMULATE, buildParams(beginDate, endDate)); return WxDataCubeUserCumulate.fromJson(respon...
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeUserCumulate> getUserCumulate(Date beginDate, Date endDate) throws WxErrorException { String responseContent = this.wxMpService.post(GET_USER_CUMULATE, buildParams(beginDate, endDate)); return WxDataCubeUserCumulate.fromJson(respon...
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeUserCumulate> getUserCumulate(Date beginDate, Date endDate) throws WxErrorException { String responseContent = this.wxMpService.post(GET_USER_CUMULATE, buildParams(beginDate, endDate)); return WxDataCubeUserCumulate.fromJson(respon...
@Test(dataProvider = "oneDay") public void testGetArticleSummary(Date date) throws WxErrorException { List<WxDataCubeArticleResult> results = this.wxService.getDataCubeService() .getArticleSummary(date, date); Assert.assertNotNull(results); System.out.println(results); }
@Override public List<WxDataCubeArticleResult> getArticleSummary(Date beginDate, Date endDate) throws WxErrorException { return this.getArticleResults(GET_ARTICLE_SUMMARY, beginDate, endDate); }
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeArticleResult> getArticleSummary(Date beginDate, Date endDate) throws WxErrorException { return this.getArticleResults(GET_ARTICLE_SUMMARY, beginDate, endDate); } }
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeArticleResult> getArticleSummary(Date beginDate, Date endDate) throws WxErrorException { return this.getArticleResults(GET_ARTICLE_SUMMARY, beginDate, endDate); } WxMpDataCubeServiceImpl(WxMpService wxMpService); }
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeArticleResult> getArticleSummary(Date beginDate, Date endDate) throws WxErrorException { return this.getArticleResults(GET_ARTICLE_SUMMARY, beginDate, endDate); } WxMpDataCubeServiceImpl(WxMpService wxMpService); @Override List<WxD...
WxMpDataCubeServiceImpl implements WxMpDataCubeService { @Override public List<WxDataCubeArticleResult> getArticleSummary(Date beginDate, Date endDate) throws WxErrorException { return this.getArticleResults(GET_ARTICLE_SUMMARY, beginDate, endDate); } WxMpDataCubeServiceImpl(WxMpService wxMpService); @Override List<WxD...
@Test(dependsOnMethods = {"testUpdate", "testCreate"}) public void testListAll() throws Exception { List<WxCpTag> tags = this.wxService.getTagService().listAll(); assertNotEquals(tags.size(), 0); }
@Override public List<WxCpTag> listAll() throws WxErrorException { String url = "https: String responseContent = this.mainService.get(url, null); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxCpGsonBuilder.INSTANCE.create() .fromJson( tmpJsonElement.getAsJsonObject().get("taglist"), new...
WxCpTagServiceImpl implements WxCpTagService { @Override public List<WxCpTag> listAll() throws WxErrorException { String url = "https: String responseContent = this.mainService.get(url, null); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxCpGsonBuilder.INSTANCE.create() .fromJson( tmpJs...
WxCpTagServiceImpl implements WxCpTagService { @Override public List<WxCpTag> listAll() throws WxErrorException { String url = "https: String responseContent = this.mainService.get(url, null); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxCpGsonBuilder.INSTANCE.create() .fromJson( tmpJs...
WxCpTagServiceImpl implements WxCpTagService { @Override public List<WxCpTag> listAll() throws WxErrorException { String url = "https: String responseContent = this.mainService.get(url, null); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxCpGsonBuilder.INSTANCE.create() .fromJson( tmpJs...
WxCpTagServiceImpl implements WxCpTagService { @Override public List<WxCpTag> listAll() throws WxErrorException { String url = "https: String responseContent = this.mainService.get(url, null); JsonElement tmpJsonElement = new JsonParser().parse(responseContent); return WxCpGsonBuilder.INSTANCE.create() .fromJson( tmpJs...
@Test public void testGetConnection() throws Exception { Connection connection1 = mock( VerticaConnection.class ); DelegatingConnection connection2 = mock( DelegatingConnection.class ); when( connection2.getInnermostDelegate() ).thenReturn( connection1 ); DelegatingConnection connection3 = mock( DelegatingConnection.cl...
@VisibleForTesting VerticaConnection getVerticaConnection() throws SQLException { Connection conn = data.db.getConnection(); if ( conn != null ) { if ( conn instanceof VerticaConnection ) { return (VerticaConnection) conn; } else { Connection underlyingConn = null; if ( conn instanceof DelegatingConnection ) { Delegati...
VerticaBulkLoader extends BaseStep implements StepInterface { @VisibleForTesting VerticaConnection getVerticaConnection() throws SQLException { Connection conn = data.db.getConnection(); if ( conn != null ) { if ( conn instanceof VerticaConnection ) { return (VerticaConnection) conn; } else { Connection underlyingConn ...
VerticaBulkLoader extends BaseStep implements StepInterface { @VisibleForTesting VerticaConnection getVerticaConnection() throws SQLException { Connection conn = data.db.getConnection(); if ( conn != null ) { if ( conn instanceof VerticaConnection ) { return (VerticaConnection) conn; } else { Connection underlyingConn ...
VerticaBulkLoader extends BaseStep implements StepInterface { @VisibleForTesting VerticaConnection getVerticaConnection() throws SQLException { Connection conn = data.db.getConnection(); if ( conn != null ) { if ( conn instanceof VerticaConnection ) { return (VerticaConnection) conn; } else { Connection underlyingConn ...
VerticaBulkLoader extends BaseStep implements StepInterface { @VisibleForTesting VerticaConnection getVerticaConnection() throws SQLException { Connection conn = data.db.getConnection(); if ( conn != null ) { if ( conn instanceof VerticaConnection ) { return (VerticaConnection) conn; } else { Connection underlyingConn ...
@Test public void testGetXml() throws Exception { VerticaBulkLoaderMeta vbl = new VerticaBulkLoaderMeta(); vbl.setDefault(); vbl.setFieldDatabase( new String[] { "fieldDB1", "fieldDB2", "fieldDB3", "fieldDB4", "fieldDB5" } ); vbl.setFieldStream( new String[] { "fieldStr1", "fieldStr2", "fieldStr3" } ); try { vbl.getXML...
public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " " + XMLHandler.addTagValue( "connection", databaseMeta == null ? "" : databaseMeta.getName() ) ); retval.append( " " + XMLHandler.addTagValue( "schema", schemaName ) ); retval.append( " " + XMLHandler.addTagValue( "table", tablename )...
VerticaBulkLoaderMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta { public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " " + XMLHandler.addTagValue( "connection", databaseMeta == null ? "" : databaseMeta.getName() ) ); retval.append( " " + XMLHandler.addTagVal...
VerticaBulkLoaderMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta { public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " " + XMLHandler.addTagValue( "connection", databaseMeta == null ? "" : databaseMeta.getName() ) ); retval.append( " " + XMLHandler.addTagVal...
VerticaBulkLoaderMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta { public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " " + XMLHandler.addTagValue( "connection", databaseMeta == null ? "" : databaseMeta.getName() ) ); retval.append( " " + XMLHandler.addTagVal...
VerticaBulkLoaderMeta extends BaseStepMeta implements StepMetaInterface, ProvidesModelerMeta { public String getXML() { StringBuilder retval = new StringBuilder(); retval.append( " " + XMLHandler.addTagValue( "connection", databaseMeta == null ? "" : databaseMeta.getName() ) ); retval.append( " " + XMLHandler.addTagVal...
@Test public void testStreamEncoderConstructor_NoException_ByteBufferIsPositiveInt() throws Exception { int maxTypeLenght = 500; ColumnSpec cs = new ColumnSpec( ColumnSpec.VariableWidthType.VARCHAR, maxTypeLenght ); columns.add( cs ); try { StreamEncoder stEncoder = new StreamEncoder( columns, inputStream ); long expec...
public ByteBuffer getBuffer() { return this.buffer; }
StreamEncoder { public ByteBuffer getBuffer() { return this.buffer; } }
StreamEncoder { public ByteBuffer getBuffer() { return this.buffer; } StreamEncoder( List<ColumnSpec> columns, PipedInputStream inputStream ); }
StreamEncoder { public ByteBuffer getBuffer() { return this.buffer; } StreamEncoder( List<ColumnSpec> columns, PipedInputStream inputStream ); void close(); void writeHeader(); void writeRow( RowMetaInterface rowMeta, Object[] row ); ByteBuffer getBuffer(); }
StreamEncoder { public ByteBuffer getBuffer() { return this.buffer; } StreamEncoder( List<ColumnSpec> columns, PipedInputStream inputStream ); void close(); void writeHeader(); void writeRow( RowMetaInterface rowMeta, Object[] row ); ByteBuffer getBuffer(); static final int NUM_ROWS_TO_BUFFER; }
@Test public void testCountedBufferSizeIsInt_WhenToBufferAllRowMaxSizeRequiresMoreThenInt() throws Exception { try { assertEquals( MAXIMUM_BUFFER_SIZE, getSpyStreamEncoder().countMainByteBufferSize() ); } catch ( Exception e ) { fail( "There is no exception expected But was: " + e ); } }
int countMainByteBufferSize() { long bufferSize = (long) getRowMaxSize() * NUM_ROWS_TO_BUFFER; return (int) ( bufferSize > 0 && bufferSize < MAXIMUM_BUFFER_SIZE ? bufferSize : MAXIMUM_BUFFER_SIZE ); }
StreamEncoder { int countMainByteBufferSize() { long bufferSize = (long) getRowMaxSize() * NUM_ROWS_TO_BUFFER; return (int) ( bufferSize > 0 && bufferSize < MAXIMUM_BUFFER_SIZE ? bufferSize : MAXIMUM_BUFFER_SIZE ); } }
StreamEncoder { int countMainByteBufferSize() { long bufferSize = (long) getRowMaxSize() * NUM_ROWS_TO_BUFFER; return (int) ( bufferSize > 0 && bufferSize < MAXIMUM_BUFFER_SIZE ? bufferSize : MAXIMUM_BUFFER_SIZE ); } StreamEncoder( List<ColumnSpec> columns, PipedInputStream inputStream ); }
StreamEncoder { int countMainByteBufferSize() { long bufferSize = (long) getRowMaxSize() * NUM_ROWS_TO_BUFFER; return (int) ( bufferSize > 0 && bufferSize < MAXIMUM_BUFFER_SIZE ? bufferSize : MAXIMUM_BUFFER_SIZE ); } StreamEncoder( List<ColumnSpec> columns, PipedInputStream inputStream ); void close(); void writeHeader...
StreamEncoder { int countMainByteBufferSize() { long bufferSize = (long) getRowMaxSize() * NUM_ROWS_TO_BUFFER; return (int) ( bufferSize > 0 && bufferSize < MAXIMUM_BUFFER_SIZE ? bufferSize : MAXIMUM_BUFFER_SIZE ); } StreamEncoder( List<ColumnSpec> columns, PipedInputStream inputStream ); void close(); void writeHeader...
@Test public void sayHello() { String name = faker.superhero().name(); HelloRequest request = HelloRequest.newBuilder().setName(name).build(); HelloReply helloReply = stub.sayHello(request); assertThat(helloReply.getMessage()).isEqualTo("hello " + name); }
@Override public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) { log.info("get request - {}", request.getName()); HelloReply helloReply = HelloReply .newBuilder() .setMessage(String.format("hello %s", request.getName())) .build(); log.info("reply with {}", helloReply); responseObserve...
GreeterService extends GreeterGrpc.GreeterImplBase { @Override public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) { log.info("get request - {}", request.getName()); HelloReply helloReply = HelloReply .newBuilder() .setMessage(String.format("hello %s", request.getName())) .build(); l...
GreeterService extends GreeterGrpc.GreeterImplBase { @Override public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) { log.info("get request - {}", request.getName()); HelloReply helloReply = HelloReply .newBuilder() .setMessage(String.format("hello %s", request.getName())) .build(); l...
GreeterService extends GreeterGrpc.GreeterImplBase { @Override public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) { log.info("get request - {}", request.getName()); HelloReply helloReply = HelloReply .newBuilder() .setMessage(String.format("hello %s", request.getName())) .build(); l...
GreeterService extends GreeterGrpc.GreeterImplBase { @Override public void sayHello(HelloRequest request, StreamObserver<HelloReply> responseObserver) { log.info("get request - {}", request.getName()); HelloReply helloReply = HelloReply .newBuilder() .setMessage(String.format("hello %s", request.getName())) .build(); l...
@Test public void get() throws Exception { TransportClient transportClient = transportClientProvider.get(); assertThat(transportClient).isNotNull(); }
public TransportClient get() { final String hostCsv = configuration.getString(CONFIG_ES_CLUSTER_HOST); final List<String> hosts = Splitter.on(",").splitToList(hostCsv); Preconditions.checkState(!hosts.isEmpty()); final TransportClient transportClient = new PreBuiltTransportClient(esSettings()); final Integer esTranspor...
TransportClientProvider implements Provider<TransportClient> { public TransportClient get() { final String hostCsv = configuration.getString(CONFIG_ES_CLUSTER_HOST); final List<String> hosts = Splitter.on(",").splitToList(hostCsv); Preconditions.checkState(!hosts.isEmpty()); final TransportClient transportClient = new ...
TransportClientProvider implements Provider<TransportClient> { public TransportClient get() { final String hostCsv = configuration.getString(CONFIG_ES_CLUSTER_HOST); final List<String> hosts = Splitter.on(",").splitToList(hostCsv); Preconditions.checkState(!hosts.isEmpty()); final TransportClient transportClient = new ...
TransportClientProvider implements Provider<TransportClient> { public TransportClient get() { final String hostCsv = configuration.getString(CONFIG_ES_CLUSTER_HOST); final List<String> hosts = Splitter.on(",").splitToList(hostCsv); Preconditions.checkState(!hosts.isEmpty()); final TransportClient transportClient = new ...
TransportClientProvider implements Provider<TransportClient> { public TransportClient get() { final String hostCsv = configuration.getString(CONFIG_ES_CLUSTER_HOST); final List<String> hosts = Splitter.on(",").splitToList(hostCsv); Preconditions.checkState(!hosts.isEmpty()); final TransportClient transportClient = new ...
@Test public void searchProducts() throws Exception { SearchProductsResponse searchProductsResponse = SearchProductsResponse.newBuilder() .addProducts( Product.newBuilder() .setProductId(faker.number().randomNumber()) .setProductName(faker.name().fullName()) .setCategory(faker.numerify("category-###")) .setProductStatu...
@Override public void searchProducts(SearchProductsRequest request, StreamObserver<SearchProductsResponse> responseObserver) { try { responseObserver.onNext(productDao.searchProducts(request)); responseObserver.onCompleted(); counter.labels("searchProducts", "success"); } catch (Exception e) { log.error(" error on sear...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void searchProducts(SearchProductsRequest request, StreamObserver<SearchProductsResponse> responseObserver) { try { responseObserver.onNext(productDao.searchProducts(request)); responseObserver.onCompleted(); counter.labels(...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void searchProducts(SearchProductsRequest request, StreamObserver<SearchProductsResponse> responseObserver) { try { responseObserver.onNext(productDao.searchProducts(request)); responseObserver.onCompleted(); counter.labels(...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void searchProducts(SearchProductsRequest request, StreamObserver<SearchProductsResponse> responseObserver) { try { responseObserver.onNext(productDao.searchProducts(request)); responseObserver.onCompleted(); counter.labels(...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void searchProducts(SearchProductsRequest request, StreamObserver<SearchProductsResponse> responseObserver) { try { responseObserver.onNext(productDao.searchProducts(request)); responseObserver.onCompleted(); counter.labels(...
@Test(expected = StatusRuntimeException.class) public void searchProducts_with_exception() throws Exception { when(productDao.searchProducts(any())).thenThrow(new IllegalStateException()); blockingStub.searchProducts(SearchProductsRequest.getDefaultInstance()); }
@Override public void searchProducts(SearchProductsRequest request, StreamObserver<SearchProductsResponse> responseObserver) { try { responseObserver.onNext(productDao.searchProducts(request)); responseObserver.onCompleted(); counter.labels("searchProducts", "success"); } catch (Exception e) { log.error(" error on sear...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void searchProducts(SearchProductsRequest request, StreamObserver<SearchProductsResponse> responseObserver) { try { responseObserver.onNext(productDao.searchProducts(request)); responseObserver.onCompleted(); counter.labels(...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void searchProducts(SearchProductsRequest request, StreamObserver<SearchProductsResponse> responseObserver) { try { responseObserver.onNext(productDao.searchProducts(request)); responseObserver.onCompleted(); counter.labels(...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void searchProducts(SearchProductsRequest request, StreamObserver<SearchProductsResponse> responseObserver) { try { responseObserver.onNext(productDao.searchProducts(request)); responseObserver.onCompleted(); counter.labels(...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void searchProducts(SearchProductsRequest request, StreamObserver<SearchProductsResponse> responseObserver) { try { responseObserver.onNext(productDao.searchProducts(request)); responseObserver.onCompleted(); counter.labels(...
@Test public void downloadProducts() throws Exception { doAnswer(invocation -> { PublishSubject<Product> publishSubject = (PublishSubject<Product>) invocation.getArguments()[1]; publishSubject.onNext(Product.getDefaultInstance()); publishSubject.onComplete(); return null; }).when(productDao).downloadProducts(any(), any...
@Override public void downloadProducts(DownloadProductsRequest request, StreamObserver<Product> responseObserver) { PublishSubject<Product> productPublishSubject = PublishSubject.create(); productPublishSubject .doOnNext(product -> { responseObserver.onNext(product); counter.labels("downloadProducts", "success"); }) .d...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void downloadProducts(DownloadProductsRequest request, StreamObserver<Product> responseObserver) { PublishSubject<Product> productPublishSubject = PublishSubject.create(); productPublishSubject .doOnNext(product -> { respons...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void downloadProducts(DownloadProductsRequest request, StreamObserver<Product> responseObserver) { PublishSubject<Product> productPublishSubject = PublishSubject.create(); productPublishSubject .doOnNext(product -> { respons...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void downloadProducts(DownloadProductsRequest request, StreamObserver<Product> responseObserver) { PublishSubject<Product> productPublishSubject = PublishSubject.create(); productPublishSubject .doOnNext(product -> { respons...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void downloadProducts(DownloadProductsRequest request, StreamObserver<Product> responseObserver) { PublishSubject<Product> productPublishSubject = PublishSubject.create(); productPublishSubject .doOnNext(product -> { respons...
@Test public void calculateProductScore() throws Exception { doAnswer(invocation -> { PublishSubject<CalculateProductScoreResponse> downloadStream = (PublishSubject<CalculateProductScoreResponse>) invocation.getArguments()[1]; downloadStream.onNext(CalculateProductScoreResponse.getDefaultInstance()); return null; }).wh...
@Override public StreamObserver<Product> calculateProductScore(StreamObserver<CalculateProductScoreResponse> responseObserver) { PublishSubject<CalculateProductScoreResponse> downloadStream = PublishSubject.create(); downloadStream .doOnNext(response -> { responseObserver.onNext(response); counter.labels("calculateProd...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public StreamObserver<Product> calculateProductScore(StreamObserver<CalculateProductScoreResponse> responseObserver) { PublishSubject<CalculateProductScoreResponse> downloadStream = PublishSubject.create(); downloadStream .doOnNext...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public StreamObserver<Product> calculateProductScore(StreamObserver<CalculateProductScoreResponse> responseObserver) { PublishSubject<CalculateProductScoreResponse> downloadStream = PublishSubject.create(); downloadStream .doOnNext...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public StreamObserver<Product> calculateProductScore(StreamObserver<CalculateProductScoreResponse> responseObserver) { PublishSubject<CalculateProductScoreResponse> downloadStream = PublishSubject.create(); downloadStream .doOnNext...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public StreamObserver<Product> calculateProductScore(StreamObserver<CalculateProductScoreResponse> responseObserver) { PublishSubject<CalculateProductScoreResponse> downloadStream = PublishSubject.create(); downloadStream .doOnNext...
@Test public void downloadProductImage() throws Exception { when(productImageSeeker.seekProductImage(anyLong())) .thenReturn(Resources.getResource("Large_Scaled_Forest_Lizard.jpg").openStream()); AtomicBoolean completed = new AtomicBoolean(false); AtomicBoolean error = new AtomicBoolean(false); File imageFile = File.cr...
@Override public void downloadProductImage(DownloadProductImageRequest request, StreamObserver<DataChunk> responseObserver) { try { BufferedInputStream imageStream = new BufferedInputStream( productImageSeeker.seekProductImage(request.getProductId()) ); int bufferSize = 256 * 1024; byte[] buffer = new byte[bufferSize];...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void downloadProductImage(DownloadProductImageRequest request, StreamObserver<DataChunk> responseObserver) { try { BufferedInputStream imageStream = new BufferedInputStream( productImageSeeker.seekProductImage(request.getPro...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void downloadProductImage(DownloadProductImageRequest request, StreamObserver<DataChunk> responseObserver) { try { BufferedInputStream imageStream = new BufferedInputStream( productImageSeeker.seekProductImage(request.getPro...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void downloadProductImage(DownloadProductImageRequest request, StreamObserver<DataChunk> responseObserver) { try { BufferedInputStream imageStream = new BufferedInputStream( productImageSeeker.seekProductImage(request.getPro...
ProductReadService extends ProductReadServiceGrpc.ProductReadServiceImplBase { @Override public void downloadProductImage(DownloadProductImageRequest request, StreamObserver<DataChunk> responseObserver) { try { BufferedInputStream imageStream = new BufferedInputStream( productImageSeeker.seekProductImage(request.getPro...
@Test public void uploadProduct() throws Exception { Set<UploadProductResponse> responseHolder = Sets.newHashSet(); Set<Throwable> exceptionHolder = Sets.newHashSet(); AtomicBoolean completed = new AtomicBoolean(false); StreamObserver<Product> uploadStream = stub.uploadProduct(new StreamObserver<UploadProductResponse>(...
@Override public StreamObserver<Product> uploadProduct(StreamObserver<UploadProductResponse> responseObserver) { PublishSubject<Product> publishSubject = PublishSubject.create(); publishSubject .doOnNext(product -> { log.info("saving product - {} ", product); productDao.upsertProduct(product); }) .doOnError(t -> respon...
ProductUpdateService extends ProductUpdateServiceGrpc.ProductUpdateServiceImplBase { @Override public StreamObserver<Product> uploadProduct(StreamObserver<UploadProductResponse> responseObserver) { PublishSubject<Product> publishSubject = PublishSubject.create(); publishSubject .doOnNext(product -> { log.info("saving p...
ProductUpdateService extends ProductUpdateServiceGrpc.ProductUpdateServiceImplBase { @Override public StreamObserver<Product> uploadProduct(StreamObserver<UploadProductResponse> responseObserver) { PublishSubject<Product> publishSubject = PublishSubject.create(); publishSubject .doOnNext(product -> { log.info("saving p...
ProductUpdateService extends ProductUpdateServiceGrpc.ProductUpdateServiceImplBase { @Override public StreamObserver<Product> uploadProduct(StreamObserver<UploadProductResponse> responseObserver) { PublishSubject<Product> publishSubject = PublishSubject.create(); publishSubject .doOnNext(product -> { log.info("saving p...
ProductUpdateService extends ProductUpdateServiceGrpc.ProductUpdateServiceImplBase { @Override public StreamObserver<Product> uploadProduct(StreamObserver<UploadProductResponse> responseObserver) { PublishSubject<Product> publishSubject = PublishSubject.create(); publishSubject .doOnNext(product -> { log.info("saving p...
@Test public void clientStreaming_error_break_flow() throws Exception { PublishSubject<Integer> publishSubject = PublishSubject.create(); Set<Integer> resultsHolder = Sets.newConcurrentHashSet(); Set<Throwable> exceptionsHolder = Sets.newConcurrentHashSet(); AtomicBoolean complete = new AtomicBoolean(false); Disposable...
@Override public void onError(Throwable t) { observer.onError(t); }
RxStreamObserver implements StreamObserver<T> { @Override public void onError(Throwable t) { observer.onError(t); } }
RxStreamObserver implements StreamObserver<T> { @Override public void onError(Throwable t) { observer.onError(t); } RxStreamObserver(Observer<T> observer); }
RxStreamObserver implements StreamObserver<T> { @Override public void onError(Throwable t) { observer.onError(t); } RxStreamObserver(Observer<T> observer); @Override void onNext(T value); @Override void onError(Throwable t); @Override void onCompleted(); }
RxStreamObserver implements StreamObserver<T> { @Override public void onError(Throwable t) { observer.onError(t); } RxStreamObserver(Observer<T> observer); @Override void onNext(T value); @Override void onError(Throwable t); @Override void onCompleted(); }
@Test public void echo() throws Exception { EchoRequest echoRequest = EchoRequest.newBuilder().setPing(faker.hacker().verb()).build(); EchoResponse echoResponse = stub.echo(echoRequest); assertThat(echoResponse.getPong()).isEqualTo(echoRequest.getPing()); }
@Override public void echo(EchoRequest request, StreamObserver<EchoResponse> responseObserver) { responseObserver.onNext(EchoResponse.newBuilder().setPong(request.getPing()).build()); responseObserver.onCompleted(); }
EchoService extends EchoServiceGrpc.EchoServiceImplBase { @Override public void echo(EchoRequest request, StreamObserver<EchoResponse> responseObserver) { responseObserver.onNext(EchoResponse.newBuilder().setPong(request.getPing()).build()); responseObserver.onCompleted(); } }
EchoService extends EchoServiceGrpc.EchoServiceImplBase { @Override public void echo(EchoRequest request, StreamObserver<EchoResponse> responseObserver) { responseObserver.onNext(EchoResponse.newBuilder().setPong(request.getPing()).build()); responseObserver.onCompleted(); } }
EchoService extends EchoServiceGrpc.EchoServiceImplBase { @Override public void echo(EchoRequest request, StreamObserver<EchoResponse> responseObserver) { responseObserver.onNext(EchoResponse.newBuilder().setPong(request.getPing()).build()); responseObserver.onCompleted(); } @Override void echo(EchoRequest request, St...
EchoService extends EchoServiceGrpc.EchoServiceImplBase { @Override public void echo(EchoRequest request, StreamObserver<EchoResponse> responseObserver) { responseObserver.onNext(EchoResponse.newBuilder().setPong(request.getPing()).build()); responseObserver.onCompleted(); } @Override void echo(EchoRequest request, St...
@Test public void initIndexIfNotExists() throws Exception { final IndicesExistsResponse existsResponse = esClient.admin().indices().prepareExists(INDEX).get(); assertThat(existsResponse.isExists()).isTrue(); }
public boolean initIndexIfNotExists() throws IOException { final IndicesExistsResponse existsResponse = esClient.admin().indices().prepareExists(INDEX).get(); if (existsResponse.isExists()) { return false; } final String settings = Resources.toString( getClass().getResource("/elasticsearch/product_settings.json"), Char...
ProductDao { public boolean initIndexIfNotExists() throws IOException { final IndicesExistsResponse existsResponse = esClient.admin().indices().prepareExists(INDEX).get(); if (existsResponse.isExists()) { return false; } final String settings = Resources.toString( getClass().getResource("/elasticsearch/product_settings...
ProductDao { public boolean initIndexIfNotExists() throws IOException { final IndicesExistsResponse existsResponse = esClient.admin().indices().prepareExists(INDEX).get(); if (existsResponse.isExists()) { return false; } final String settings = Resources.toString( getClass().getResource("/elasticsearch/product_settings...
ProductDao { public boolean initIndexIfNotExists() throws IOException { final IndicesExistsResponse existsResponse = esClient.admin().indices().prepareExists(INDEX).get(); if (existsResponse.isExists()) { return false; } final String settings = Resources.toString( getClass().getResource("/elasticsearch/product_settings...
ProductDao { public boolean initIndexIfNotExists() throws IOException { final IndicesExistsResponse existsResponse = esClient.admin().indices().prepareExists(INDEX).get(); if (existsResponse.isExists()) { return false; } final String settings = Resources.toString( getClass().getResource("/elasticsearch/product_settings...
@Test public void service() throws Exception { assertThat(metric.service()).isAssignableFrom(MetricTest.class); }
abstract Class service();
Metric { abstract Class service(); }
Metric { abstract Class service(); }
Metric { abstract Class service(); static Builder builder(); }
Metric { abstract Class service(); static Builder builder(); }
@Test public void upsertProduct() throws Exception { Product product = Product.newBuilder() .setProductId(faker.number().randomNumber()) .setProductName(faker.company().name()) .setProductPrice(faker.number().randomDouble(2, 10, 100)) .setProductStatus(ProductStatus.InStock) .build(); productDao.upsertProduct(product);...
public void upsertProduct(Product product) throws InvalidProtocolBufferException { log.debug("save product into ES"); final UpdateRequestBuilder updateRequestBuilder = esClient .prepareUpdate(INDEX, TYPE, String.valueOf(product.getProductId())) .setDoc( jsonPrinter .includingDefaultValueFields() .omittingInsignificantW...
ProductDao { public void upsertProduct(Product product) throws InvalidProtocolBufferException { log.debug("save product into ES"); final UpdateRequestBuilder updateRequestBuilder = esClient .prepareUpdate(INDEX, TYPE, String.valueOf(product.getProductId())) .setDoc( jsonPrinter .includingDefaultValueFields() .omittingI...
ProductDao { public void upsertProduct(Product product) throws InvalidProtocolBufferException { log.debug("save product into ES"); final UpdateRequestBuilder updateRequestBuilder = esClient .prepareUpdate(INDEX, TYPE, String.valueOf(product.getProductId())) .setDoc( jsonPrinter .includingDefaultValueFields() .omittingI...
ProductDao { public void upsertProduct(Product product) throws InvalidProtocolBufferException { log.debug("save product into ES"); final UpdateRequestBuilder updateRequestBuilder = esClient .prepareUpdate(INDEX, TYPE, String.valueOf(product.getProductId())) .setDoc( jsonPrinter .includingDefaultValueFields() .omittingI...
ProductDao { public void upsertProduct(Product product) throws InvalidProtocolBufferException { log.debug("save product into ES"); final UpdateRequestBuilder updateRequestBuilder = esClient .prepareUpdate(INDEX, TYPE, String.valueOf(product.getProductId())) .setDoc( jsonPrinter .includingDefaultValueFields() .omittingI...
@Test public void searchProducts() throws Exception { Product product1 = Product.newBuilder() .setProductId(faker.number().randomNumber()) .setProductName("apple guice") .setProductPrice(faker.number().randomDouble(2, 10, 100)) .setProductStatus(ProductStatus.InStock) .build(); Product product2 = Product.newBuilder() ....
public SearchProductsResponse searchProducts(SearchProductsRequest request) throws InvalidProtocolBufferException { QueryBuilder queryBuilder = QueryBuilders.boolQuery() .must(QueryBuilders.matchQuery("productName", request.getKeyWord())); SearchResponse response = esClient.prepareSearch(INDEX) .setTypes(TYPE) .setQuer...
ProductDao { public SearchProductsResponse searchProducts(SearchProductsRequest request) throws InvalidProtocolBufferException { QueryBuilder queryBuilder = QueryBuilders.boolQuery() .must(QueryBuilders.matchQuery("productName", request.getKeyWord())); SearchResponse response = esClient.prepareSearch(INDEX) .setTypes(T...
ProductDao { public SearchProductsResponse searchProducts(SearchProductsRequest request) throws InvalidProtocolBufferException { QueryBuilder queryBuilder = QueryBuilders.boolQuery() .must(QueryBuilders.matchQuery("productName", request.getKeyWord())); SearchResponse response = esClient.prepareSearch(INDEX) .setTypes(T...
ProductDao { public SearchProductsResponse searchProducts(SearchProductsRequest request) throws InvalidProtocolBufferException { QueryBuilder queryBuilder = QueryBuilders.boolQuery() .must(QueryBuilders.matchQuery("productName", request.getKeyWord())); SearchResponse response = esClient.prepareSearch(INDEX) .setTypes(T...
ProductDao { public SearchProductsResponse searchProducts(SearchProductsRequest request) throws InvalidProtocolBufferException { QueryBuilder queryBuilder = QueryBuilders.boolQuery() .must(QueryBuilders.matchQuery("productName", request.getKeyWord())); SearchResponse response = esClient.prepareSearch(INDEX) .setTypes(T...
@Test public void downloadProducts() throws Exception { String category = faker.numerify("category-##"); List<Product> sampleProducts = IntStream.range(1, 5).mapToObj(index -> { Product product = createProduct(category); try { productDao.upsertProduct(product); } catch (InvalidProtocolBufferException e) { log.error(" e...
public void downloadProducts(DownloadProductsRequest request, PublishSubject<Product> productPublishSubject) { QueryBuilder queryBuilder = QueryBuilders.termQuery("category", request.getCategory()); SearchResponse scrollResponse = esClient .prepareSearch(INDEX) .setScroll(DEFAULT_SCROLL_TIME_VALUE) .setTypes(TYPE) .set...
ProductDao { public void downloadProducts(DownloadProductsRequest request, PublishSubject<Product> productPublishSubject) { QueryBuilder queryBuilder = QueryBuilders.termQuery("category", request.getCategory()); SearchResponse scrollResponse = esClient .prepareSearch(INDEX) .setScroll(DEFAULT_SCROLL_TIME_VALUE) .setTyp...
ProductDao { public void downloadProducts(DownloadProductsRequest request, PublishSubject<Product> productPublishSubject) { QueryBuilder queryBuilder = QueryBuilders.termQuery("category", request.getCategory()); SearchResponse scrollResponse = esClient .prepareSearch(INDEX) .setScroll(DEFAULT_SCROLL_TIME_VALUE) .setTyp...
ProductDao { public void downloadProducts(DownloadProductsRequest request, PublishSubject<Product> productPublishSubject) { QueryBuilder queryBuilder = QueryBuilders.termQuery("category", request.getCategory()); SearchResponse scrollResponse = esClient .prepareSearch(INDEX) .setScroll(DEFAULT_SCROLL_TIME_VALUE) .setTyp...
ProductDao { public void downloadProducts(DownloadProductsRequest request, PublishSubject<Product> productPublishSubject) { QueryBuilder queryBuilder = QueryBuilders.termQuery("category", request.getCategory()); SearchResponse scrollResponse = esClient .prepareSearch(INDEX) .setScroll(DEFAULT_SCROLL_TIME_VALUE) .setTyp...
@Test public void calculateProductScore() throws Exception { PublishSubject<CalculateProductScoreResponse> publishSubject = PublishSubject.create(); List<CalculateProductScoreResponse> responses = Lists.newArrayList(); publishSubject .doOnNext(response -> responses.add(response)) .subscribe(); Product product = createP...
public void calculateProductScore(Product product, PublishSubject<CalculateProductScoreResponse> downloadStream) { downloadStream.onNext( CalculateProductScoreResponse .newBuilder() .setProduct(product) .setScore((long) product.getProductPrice()) .build() ); }
ProductDao { public void calculateProductScore(Product product, PublishSubject<CalculateProductScoreResponse> downloadStream) { downloadStream.onNext( CalculateProductScoreResponse .newBuilder() .setProduct(product) .setScore((long) product.getProductPrice()) .build() ); } }
ProductDao { public void calculateProductScore(Product product, PublishSubject<CalculateProductScoreResponse> downloadStream) { downloadStream.onNext( CalculateProductScoreResponse .newBuilder() .setProduct(product) .setScore((long) product.getProductPrice()) .build() ); } }
ProductDao { public void calculateProductScore(Product product, PublishSubject<CalculateProductScoreResponse> downloadStream) { downloadStream.onNext( CalculateProductScoreResponse .newBuilder() .setProduct(product) .setScore((long) product.getProductPrice()) .build() ); } void upsertProduct(Product product); boolean ...
ProductDao { public void calculateProductScore(Product product, PublishSubject<CalculateProductScoreResponse> downloadStream) { downloadStream.onNext( CalculateProductScoreResponse .newBuilder() .setProduct(product) .setScore((long) product.getProductPrice()) .build() ); } void upsertProduct(Product product); boolean ...
@Test public void action() throws Exception { assertThat(metric.action().get()).isEqualTo("test"); }
abstract Optional<String> action();
Metric { abstract Optional<String> action(); }
Metric { abstract Optional<String> action(); }
Metric { abstract Optional<String> action(); static Builder builder(); }
Metric { abstract Optional<String> action(); static Builder builder(); }
@Test public void labels() throws Exception { assertThat(metric.labels()).isNotEmpty(); assertThat(metric.labels().get()).contains("labela", "labelb"); }
abstract Optional<List<String>> labels();
Metric { abstract Optional<List<String>> labels(); }
Metric { abstract Optional<List<String>> labels(); }
Metric { abstract Optional<List<String>> labels(); static Builder builder(); }
Metric { abstract Optional<List<String>> labels(); static Builder builder(); }
@Test(expected = IllegalStateException.class) public void mandatory_field() throws Exception { metric = Metric .builder() .build(); fail("should failed as mandatory field is missing"); }
public static Builder builder() { return new AutoValue_Metric.Builder(); }
Metric { public static Builder builder() { return new AutoValue_Metric.Builder(); } }
Metric { public static Builder builder() { return new AutoValue_Metric.Builder(); } }
Metric { public static Builder builder() { return new AutoValue_Metric.Builder(); } static Builder builder(); }
Metric { public static Builder builder() { return new AutoValue_Metric.Builder(); } static Builder builder(); }
@Test public void create() throws Exception { Counter counter1 = CounterFactory.create( Metric.builder() .setService(CounterFactoryTest.class) .setAction("test") .build() ); assertThat(counter1).isNotNull(); Counter counter2 = CounterFactory.create( Metric.builder() .setService(CounterFactoryTest.class) .setAction("tes...
public static Counter create(final Metric metric) { return cachedCounter.getUnchecked(metric); }
CounterFactory { public static Counter create(final Metric metric) { return cachedCounter.getUnchecked(metric); } }
CounterFactory { public static Counter create(final Metric metric) { return cachedCounter.getUnchecked(metric); } }
CounterFactory { public static Counter create(final Metric metric) { return cachedCounter.getUnchecked(metric); } static Counter create(final Metric metric); }
CounterFactory { public static Counter create(final Metric metric) { return cachedCounter.getUnchecked(metric); } static Counter create(final Metric metric); }
@Test public void get() throws Exception { Configuration configuration = configurationProvider.get(); assertThat(configuration.getString("key1")).isEqualTo("value1"); }
@Override public Configuration get() { Configurations configs = new Configurations(); try { return configs.properties(new File(getPropertyFilePath())); } catch (ConfigurationException e) { log.error(" error on build configuration", e); throw new IllegalStateException(e); } }
ConfigurationProvider implements Provider<Configuration> { @Override public Configuration get() { Configurations configs = new Configurations(); try { return configs.properties(new File(getPropertyFilePath())); } catch (ConfigurationException e) { log.error(" error on build configuration", e); throw new IllegalStateExc...
ConfigurationProvider implements Provider<Configuration> { @Override public Configuration get() { Configurations configs = new Configurations(); try { return configs.properties(new File(getPropertyFilePath())); } catch (ConfigurationException e) { log.error(" error on build configuration", e); throw new IllegalStateExc...
ConfigurationProvider implements Provider<Configuration> { @Override public Configuration get() { Configurations configs = new Configurations(); try { return configs.properties(new File(getPropertyFilePath())); } catch (ConfigurationException e) { log.error(" error on build configuration", e); throw new IllegalStateExc...
ConfigurationProvider implements Provider<Configuration> { @Override public Configuration get() { Configurations configs = new Configurations(); try { return configs.properties(new File(getPropertyFilePath())); } catch (ConfigurationException e) { log.error(" error on build configuration", e); throw new IllegalStateExc...
@Test(expected = IllegalStateException.class) public void properties_file_not_found() throws Exception { System.setProperty(Constants.CONFIG_PROP_FILE_PATH, "xxx"); configurationProvider = new ConfigurationProvider(); configurationProvider.get(); fail("should meet IllegalStateException"); }
@Override public Configuration get() { Configurations configs = new Configurations(); try { return configs.properties(new File(getPropertyFilePath())); } catch (ConfigurationException e) { log.error(" error on build configuration", e); throw new IllegalStateException(e); } }
ConfigurationProvider implements Provider<Configuration> { @Override public Configuration get() { Configurations configs = new Configurations(); try { return configs.properties(new File(getPropertyFilePath())); } catch (ConfigurationException e) { log.error(" error on build configuration", e); throw new IllegalStateExc...
ConfigurationProvider implements Provider<Configuration> { @Override public Configuration get() { Configurations configs = new Configurations(); try { return configs.properties(new File(getPropertyFilePath())); } catch (ConfigurationException e) { log.error(" error on build configuration", e); throw new IllegalStateExc...
ConfigurationProvider implements Provider<Configuration> { @Override public Configuration get() { Configurations configs = new Configurations(); try { return configs.properties(new File(getPropertyFilePath())); } catch (ConfigurationException e) { log.error(" error on build configuration", e); throw new IllegalStateExc...
ConfigurationProvider implements Provider<Configuration> { @Override public Configuration get() { Configurations configs = new Configurations(); try { return configs.properties(new File(getPropertyFilePath())); } catch (ConfigurationException e) { log.error(" error on build configuration", e); throw new IllegalStateExc...
@Test public void getPropertyFilePath() throws Exception { assertThat(configurationProvider.getPropertyFilePath()).isEqualTo(path); }
public String getPropertyFilePath() { return propertyFilePath; }
ConfigurationProvider implements Provider<Configuration> { public String getPropertyFilePath() { return propertyFilePath; } }
ConfigurationProvider implements Provider<Configuration> { public String getPropertyFilePath() { return propertyFilePath; } ConfigurationProvider(); }
ConfigurationProvider implements Provider<Configuration> { public String getPropertyFilePath() { return propertyFilePath; } ConfigurationProvider(); @Override Configuration get(); String getPropertyFilePath(); }
ConfigurationProvider implements Provider<Configuration> { public String getPropertyFilePath() { return propertyFilePath; } ConfigurationProvider(); @Override Configuration get(); String getPropertyFilePath(); }
@Test public void testConfigure() throws Exception { Injector injector = Guice.createInjector(new ElasticSearchModule()); Configuration configuration = injector.getInstance(Configuration.class); assertThat(configuration.getString("key1")).isEqualTo("value1"); }
@Override protected void configure() { bind(Configuration.class).toProvider(ConfigurationProvider.class).in(Singleton.class); bind(TransportClient.class).toProvider(TransportClientProvider.class).in(Singleton.class); bind(JsonFormat.Printer.class).toInstance(JsonFormat.printer()); bind(JsonFormat.Parser.class).toInstan...
ElasticSearchModule extends AbstractModule { @Override protected void configure() { bind(Configuration.class).toProvider(ConfigurationProvider.class).in(Singleton.class); bind(TransportClient.class).toProvider(TransportClientProvider.class).in(Singleton.class); bind(JsonFormat.Printer.class).toInstance(JsonFormat.print...
ElasticSearchModule extends AbstractModule { @Override protected void configure() { bind(Configuration.class).toProvider(ConfigurationProvider.class).in(Singleton.class); bind(TransportClient.class).toProvider(TransportClientProvider.class).in(Singleton.class); bind(JsonFormat.Printer.class).toInstance(JsonFormat.print...
ElasticSearchModule extends AbstractModule { @Override protected void configure() { bind(Configuration.class).toProvider(ConfigurationProvider.class).in(Singleton.class); bind(TransportClient.class).toProvider(TransportClientProvider.class).in(Singleton.class); bind(JsonFormat.Printer.class).toInstance(JsonFormat.print...
ElasticSearchModule extends AbstractModule { @Override protected void configure() { bind(Configuration.class).toProvider(ConfigurationProvider.class).in(Singleton.class); bind(TransportClient.class).toProvider(TransportClientProvider.class).in(Singleton.class); bind(JsonFormat.Printer.class).toInstance(JsonFormat.print...
@Test public void testServerLoginSuccess() { String email = "dummy@gmail.com"; String password = "password"; LoginResponse loginResponse = new LoginResponse(); doReturn(Single.just(loginResponse)) .when(mMockDataManager) .doServerLoginApiCall(new LoginRequest.ServerLoginRequest(email, password)); mLoginViewModel.login(...
public void login(String email, String password) { setIsLoading(true); getCompositeDisposable().add(getDataManager() .doServerLoginApiCall(new LoginRequest.ServerLoginRequest(email, password)) .doOnSuccess(response -> getDataManager() .updateUserInfo( response.getAccessToken(), response.getUserId(), DataManager.LoggedI...
LoginViewModel extends BaseViewModel<LoginNavigator> { public void login(String email, String password) { setIsLoading(true); getCompositeDisposable().add(getDataManager() .doServerLoginApiCall(new LoginRequest.ServerLoginRequest(email, password)) .doOnSuccess(response -> getDataManager() .updateUserInfo( response.getA...
LoginViewModel extends BaseViewModel<LoginNavigator> { public void login(String email, String password) { setIsLoading(true); getCompositeDisposable().add(getDataManager() .doServerLoginApiCall(new LoginRequest.ServerLoginRequest(email, password)) .doOnSuccess(response -> getDataManager() .updateUserInfo( response.getA...
LoginViewModel extends BaseViewModel<LoginNavigator> { public void login(String email, String password) { setIsLoading(true); getCompositeDisposable().add(getDataManager() .doServerLoginApiCall(new LoginRequest.ServerLoginRequest(email, password)) .doOnSuccess(response -> getDataManager() .updateUserInfo( response.getA...
LoginViewModel extends BaseViewModel<LoginNavigator> { public void login(String email, String password) { setIsLoading(true); getCompositeDisposable().add(getDataManager() .doServerLoginApiCall(new LoginRequest.ServerLoginRequest(email, password)) .doOnSuccess(response -> getDataManager() .updateUserInfo( response.getA...
@Test @SuppressWarnings("unchecked") public void convertToSwaggerValidJson() throws Exception { String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8")); Assert.assertNotNull(raml); String swagger = raml2Swagger.convertToSwagger(raml); Assert.assertNotNull(swagger); TypeReference<HashMap<St...
@SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
@Test @SuppressWarnings("unchecked") public void convertToSwaggerFromString() throws Exception { String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8")); Assert.assertNotNull(raml); String swagger = raml2Swagger.convertToSwagger(raml); Assert.assertNotNull(swagger); TypeReference<HashMap<S...
@SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
@Test @SuppressWarnings("unchecked") public void checkQueryParameters() throws Exception { String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8")); Assert.assertNotNull(raml); String swagger = raml2Swagger.convertToSwagger(raml); Assert.assertNotNull(swagger); TypeReference<HashMap<String,...
@SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
@Test @SuppressWarnings("unchecked") public void checkPathParameters() throws Exception { String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8")); Assert.assertNotNull(raml); String swagger = raml2Swagger.convertToSwagger(raml); Assert.assertNotNull(swagger); TypeReference<HashMap<String, ...
@SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
@Test @SuppressWarnings("unchecked") public void checkCorrectParametersResolution() throws Exception { String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8")); Assert.assertNotNull(raml); String swagger = raml2Swagger.convertToSwagger(raml); Assert.assertNotNull(swagger); TypeReference<Has...
@SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
@Test public void convertToSwaggerFromInputStream() throws Exception { String raml = IOUtils.resourceToString(PRODUCT_API_RAML, Charset.forName("UTF-8")); Assert.assertNotNull(raml); String swagger = raml2Swagger.convertToSwagger(raml); Assert.assertNotNull(swagger); String swagger2 = raml2Swagger.convertToSwagger(getC...
@SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); }
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
RAMLtoSwagger implements Constants { @SuppressWarnings("WeakerAccess, unused") public String convertToSwagger(String raml) { return convertToSwagger(raml, null); } RAMLtoSwagger(); @SuppressWarnings("WeakerAccess, unused") String convertToSwagger(String raml); @SuppressWarnings("WeakerAccess, unused") String convertToS...
@Test public void testInvokeRpc() throws Exception { final ContainerNode outputBi = mock(ContainerNode.class); final DataObject outputBa = mock(DataObject.class); when(serializer.toNormalizedNodeRpcData(ArgumentMatchers.any())).thenReturn(outputBi); when(registry.invoke(path, input)).thenReturn(CompletableFuture.comple...
@Nonnull @Override public FluentFuture<DOMRpcResult> invokeRpc(@Nonnull final SchemaPath schemaPath, @Nullable final NormalizedNode<?, ?> normalizedNode) { DataObject input = null; if (normalizedNode != null) { final SchemaPath nodePatch = schemaPath.createChild(normalizedNode.getNodeType()); input = serializer.fromNor...
HoneycombDOMRpcService implements DOMRpcService { @Nonnull @Override public FluentFuture<DOMRpcResult> invokeRpc(@Nonnull final SchemaPath schemaPath, @Nullable final NormalizedNode<?, ?> normalizedNode) { DataObject input = null; if (normalizedNode != null) { final SchemaPath nodePatch = schemaPath.createChild(normali...
HoneycombDOMRpcService implements DOMRpcService { @Nonnull @Override public FluentFuture<DOMRpcResult> invokeRpc(@Nonnull final SchemaPath schemaPath, @Nullable final NormalizedNode<?, ?> normalizedNode) { DataObject input = null; if (normalizedNode != null) { final SchemaPath nodePatch = schemaPath.createChild(normali...
HoneycombDOMRpcService implements DOMRpcService { @Nonnull @Override public FluentFuture<DOMRpcResult> invokeRpc(@Nonnull final SchemaPath schemaPath, @Nullable final NormalizedNode<?, ?> normalizedNode) { DataObject input = null; if (normalizedNode != null) { final SchemaPath nodePatch = schemaPath.createChild(normali...
HoneycombDOMRpcService implements DOMRpcService { @Nonnull @Override public FluentFuture<DOMRpcResult> invokeRpc(@Nonnull final SchemaPath schemaPath, @Nullable final NormalizedNode<?, ?> normalizedNode) { DataObject input = null; if (normalizedNode != null) { final SchemaPath nodePatch = schemaPath.createChild(normali...
@Test public void testNotificationTypes() throws Exception { final HoneycombNotificationCollector honeycombNotificationCollector = new HoneycombNotificationCollector(notificationService, notificationRegistry); honeycombNotificationCollector.getNotificationTypes(); verify(producer, atLeast(1)).getNotificationTypes(); }
@Override @Nonnull public Collection<Class<? extends Notification>> getNotificationTypes() { return notificationProducerRegistry.getNotificationTypes(); }
HoneycombNotificationCollector implements NotificationCollector, AutoCloseable { @Override @Nonnull public Collection<Class<? extends Notification>> getNotificationTypes() { return notificationProducerRegistry.getNotificationTypes(); } }
HoneycombNotificationCollector implements NotificationCollector, AutoCloseable { @Override @Nonnull public Collection<Class<? extends Notification>> getNotificationTypes() { return notificationProducerRegistry.getNotificationTypes(); } HoneycombNotificationCollector( @Nonnull final NotificationPublishService bi...
HoneycombNotificationCollector implements NotificationCollector, AutoCloseable { @Override @Nonnull public Collection<Class<? extends Notification>> getNotificationTypes() { return notificationProducerRegistry.getNotificationTypes(); } HoneycombNotificationCollector( @Nonnull final NotificationPublishService bi...
HoneycombNotificationCollector implements NotificationCollector, AutoCloseable { @Override @Nonnull public Collection<Class<? extends Notification>> getNotificationTypes() { return notificationProducerRegistry.getNotificationTypes(); } HoneycombNotificationCollector( @Nonnull final NotificationPublishService bi...
@Test public void testCollect() throws Exception { final HoneycombNotificationCollector honeycombNotificationCollector = new HoneycombNotificationCollector(notificationService, notificationRegistry); final NetconfSessionStart notif = new NetconfSessionStartBuilder().build(); honeycombNotificationCollector.onNotificatio...
@Override public void onNotification(@Nonnull final Notification notification) { LOG.debug("Notification: {} pushed into collector", notification.getClass().getSimpleName()); LOG.trace("Notification: {} pushed into collector", notification); try { bindingDOMNotificationPublishServiceAdapter.putNotification(notification...
HoneycombNotificationCollector implements NotificationCollector, AutoCloseable { @Override public void onNotification(@Nonnull final Notification notification) { LOG.debug("Notification: {} pushed into collector", notification.getClass().getSimpleName()); LOG.trace("Notification: {} pushed into collector", notification...
HoneycombNotificationCollector implements NotificationCollector, AutoCloseable { @Override public void onNotification(@Nonnull final Notification notification) { LOG.debug("Notification: {} pushed into collector", notification.getClass().getSimpleName()); LOG.trace("Notification: {} pushed into collector", notification...
HoneycombNotificationCollector implements NotificationCollector, AutoCloseable { @Override public void onNotification(@Nonnull final Notification notification) { LOG.debug("Notification: {} pushed into collector", notification.getClass().getSimpleName()); LOG.trace("Notification: {} pushed into collector", notification...
HoneycombNotificationCollector implements NotificationCollector, AutoCloseable { @Override public void onNotification(@Nonnull final Notification notification) { LOG.debug("Notification: {} pushed into collector", notification.getClass().getSimpleName()); LOG.trace("Notification: {} pushed into collector", notification...