You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/06/11 03:07:28 UTC
[shardingsphere] branch master updated: Remove useless assertion (#18298)
This is an automated email from the ASF dual-hosted git repository.
zhaojinchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new dfda0fd75f3 Remove useless assertion (#18298)
dfda0fd75f3 is described below
commit dfda0fd75f37051ce051e9af743a83073b40e577
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Jun 11 11:07:23 2022 +0800
Remove useless assertion (#18298)
---
.../infra/database/type/DatabaseTypeEngineTest.java | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeEngineTest.java b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeEngineTest.java
index 195ebadb1b7..f268f4a0991 100644
--- a/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeEngineTest.java
+++ b/shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/database/type/DatabaseTypeEngineTest.java
@@ -17,16 +17,13 @@
package org.apache.shardingsphere.infra.database.type;
-import java.util.Properties;
import org.apache.shardingsphere.infra.config.database.DatabaseConfiguration;
import org.apache.shardingsphere.infra.config.database.impl.DataSourceProvidedDatabaseConfiguration;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.database.type.dialect.MariaDBDatabaseType;
import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
-import org.apache.shardingsphere.infra.database.type.dialect.OracleDatabaseType;
import org.apache.shardingsphere.infra.fixture.FixtureRuleConfiguration;
-import static org.hamcrest.CoreMatchers.instanceOf;
import org.junit.Test;
import javax.sql.DataSource;
@@ -35,7 +32,9 @@ import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.Properties;
+import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
@@ -192,13 +191,10 @@ public final class DatabaseTypeEngineTest {
@Test
public void assertGetProtocolType() {
- Properties trunkDatabaseProps = new Properties();
- trunkDatabaseProps.setProperty(ConfigurationPropertyKey.PROXY_FRONTEND_DATABASE_PROTOCOL_TYPE.getKey(), "H2");
- DatabaseConfiguration databaseConfig = new DataSourceProvidedDatabaseConfiguration(Collections.emptyMap(), Collections.singletonList(new FixtureRuleConfiguration()));
- assertThat(DatabaseTypeEngine.getProtocolType(Collections.singletonMap("logic_db", databaseConfig), new ConfigurationProperties(trunkDatabaseProps)), instanceOf(MySQLDatabaseType.class));
- Properties noTrunkDatabaseProps = new Properties();
- noTrunkDatabaseProps.setProperty(ConfigurationPropertyKey.PROXY_FRONTEND_DATABASE_PROTOCOL_TYPE.getKey(), "Oracle");
- assertThat(DatabaseTypeEngine.getProtocolType(Collections.singletonMap("logic_db", databaseConfig), new ConfigurationProperties(noTrunkDatabaseProps)), instanceOf(OracleDatabaseType.class));
+ Properties props = new Properties();
+ props.setProperty(ConfigurationPropertyKey.PROXY_FRONTEND_DATABASE_PROTOCOL_TYPE.getKey(), "H2");
+ DatabaseConfiguration databaseConfig = new DataSourceProvidedDatabaseConfiguration(Collections.emptyMap(), Collections.singleton(new FixtureRuleConfiguration()));
+ assertThat(DatabaseTypeEngine.getProtocolType(Collections.singletonMap("logic_db", databaseConfig), new ConfigurationProperties(props)), instanceOf(MySQLDatabaseType.class));
}
@Test