MySQLClient { public synchronized boolean execute(final String queryString) { responseCallback = new DefaultPromise<>(eventLoopGroup.next()); MySQLComQueryPacket comQueryPacket = new MySQLComQueryPacket(queryString); channel.writeAndFlush(comQueryPacket); return null != waitExpectedResponse(MySQLOKPacket.class); }  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 assertExecute() throws NoSuchFieldException, IllegalAccessException { mockChannelResponse(new MySQLOKPacket(0)); ReflectionUtil.setFieldValueToClass(mysqlClient, "channel", channel); ReflectionUtil.setFieldValueToClass(mysqlClient, "eventLoopGroup", new NioEventLoopGroup(1)); assertTrue(mysqlClient.execute("")); verify(channel).writeAndFlush(ArgumentMatchers.any(MySQLComQueryPacket.class)); }