Search in sources :

Example 6 with BCQueryCountResult

use of cn.beecloud.entity.BCQueryCountResult in project ttdj by soonphe.

the class BCQueryTest method testQueryRefundsCountAsyncTestMode.

/**
 * #4
 * test mode
 * @throws Exception
 */
@Test
public void testQueryRefundsCountAsyncTestMode() throws Exception {
    BeeCloud.setSandbox(true);
    BCQuery.QueryParams queryParams = new BCQuery.QueryParams();
    queryParams.channel = BCReqParams.BCChannelTypes.WX;
    query.queryRefundsCountAsync(queryParams, new BCCallback() {

        @Override
        public void done(BCResult result) {
            Assert.assertTrue(result instanceof BCQueryCountResult);
            BCQueryCountResult countResult = (BCQueryCountResult) result;
            Assert.assertEquals(BCRestfulCommonResult.APP_INNER_FAIL_NUM, countResult.getResultCode());
            Assert.assertEquals("该功能暂不支持测试模式", countResult.getErrDetail());
            latch.countDown();
        }
    });
    latch.await(2000, TimeUnit.MILLISECONDS);
}
Also used : BCQueryCountResult(cn.beecloud.entity.BCQueryCountResult) BCCallback(cn.beecloud.async.BCCallback) BCResult(cn.beecloud.async.BCResult) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 7 with BCQueryCountResult

use of cn.beecloud.entity.BCQueryCountResult in project ttdj by soonphe.

the class BCQueryTest method testQueryBillsCountAsyncChannelInvalid.

/**
 * #1
 * 测试channel为null
 * @throws Exception
 */
@Test
public void testQueryBillsCountAsyncChannelInvalid() throws Exception {
    BCQuery.QueryParams queryParams = new BCQuery.QueryParams();
    queryParams.channel = null;
    query.queryBillsCountAsync(queryParams, new BCCallback() {

        @Override
        public void done(BCResult result) {
            Assert.assertTrue(result instanceof BCQueryCountResult);
            BCQueryCountResult countResult = (BCQueryCountResult) result;
            Assert.assertEquals(BCRestfulCommonResult.APP_INNER_FAIL_NUM, countResult.getResultCode());
            latch.countDown();
        }
    });
    latch.await(2000, TimeUnit.MILLISECONDS);
}
Also used : BCQueryCountResult(cn.beecloud.entity.BCQueryCountResult) BCCallback(cn.beecloud.async.BCCallback) BCResult(cn.beecloud.async.BCResult) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

BCCallback (cn.beecloud.async.BCCallback)7 BCResult (cn.beecloud.async.BCResult)7 BCQueryCountResult (cn.beecloud.entity.BCQueryCountResult)7 Test (org.junit.Test)7 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)7 SimpleDateFormat (java.text.SimpleDateFormat)1