Payments { private String downloadBill(Date date, String type){ DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); BillRequestWrapper billRequestWrapper = new BillRequestWrapper(); billRequestWrapper.setDate(dateFormat.format(date)); billRequestWrapper.setType(type); setBaseSettings(billRequestWrapper); SortedMap<String, Object> billRequestMap = JsonMapper.nonEmptyMapper().getMapper().convertValue(billRequestWrapper, SortedMap.class); sign(billRequestWrapper, billRequestMap); String url = WxEndpoint.get("url.pay.payment.bill.download"); try { String xml = XmlObjectMapper.nonEmptyMapper().toXml(billRequestWrapper); logger.info("支付 bill download request: {}", xml); String response = wxSslClient.post(url, xml); logger.info("支付 bill download response: {}", response); return response; } catch (Exception e) { throw new WxRuntimeException(999, "bill download failed:" + e.getMessage()); } }  void setPaySetting(PaySetting paySetting); static Payments defaultPayments(); static Payments with(PaySetting paySetting); void setWxSslClient(WxSslClient wxSslClient); UnifiedOrderResponse unifiedOrder(UnifiedOrderRequest unifiedOrderRequest); com.riversoft.weixin.pay.payment.bean.OrderQueryResponse query(com.riversoft.weixin.pay.payment.bean.OrderQueryRequest orderQueryRequest); BaseResponse close(String tradeNumber); boolean checkSignature(PaymentNotification notification); RefundResponse refund(RefundRequest refundRequest); RefundQuery refundQueryByTransactionId(String transactionId); RefundQuery refundQueryByTradeNumber(String tradeNumber); RefundQuery refundQueryByRefundNumber(String refundNumber); RefundQuery refundQueryByRefundId(String refundId); RefundQuery refundQuery(RefundQueryRequestWrapper refundQueryRequestWrapper); String downloadAllBill(Date date); String downloadRefundBill(Date date); String downloadSuccessBill(Date date);  }
@Test public void testDownloadBill(){ String response = Payments.defaultPayments().downloadAllBill(new Date()); Assert.assertNotNull(response); }