@Test public void testQueryBillsAsyncByBean() throws Exception { final BCHttpClientUtil.Response response = new BCHttpClientUtil.Response(); response.code = 200; response.content = "{\"result_msg\":\"OK\",\"err_detail\":\"\",\"result_code\":0,\"bills\":[{\"bill_no\":\"bc1447657931\"}]}"; PowerMockito.stub(PowerMockito.method(BCHttpClientUtil.class, "httpGet", String.class)).toReturn(response); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA); BCQuery.QueryParams queryParams = new BCQuery.QueryParams(); queryParams.channel = BCReqParams.BCChannelTypes.WX; queryParams.startTime = sdf.parse("2015-10-01 00:00").getTime(); query.queryBillsAsync(queryParams, new BCCallback() { @Override public void done(BCResult result) { Assert.assertTrue(result instanceof BCQueryBillsResult); BCQueryBillsResult billsResult = (BCQueryBillsResult) result; Assert.assertEquals((Integer) 0, billsResult.getResultCode()); Assert.assertEquals((int) billsResult.getCount(), billsResult.getBills().size()); BCBillOrder billOrder = billsResult.getBills().get(0); Assert.assertEquals("bc1447657931", billOrder.getBillNum()); latch.countDown(); } }); latch.await(2000, TimeUnit.MILLISECONDS); }
public void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final String billNum, final Long startTime, final Long endTime, final Integer skip, final Integer limit, final BCCallback callback) { queryOrdersAsync(channel, QueryOrderType.QUERY_BILLS, billNum, null, null, null, startTime, endTime, skip, limit, null, callback); }
BCQuery { public void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final String billNum, final Long startTime, final Long endTime, final Integer skip, final Integer limit, final BCCallback callback) { queryOrdersAsync(channel, QueryOrderType.QUERY_BILLS, billNum, null, null, null, startTime, endTime, skip, limit, null, callback); } }
BCQuery { public void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final String billNum, final Long startTime, final Long endTime, final Integer skip, final Integer limit, final BCCallback callback) { queryOrdersAsync(channel, QueryOrderType.QUERY_BILLS, billNum, null, null, null, startTime, endTime, skip, limit, null, callback); } private  BCQuery(); }
BCQuery { public void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final String billNum, final Long startTime, final Long endTime, final Integer skip, final Integer limit, final BCCallback callback) { queryOrdersAsync(channel, QueryOrderType.QUERY_BILLS, billNum, null, null, null, startTime, endTime, skip, limit, null, callback); } private  BCQuery(); synchronized static BCQuery getInstance(); void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final String billNum,
                                final Long startTime, final Long endTime,
                                final Integer skip, final Integer limit, final BCCallback callback); void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final BCCallback callback); void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final String billNum, final BCCallback callback); void queryBillsAsync(final QueryParams queryParams, final BCCallback callback); void queryRefundsAsync(final BCReqParams.BCChannelTypes channel, final String billNum, final String refundNum,
                                final Long startTime, final Long endTime,
                                final Integer skip, final Integer limit, final BCCallback callback); void queryRefundsAsync(final BCReqParams.BCChannelTypes channel, final BCCallback callback); void queryRefundsAsync(final BCReqParams.BCChannelTypes channel, final String billNum,
                                  final String refundNum, final BCCallback callback); void queryRefundsAsync(final QueryParams queryParams, final BCCallback callback); void queryBillsCountAsync(final QueryParams queryParams, final BCCallback callback); void queryRefundsCountAsync(final QueryParams queryParams, final BCCallback callback); void queryRefundStatusAsync(final BCReqParams.BCChannelTypes channel, final String refundNum,
                                       final BCCallback callback); void queryBillByIDAsync(final String id, final BCCallback callback); void queryRefundByIDAsync(final String id, final BCCallback callback); void queryOfflineBillStatusAsync(final BCReqParams.BCChannelTypes channelType,
                                          final String billNum,
                                          final BCCallback callback); void subscriptionSupportedBanks(final BCCallback callback); void queryPlans(final BCPlanCriteria criteria, final BCCallback callback); void querySubscriptions(final BCSubscriptionCriteria criteria, final BCCallback callback); }
BCQuery { public void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final String billNum, final Long startTime, final Long endTime, final Integer skip, final Integer limit, final BCCallback callback) { queryOrdersAsync(channel, QueryOrderType.QUERY_BILLS, billNum, null, null, null, startTime, endTime, skip, limit, null, callback); } private  BCQuery(); synchronized static BCQuery getInstance(); void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final String billNum,
                                final Long startTime, final Long endTime,
                                final Integer skip, final Integer limit, final BCCallback callback); void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final BCCallback callback); void queryBillsAsync(final BCReqParams.BCChannelTypes channel, final String billNum, final BCCallback callback); void queryBillsAsync(final QueryParams queryParams, final BCCallback callback); void queryRefundsAsync(final BCReqParams.BCChannelTypes channel, final String billNum, final String refundNum,
                                final Long startTime, final Long endTime,
                                final Integer skip, final Integer limit, final BCCallback callback); void queryRefundsAsync(final BCReqParams.BCChannelTypes channel, final BCCallback callback); void queryRefundsAsync(final BCReqParams.BCChannelTypes channel, final String billNum,
                                  final String refundNum, final BCCallback callback); void queryRefundsAsync(final QueryParams queryParams, final BCCallback callback); void queryBillsCountAsync(final QueryParams queryParams, final BCCallback callback); void queryRefundsCountAsync(final QueryParams queryParams, final BCCallback callback); void queryRefundStatusAsync(final BCReqParams.BCChannelTypes channel, final String refundNum,
                                       final BCCallback callback); void queryBillByIDAsync(final String id, final BCCallback callback); void queryRefundByIDAsync(final String id, final BCCallback callback); void queryOfflineBillStatusAsync(final BCReqParams.BCChannelTypes channelType,
                                          final String billNum,
                                          final BCCallback callback); void subscriptionSupportedBanks(final BCCallback callback); void queryPlans(final BCPlanCriteria criteria, final BCCallback callback); void querySubscriptions(final BCSubscriptionCriteria criteria, final BCCallback callback);  }