BCOfflinePay { public void reqAliOfflineQRCodeAsync(final String billTitle, final Integer billTotalFee, final String billNum, final Map<String, String> optional, final Boolean genQRCode, final Integer qrCodeWidth, final BCCallback callback) { reqQRCodeAsync(BCReqParams.BCChannelTypes.ALI_OFFLINE_QRCODE, billTitle, billTotalFee, billNum, optional, genQRCode, qrCodeWidth, callback); } private  BCOfflinePay(); synchronized static BCOfflinePay getInstance(); static Bitmap generateBitmap(String contentsToEncode,
                                        int imageWidth, int imageHeight,
                                        int marginSize, int color, int colorBack); void reqQRCodeAsync(final BCReqParams.BCChannelTypes channelType,
                               final String billTitle, final Integer billTotalFee,
                               final String billNum, final Map<String, String> optional,
                               final Boolean genQRCode, final Integer qrCodeWidth,
                               final BCCallback callback); void reqQRCodeAsync(final PayParams payParam,
                               final BCCallback callback); void reqOfflinePayAsync(final BCReqParams.BCChannelTypes channelType,
                                   final String billTitle, final Integer billTotalFee,
                                   final String billNum, final Map<String, String> optional,
                                   final String authCode, final String terminalId,
                                   final String storeId, final BCCallback callback); void reqOfflinePayAsync(final PayParams payParam, final BCCallback callback); void reqWXNativeQRCodeAsync(final String billTitle, final Integer billTotalFee,
                                       final String billNum, final Map<String, String> optional,
                                       final Boolean genQRCode, final Integer qrCodeWidth,
                                       final BCCallback callback); void reqAliOfflineQRCodeAsync(final String billTitle, final Integer billTotalFee,
                                         final String billNum, final Map<String, String> optional,
                                         final Boolean genQRCode, final Integer qrCodeWidth,
                                         final BCCallback callback); void reqRevertBillAsync(final BCReqParams.BCChannelTypes channelType,
                                   final String billNum,
                                   final BCCallback callback);  }
@Test public void testReqAliOfflineQRCodeAsync() throws Exception { final BCHttpClientUtil.Response response = new BCHttpClientUtil.Response(); response.code = 400; response.content = "wrong"; PowerMockito.stub(PowerMockito.method(BCHttpClientUtil.class, "httpPost", String.class, Map.class)).toReturn(response); pay.reqAliOfflineQRCodeAsync("订单标题", 1, "123456789ABCDE", null, Boolean.FALSE, 123, new BCCallback() { @Override public void done(BCResult result) { Assert.assertTrue(result instanceof BCQRCodeResult); BCQRCodeResult bcqrCodeResult = (BCQRCodeResult) result; Assert.assertEquals(BCRestfulCommonResult.APP_INNER_FAIL_NUM, bcqrCodeResult.getResultCode()); latch.countDown(); } }); latch.await(2000, TimeUnit.MILLISECONDS); }