diff --git a/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/test/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/AllMySQLMySQLCommandPacketTests.java b/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/test/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/AllMySQLMySQLCommandPacketTests.java index feeed773f52724a9b85fa7c82e17b8e33d5369fd..398d22792881cc4be757e3134366b4285fd0ce95 100644 --- a/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/test/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/AllMySQLMySQLCommandPacketTests.java +++ b/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/test/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/AllMySQLMySQLCommandPacketTests.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.ad import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.admin.quit.MySQLComQuitPacketTest; import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.MySQLColumnDefinition41PacketTest; import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.MySQLFieldCountPacketTest; -import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.MySQLMySQLBinaryStatementRegistryTest; +import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.MySQLBinaryStatementRegistryTest; import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.close.MySQLComStmtClosePacketTest; import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.execute.MySQLBinaryResultSetRowPacketTest; import org.apache.shardingsphere.shardingproxy.transport.mysql.packet.command.query.binary.execute.MySQLComStmtExecutePacketTest; @@ -43,7 +43,7 @@ import org.junit.runners.Suite.SuiteClasses; MySQLCommandPacketTypeLoaderTest.class, MySQLMySQLCommandPacketTypeTest.class, MySQLMySQLCommandPacketFactoryTest.class, - MySQLMySQLBinaryStatementRegistryTest.class, + MySQLBinaryStatementRegistryTest.class, MySQLNullBitmapTest.class, AllMySQLBinaryProtocolTests.class, MySQLFieldCountPacketTest.class, diff --git a/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/test/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/MySQLMySQLBinaryStatementRegistryTest.java b/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/test/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/MySQLBinaryStatementRegistryTest.java similarity index 83% rename from sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/test/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/MySQLMySQLBinaryStatementRegistryTest.java rename to sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/test/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/MySQLBinaryStatementRegistryTest.java index ce5a6e04300b5aa541c050a136fb0dc55efe37a5..d532738d8ffc5fd529338139c3542abca7bca545 100644 --- a/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/test/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/MySQLMySQLBinaryStatementRegistryTest.java +++ b/sharding-proxy/sharding-proxy-transport/sharding-proxy-transport-mysql/src/test/java/org/apache/shardingsphere/shardingproxy/transport/mysql/packet/command/query/binary/MySQLBinaryStatementRegistryTest.java @@ -23,9 +23,10 @@ import org.junit.Before; import org.junit.Test; import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertNull; import static org.junit.Assert.assertThat; -public final class MySQLMySQLBinaryStatementRegistryTest { +public final class MySQLBinaryStatementRegistryTest { private final String sql = "SELECT * FROM tbl WHERE id=?"; @@ -51,4 +52,12 @@ public final class MySQLMySQLBinaryStatementRegistryTest { assertThat(actual.getSql(), is(sql)); assertThat(actual.getParametersCount(), is(1)); } + + @Test + public void assertRemoveIfPresent() { + MySQLBinaryStatementRegistry.getInstance().register(sql, 1); + MySQLBinaryStatementRegistry.getInstance().remove(1); + MySQLBinaryStatement actual = MySQLBinaryStatementRegistry.getInstance().getBinaryStatement(1); + assertNull(actual); + } }