MySQLBinlogEventHeader implements MySQLPacket { @Override public int getSequenceId() { return 0; } MySQLBinlogEventHeader(final MySQLPacketPayload payload); @Override void write(final MySQLPacketPayload payload); @Override int getSequenceId(); static final int MYSQL_BINLOG_EVENT_HEADER_LENGTH; }
@Test public void assertNew() { when(payload.readInt4()).thenReturn(1234567890, 123456, 19, 4); when(payload.readInt1()).thenReturn(MySQLBinlogEventType.UNKNOWN_EVENT.getValue()); when(payload.readInt2()).thenReturn(MySQLBinlogEventFlag.LOG_EVENT_BINLOG_IN_USE_F.getValue()); MySQLBinlogEventHeader actual = new MySQLBinlogEventHeader(payload); assertThat(actual.getSequenceId(), is(0)); assertThat(actual.getTimestamp(), is(1234567890)); assertThat(actual.getEventType(), is(MySQLBinlogEventType.UNKNOWN_EVENT.getValue())); assertThat(actual.getServerId(), is(123456)); assertThat(actual.getEventSize(), is(19)); assertThat(actual.getLogPos(), is(4)); assertThat(actual.getFlags(), is(MySQLBinlogEventFlag.LOG_EVENT_BINLOG_IN_USE_F.getValue())); }