@Override
    protected void write(final PostgreSQLPacketPayload payload) {
        payload.writeInt4(AUTH_REQ_SHA256);
        payload.writeInt4(PASSWORD_STORED_METHOD_SHA256);
        payload.writeBytes(authHexData.getSalt().getBytes());
        payload.writeBytes(authHexData.getNonce().getBytes());
        if (version < OpenGaussProtocolVersion.PROTOCOL_350.getVersion()) {
            payload.writeBytes(serverSignature.getBytes());
        }
        if (OpenGaussProtocolVersion.PROTOCOL_351.getVersion() == version) {
            payload.writeInt4(serverIteration);
        }
    }
@Test
    void assertWriteProtocol351Packet() {
        PostgreSQLPacketPayload payload = mock(PostgreSQLPacketPayload.class);
        OpenGaussAuthenticationSCRAMSha256Packet packet = new OpenGaussAuthenticationSCRAMSha256Packet(OpenGaussProtocolVersion.PROTOCOL_351.getVersion(), 10000, authHexData, "");
        packet.write(payload);
        verify(payload).writeInt4(10);
        verify(payload).writeInt4(2);
        verify(payload).writeBytes(authHexData.getSalt().getBytes());
        verify(payload).writeBytes(authHexData.getNonce().getBytes());
        verify(payload).writeInt4(10000);
        verify(payload, times(2)).writeBytes(any());
    }