PostgreSQLAuthenticationEngine implements AuthenticationEngine { @Override public int handshake(final ChannelHandlerContext context) { int result = ConnectionIdGenerator.getInstance().nextId(); BinaryStatementRegistry.getInstance().register(result); return result; }  @Override int handshake(final ChannelHandlerContext context); @Override AuthenticationResult auth(final ChannelHandlerContext context, final PacketPayload payload);  }
@Test public void assertHandshake() { int connectionId = new PostgreSQLAuthenticationEngine().handshake(mock(ChannelHandlerContext.class)); assertNotNull(BinaryStatementRegistry.getInstance().get(connectionId)); }