terrymanu commented on a change in pull request #3205: bugfix for #3144
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3205#discussion_r333381849
 
 

 ##########
 File path: 
sharding-core/sharding-core-route/src/test/java/org/apache/shardingsphere/core/route/router/sharding/validator/impl/ShardingUpdateStatementValidatorTest.java
 ##########
 @@ -30,32 +41,79 @@
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
 
-import java.util.Collections;
-
-import static org.mockito.Mockito.when;
+import com.google.common.collect.Lists;
 
 @RunWith(MockitoJUnitRunner.class)
 public final class ShardingUpdateStatementValidatorTest {
-    
+
     @Mock
     private ShardingRule shardingRule;
-    
+
     @Test
     public void assertValidateUpdateWithoutShardingKey() {
         when(shardingRule.isShardingColumn("id", "user")).thenReturn(false);
-        new ShardingUpdateStatementValidator().validate(shardingRule, 
createUpdateStatement());
+        new ShardingUpdateStatementValidator().validate(shardingRule, 
createUpdateStatement(), null);
     }
-    
+
     @Test(expected = ShardingException.class)
     public void assertValidateUpdateWithShardingKey() {
         when(shardingRule.isShardingColumn("id", "user")).thenReturn(true);
-        new ShardingUpdateStatementValidator().validate(shardingRule, 
createUpdateStatement());
+        new ShardingUpdateStatementValidator().validate(shardingRule, 
createUpdateStatement(), null);
     }
-    
+
+    @Test
+    public void assertValidateUpdateWithoutShardingKeyAndParameters() {
+        when(shardingRule.isShardingColumn("id", "user")).thenReturn(false);
+        List<Object> parameters = Lists.newArrayList();
+        parameters.add(1);
+        parameters.add(1);
+        new ShardingUpdateStatementValidator().validate(shardingRule, 
createUpdateStatementAndParameters(1), parameters);
+    }
+
+    @Test
+    public void 
assertValidateUpdateWithShardingKeyAndShardingParameterEquals() {
+        when(shardingRule.isShardingColumn("id", "user")).thenReturn(true);
+        List<Object> parameters = Lists.newArrayList();
+        parameters.add(1);
+        parameters.add(1);
+        // set parameter = 1
 
 Review comment:
   please remove temp codes

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to