MySQLClient { public synchronized void subscribe(final String binlogFileName, final long binlogPosition) { initDumpConnectSession(); registerSlave(); dumpBinlog(binlogFileName, binlogPosition, queryChecksumLength()); }  synchronized void connect(); synchronized boolean execute(final String queryString); synchronized int executeUpdate(final String queryString); synchronized InternalResultSet executeQuery(final String queryString); synchronized void subscribe(final String binlogFileName, final long binlogPosition); synchronized AbstractBinlogEvent poll();  }
@Test public void assertSubscribeBelow56Version() throws NoSuchFieldException, IllegalAccessException { ServerInfo serverInfo = new ServerInfo(); serverInfo.setServerVersion(new ServerVersion("5.5.0-log")); ReflectionUtil.setFieldValueToClass(mysqlClient, "serverInfo", serverInfo); ReflectionUtil.setFieldValueToClass(mysqlClient, "channel", channel); ReflectionUtil.setFieldValueToClass(mysqlClient, "eventLoopGroup", new NioEventLoopGroup(1)); mockChannelResponse(new MySQLOKPacket(0)); mysqlClient.subscribe("", 4L); verify(channel).writeAndFlush(ArgumentMatchers.any(MySQLComRegisterSlaveCommandPacket.class)); verify(channel).writeAndFlush(ArgumentMatchers.any(MySQLComBinlogDumpCommandPacket.class)); }