You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/09/03 06:57:33 UTC

[GitHub] [shardingsphere] 291277058 commented on a change in pull request #7229: #7163

291277058 commented on a change in pull request #7229:
URL: https://github.com/apache/shardingsphere/pull/7229#discussion_r482746296



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/test/java/org/apache/shardingsphere/sharding/spring/namespace/ShardingSpringNamespaceTest.java
##########
@@ -105,141 +103,141 @@
     
     @Test
     public void assertDataSourceShardingAlgorithm() {
-        assertThat(dataSourceShardingAlgorithm.getType(), is("INLINE"));
-        assertThat(dataSourceShardingAlgorithm.getProps().getProperty("algorithm.expression"), is("ds_$->{order_id % 2}"));
+        Assert.assertThat(dataSourceShardingAlgorithm.getType(), CoreMatchers.is("INLINE"));
+        Assert.assertThat(dataSourceShardingAlgorithm.getProps().getProperty("algorithm-expression"), CoreMatchers.is("ds_$->{order_id % 2}"));
     }
     
     @Test
     public void assertOrderTableShardingAlgorithm() {
-        assertThat(orderTableShardingAlgorithm.getType(), is("INLINE"));
-        assertThat(orderTableShardingAlgorithm.getProps().getProperty("algorithm.expression"), is("t_order_$->{order_id % 4}"));
+        Assert.assertThat(orderTableShardingAlgorithm.getType(), CoreMatchers.is("INLINE"));
+        Assert.assertThat(orderTableShardingAlgorithm.getProps().getProperty("algorithm-expression"), CoreMatchers.is("t_order_$->{order_id % 4}"));
     }
     
     @Test
     public void assertModShardingAlgorithm() {
-        assertThat(modShardingAlgorithm.getType(), is("MOD"));
-        assertThat(modShardingAlgorithm.getProps().getProperty("sharding.count"), is("2"));
+        Assert.assertThat(modShardingAlgorithm.getType(), CoreMatchers.is("MOD"));
+        Assert.assertThat(modShardingAlgorithm.getProps().getProperty("sharding-count"), CoreMatchers.is("2"));
     }
     
     @Test
     public void assertComplexShardingAlgorithm() {
-        assertThat(complexShardingAlgorithm.getType(), is("COMPLEX_TEST"));
+        Assert.assertThat(complexShardingAlgorithm.getType(), CoreMatchers.is("COMPLEX_TEST"));
     }
     
     @Test
     public void assertHintShardingAlgorithm() {
-        assertThat(hintShardingAlgorithm.getType(), is("HINT_TEST"));
+        Assert.assertThat(hintShardingAlgorithm.getType(), CoreMatchers.is("HINT_TEST"));
     }
     
     @Test
     public void assertDataSourceShardingStrategy() {
-        assertThat(dataSourceShardingStrategy.getShardingColumn(), is("order_id"));
-        assertThat(dataSourceShardingStrategy.getShardingAlgorithmName(), is("dataSourceShardingAlgorithm"));
+        Assert.assertThat(dataSourceShardingStrategy.getShardingColumn(), CoreMatchers.is("order_id"));
+        Assert.assertThat(dataSourceShardingStrategy.getShardingAlgorithmName(), CoreMatchers.is("dataSourceShardingAlgorithm"));
     }
     
     @Test
     public void assertOrderTableShardingStrategy() {
-        assertThat(orderTableShardingStrategy.getShardingColumn(), is("order_id"));
-        assertThat(orderTableShardingStrategy.getShardingAlgorithmName(), is("orderTableShardingAlgorithm"));
+        Assert.assertThat(orderTableShardingStrategy.getShardingColumn(), CoreMatchers.is("order_id"));
+        Assert.assertThat(orderTableShardingStrategy.getShardingAlgorithmName(), CoreMatchers.is("orderTableShardingAlgorithm"));
     }
     
     @Test
     public void assertModStrategy() {
-        assertThat(modStrategy.getShardingColumn(), is("order_id"));
-        assertThat(modStrategy.getShardingAlgorithmName(), is("modShardingAlgorithm"));
+        Assert.assertThat(modStrategy.getShardingColumn(), CoreMatchers.is("order_id"));
+        Assert.assertThat(modStrategy.getShardingAlgorithmName(), CoreMatchers.is("modShardingAlgorithm"));
     }
     
     @Test
     public void assertComplexStrategy() {
-        assertThat(complexStrategy.getShardingColumns(), is("order_id,user_id"));
-        assertThat(complexStrategy.getShardingAlgorithmName(), is("complexShardingAlgorithm"));
+        Assert.assertThat(complexStrategy.getShardingColumns(), CoreMatchers.is("order_id,user_id"));
+        Assert.assertThat(complexStrategy.getShardingAlgorithmName(), CoreMatchers.is("complexShardingAlgorithm"));
     }
     
     @Test
     public void assertHintStrategy() {
-        assertThat(hintShardingStrategy.getShardingAlgorithmName(), is("hintShardingAlgorithm"));
+        Assert.assertThat(hintShardingStrategy.getShardingAlgorithmName(), CoreMatchers.is("hintShardingAlgorithm"));
     }
     
     @Test
     public void assertNoneStrategy() {
-        assertNotNull(noneStrategy);
+        Assert.assertNotNull(noneStrategy);
     }
     
     @Test
     public void assertIncrementAlgorithm() {
-        assertThat(incrementAlgorithm.getType(), is("INCREMENT"));
+        Assert.assertThat(incrementAlgorithm.getType(), CoreMatchers.is("INCREMENT"));
     }
     
     @Test
     public void assertDefaultKeyGenerator() {
-        assertThat(defaultKeyGenerator.getColumn(), is("id"));
-        assertThat(defaultKeyGenerator.getKeyGeneratorName(), is("incrementAlgorithm"));
+        Assert.assertThat(defaultKeyGenerator.getColumn(), CoreMatchers.is("id"));
+        Assert.assertThat(defaultKeyGenerator.getKeyGeneratorName(), CoreMatchers.is("incrementAlgorithm"));
     }
     
     @Test
     public void assertOrderKeyGenerator() {
-        assertThat(orderKeyGenerator.getColumn(), is("order_id"));
-        assertThat(orderKeyGenerator.getKeyGeneratorName(), is("incrementAlgorithm"));
+        Assert.assertThat(orderKeyGenerator.getColumn(), CoreMatchers.is("order_id"));
+        Assert.assertThat(orderKeyGenerator.getKeyGeneratorName(), CoreMatchers.is("incrementAlgorithm"));
     }
     
     @Test
     public void assertSimpleRule() {
         Collection<ShardingTableRuleConfiguration> actualSimpleRuleConfigurations = simpleRule.getTables();
-        assertThat(actualSimpleRuleConfigurations.size(), is(1));
+        Assert.assertThat(actualSimpleRuleConfigurations.size(), CoreMatchers.is(1));
         ShardingTableRuleConfiguration actualSimpleRuleConfiguration = actualSimpleRuleConfigurations.iterator().next();
-        assertThat(actualSimpleRuleConfiguration.getLogicTable(), is("t_order"));
+        Assert.assertThat(actualSimpleRuleConfiguration.getLogicTable(), CoreMatchers.is("t_order"));
     }
     
     @Test
     public void assertComplexRule() {
         Collection<ShardingTableRuleConfiguration> actualComplexRuleConfigurations = complexRule.getTables();
-        assertThat(actualComplexRuleConfigurations.size(), is(1));
+        Assert.assertThat(actualComplexRuleConfigurations.size(), CoreMatchers.is(1));

Review comment:
       It will cause code check error. I have be suggested to avoid startic import.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org