Search in sources :

Example 1 with RequestExecutor

use of me.chanjar.weixin.common.util.http.RequestExecutor in project weixin-java-tools by chanjarster.

the class WxMpBusyRetryTest method getService.

@DataProvider(name = "getService")
public Object[][] getService() {
    WxMpService service = new WxMpServiceImpl() {

        @Override
        protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
            WxError error = new WxError();
            error.setErrorCode(-1);
            throw new WxErrorException(error);
        }
    };
    service.setMaxRetryTimes(3);
    service.setRetrySleepMillis(500);
    return new Object[][] { new Object[] { service } };
}
Also used : WxError(me.chanjar.weixin.common.bean.result.WxError) RequestExecutor(me.chanjar.weixin.common.util.http.RequestExecutor) WxErrorException(me.chanjar.weixin.common.exception.WxErrorException) DataProvider(org.testng.annotations.DataProvider)

Example 2 with RequestExecutor

use of me.chanjar.weixin.common.util.http.RequestExecutor in project weixin-java-tools by chanjarster.

the class WxCpBusyRetryTest method getService.

@DataProvider(name = "getService")
public Object[][] getService() {
    WxCpService service = new WxCpServiceImpl() {

        @Override
        protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
            WxError error = new WxError();
            error.setErrorCode(-1);
            throw new WxErrorException(error);
        }
    };
    service.setMaxRetryTimes(3);
    service.setRetrySleepMillis(500);
    return new Object[][] { new Object[] { service } };
}
Also used : WxError(me.chanjar.weixin.common.bean.result.WxError) RequestExecutor(me.chanjar.weixin.common.util.http.RequestExecutor) WxErrorException(me.chanjar.weixin.common.exception.WxErrorException) DataProvider(org.testng.annotations.DataProvider)

Aggregations

WxError (me.chanjar.weixin.common.bean.result.WxError)2 WxErrorException (me.chanjar.weixin.common.exception.WxErrorException)2 RequestExecutor (me.chanjar.weixin.common.util.http.RequestExecutor)2 DataProvider (org.testng.annotations.DataProvider)2