MySQLOKPacket implements MySQLPacket { @Override public void write(final MySQLPacketPayload payload) { payload.writeInt1(HEADER); payload.writeIntLenenc(affectedRows); payload.writeIntLenenc(lastInsertId); payload.writeInt2(statusFlag); payload.writeInt2(warnings); payload.writeStringEOF(info); } MySQLOKPacket(final int sequenceId);  MySQLOKPacket(final int sequenceId, final long affectedRows, final long lastInsertId);  MySQLOKPacket(final MySQLPacketPayload payload); @Override void write(final MySQLPacketPayload payload); static final int HEADER; }
@Test public void assertWrite() { new MySQLOKPacket(1, 100L, 9999L).write(packetPayload); verify(packetPayload).writeInt1(MySQLOKPacket.HEADER); verify(packetPayload).writeIntLenenc(100L); verify(packetPayload).writeIntLenenc(9999L); verify(packetPayload).writeInt2(MySQLStatusFlag.SERVER_STATUS_AUTOCOMMIT.getValue()); verify(packetPayload).writeInt2(0); verify(packetPayload).writeStringEOF(""); }