mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-05 05:07:46 +08:00
🎨 Use explicit types on lambda arguments
This commit is contained in:
parent
44e4ee4416
commit
3039dd018e
@ -48,7 +48,7 @@ public class ApacheHttpDnsClientBuilder implements ApacheHttpClientBuilder {
|
||||
|
||||
private DnsResolver dnsResover;
|
||||
|
||||
private HttpRequestRetryHandler httpRequestRetryHandler = (exception, executionCount, context) -> false;
|
||||
private HttpRequestRetryHandler httpRequestRetryHandler = (IOException exception, int executionCount, HttpContext context) -> false;
|
||||
private SSLConnectionSocketFactory sslConnectionSocketFactory = SSLConnectionSocketFactory.getSocketFactory();
|
||||
private PlainConnectionSocketFactory plainConnectionSocketFactory = PlainConnectionSocketFactory.getSocketFactory();
|
||||
private String httpProxyHost;
|
||||
|
@ -92,7 +92,7 @@ public class BaseWxCpServiceImplTest {
|
||||
RequestExecutor<Object, Object> re = mock(RequestExecutor.class);
|
||||
|
||||
AtomicInteger counter = new AtomicInteger();
|
||||
Mockito.when(re.execute(Mockito.anyString(), Mockito.any(), Mockito.any())).thenAnswer(invocation -> {
|
||||
Mockito.when(re.execute(Mockito.anyString(), Mockito.any(), Mockito.any())).thenAnswer((InvocationOnMock invocation) -> {
|
||||
counter.incrementAndGet();
|
||||
WxError error = WxError.builder().errorCode(WxMpErrorMsgEnum.CODE_40001.getCode()).errorMsg(WxMpErrorMsgEnum.CODE_40001.getMsg()).build();
|
||||
throw new WxErrorException(error);
|
||||
|
@ -49,14 +49,14 @@ public class WxCpDemoServer {
|
||||
wxCpService = new WxCpServiceImpl();
|
||||
wxCpService.setWxCpConfigStorage(config);
|
||||
|
||||
WxCpMessageHandler handler = (wxMessage, context, wxService, sessionManager) -> {
|
||||
WxCpMessageHandler handler = (WxCpXmlMessage wxMessage, Map context, WxCpService wxService, WxSessionManager sessionManager) -> {
|
||||
WxCpXmlOutTextMessage m = WxCpXmlOutMessage.TEXT().content("测试加密消息")
|
||||
.fromUser(wxMessage.getToUserName())
|
||||
.toUser(wxMessage.getFromUserName()).build();
|
||||
return m;
|
||||
};
|
||||
|
||||
WxCpMessageHandler oauth2handler = (wxMessage, context, wxService, sessionManager) -> {
|
||||
WxCpMessageHandler oauth2handler = (WxCpXmlMessage wxMessage, Map context, WxCpService wxService, WxSessionManager sessionManager) -> {
|
||||
String href = "<a href=\""
|
||||
+ wxService.getOauth2Service().buildAuthorizationUrl(wxCpConfigStorage.getOauth2redirectUri(), null)
|
||||
+ "\">测试oauth2</a>";
|
||||
@ -78,7 +78,7 @@ public class WxCpDemoServer {
|
||||
.end()
|
||||
.rule()
|
||||
.event(WxCpConsts.EventType.CHANGE_CONTACT)
|
||||
.handler((wxMessage, context, wxCpService, sessionManager) -> {
|
||||
.handler((WxCpXmlMessage wxMessage, Map context, WxCpService wxCpService, WxSessionManager sessionManager) -> {
|
||||
System.out.println("通讯录发生变更");
|
||||
return null;
|
||||
})
|
||||
|
@ -127,7 +127,7 @@ public class WxMaServiceImplTest {
|
||||
RequestExecutor<Object, Object> re = mock(RequestExecutor.class);
|
||||
|
||||
AtomicInteger counter = new AtomicInteger();
|
||||
Mockito.when(re.execute(Mockito.anyString(), Mockito.any(), Mockito.any())).thenAnswer(invocation -> {
|
||||
Mockito.when(re.execute(Mockito.anyString(), Mockito.any(), Mockito.any())).thenAnswer((InvocationOnMock invocation) -> {
|
||||
counter.incrementAndGet();
|
||||
WxError error = WxError.builder().errorCode(WxMpErrorMsgEnum.CODE_40001.getCode()).errorMsg(WxMpErrorMsgEnum.CODE_40001.getMsg()).build();
|
||||
throw new WxErrorException(error);
|
||||
|
@ -237,7 +237,7 @@ public class BaseWxMpServiceImplTest {
|
||||
RequestExecutor<Object, Object> re = mock(RequestExecutor.class);
|
||||
|
||||
AtomicInteger counter = new AtomicInteger();
|
||||
Mockito.when(re.execute(Mockito.anyString(), Mockito.any(), Mockito.any())).thenAnswer(invocation -> {
|
||||
Mockito.when(re.execute(Mockito.anyString(), Mockito.any(), Mockito.any())).thenAnswer((InvocationOnMock invocation) -> {
|
||||
counter.incrementAndGet();
|
||||
WxError error = WxError.builder().errorCode(WxMpErrorMsgEnum.CODE_40001.getCode()).errorMsg(WxMpErrorMsgEnum.CODE_40001.getMsg()).build();
|
||||
throw new WxErrorException(error);
|
||||
|
Loading…
Reference in New Issue
Block a user