### Question:
MySQLConnector { public synchronized int executeUpdate(final String queryString) { responseCallback = new DefaultPromise<>(eventLoopGroup.next()); QueryCommandPacket queryCommandPacket = new QueryCommandPacket(); queryCommandPacket.setQueryString(queryString); channel.writeAndFlush(queryCommandPacket); return (int) waitExpectedResponse(OkPacket.class).getAffectedRows(); }  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();  }### Answer:
@Test public void assertExecuteUpdate() throws NoSuchFieldException, IllegalAccessException { OkPacket expected = new OkPacket(); ReflectionUtil.setFieldValueToClass(expected, "affectedRows", 10); mockChannelResponse(expected); ReflectionUtil.setFieldValueToClass(mySQLConnector, "channel", channel); assertThat(mySQLConnector.executeUpdate(""), is(10)); verify(channel).writeAndFlush(ArgumentMatchers.any(QueryCommandPacket.class)); }