MySQLAuthenticationEngine implements AuthenticationEngine { @Override public int handshake(final ChannelHandlerContext context) { int result = ConnectionIdGenerator.getInstance().nextId(); connectionPhase = MySQLConnectionPhase.AUTH_PHASE_FAST_PATH; context.writeAndFlush(new MySQLHandshakePacket(result, authenticationHandler.getAuthPluginData())); return result; }  @Override int handshake(final ChannelHandlerContext context); @Override AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload);  }
@Test public void assertHandshake() { ChannelHandlerContext context = getContext(); assertTrue(authenticationEngine.handshake(context) > 0); verify(context).writeAndFlush(any(MySQLHandshakePacket.class)); }