MySQLBinlogEventHeader implements MySQLPacket { @Override public void write(final MySQLPacketPayload payload) { payload.writeInt4(timestamp); payload.writeInt1(eventType); payload.writeInt4(serverId); payload.writeInt4(eventSize); payload.writeInt4(logPos); payload.writeInt2(flags); } MySQLBinlogEventHeader(final MySQLPacketPayload payload); @Override void write(final MySQLPacketPayload payload); @Override int getSequenceId(); static final int MYSQL_BINLOG_EVENT_HEADER_LENGTH; }
@Test public void assertWrite() { new MySQLBinlogEventHeader(1234567890, MySQLBinlogEventType.UNKNOWN_EVENT.getValue(), 123456, 19, 4, MySQLBinlogEventFlag.LOG_EVENT_BINLOG_IN_USE_F.getValue()).write(payload); verify(payload).writeInt4(1234567890); verify(payload).writeInt1(MySQLBinlogEventType.UNKNOWN_EVENT.getValue()); verify(payload).writeInt4(123456); verify(payload).writeInt4(19); verify(payload).writeInt4(4); verify(payload).writeInt2(MySQLBinlogEventFlag.LOG_EVENT_BINLOG_IN_USE_F.getValue()); }