Fix tests after backport of #44055
This commit is contained in:
parent
b3076adae6
commit
17846212bd
|
@ -68,7 +68,9 @@ public class EventHandlerTests extends ESTestCase {
|
||||||
SocketChannel rawChannel = mock(SocketChannel.class);
|
SocketChannel rawChannel = mock(SocketChannel.class);
|
||||||
when(rawChannel.finishConnect()).thenReturn(true);
|
when(rawChannel.finishConnect()).thenReturn(true);
|
||||||
NioSocketChannel channel = new NioSocketChannel(rawChannel);
|
NioSocketChannel channel = new NioSocketChannel(rawChannel);
|
||||||
when(rawChannel.socket()).thenReturn(mock(Socket.class));
|
Socket socket = mock(Socket.class);
|
||||||
|
when(rawChannel.socket()).thenReturn(socket);
|
||||||
|
when(socket.getChannel()).thenReturn(rawChannel);
|
||||||
context = new DoNotRegisterSocketContext(channel, selector, channelExceptionHandler, readWriteHandler);
|
context = new DoNotRegisterSocketContext(channel, selector, channelExceptionHandler, readWriteHandler);
|
||||||
channel.setContext(context);
|
channel.setContext(context);
|
||||||
handler.handleRegistration(context);
|
handler.handleRegistration(context);
|
||||||
|
|
|
@ -85,6 +85,7 @@ public class SocketChannelContextTests extends ESTestCase {
|
||||||
});
|
});
|
||||||
rawSocket = mock(Socket.class);
|
rawSocket = mock(Socket.class);
|
||||||
when(rawChannel.socket()).thenReturn(rawSocket);
|
when(rawChannel.socket()).thenReturn(rawSocket);
|
||||||
|
when(rawSocket.getChannel()).thenReturn(rawChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testIOExceptionSetIfEncountered() throws IOException {
|
public void testIOExceptionSetIfEncountered() throws IOException {
|
||||||
|
|
Loading…
Reference in New Issue