🎨 Use explicit types on lambda arguments

This commit is contained in:
Kyle Scully 2021-10-23 08:27:14 -07:00 committed by GitHub
parent 44e4ee4416
commit 3039dd018e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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;
})

View File

@ -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);

View File

@ -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);