terrymanu commented on code in PR #19152:
URL: https://github.com/apache/shardingsphere/pull/19152#discussion_r921202109


##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/updatable/AlterTrafficRuleHandlerTest.java:
##########
@@ -68,6 +69,22 @@ public void assertExecuteWithInvalidAlgorithmType() throws 
SQLException {
         handler.execute();
     }
     
+    @Test(expected = IllegalStateException.class)
+    public void assertExecuteWithLoadBalancerCannotBeNull() throws 
SQLException {
+        mockContextManager();
+        TrafficRuleSegment trafficRuleSegment = new 
TrafficRuleSegment("input_rule_name", Arrays.asList("olap", "order_by"),
+                new AlgorithmSegment("DISTSQL.FIXTURE", new Properties()), 
null);
+        CreateTrafficRuleHandler handler = new CreateTrafficRuleHandler();
+        handler.init(new 
CreateTrafficRuleStatement(Collections.singleton(trafficRuleSegment)), null);
+        try {
+            handler.execute();
+        } catch (IllegalStateException ex) {

Review Comment:
   Please add final for exception catch



##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/updatable/CreateTrafficRuleHandlerTest.java:
##########
@@ -69,6 +69,22 @@ public void assertExecuteWithInvalidAlgorithmType() throws 
SQLException {
         handler.execute();
     }
     
+    @Test(expected = IllegalStateException.class)
+    public void assertExecuteWithLoadBalancerCannotBeNull() throws 
SQLException {
+        mockContextManager();
+        TrafficRuleSegment trafficRuleSegment = new 
TrafficRuleSegment("input_rule_name", Arrays.asList("olap", "order_by"),
+                new AlgorithmSegment("DISTSQL.FIXTURE", new Properties()), 
null);
+        CreateTrafficRuleHandler handler = new CreateTrafficRuleHandler();
+        handler.init(new 
CreateTrafficRuleStatement(Collections.singleton(trafficRuleSegment)), null);
+        try {
+            handler.execute();
+        } catch (IllegalStateException ex) {

Review Comment:
   Please add final for exception catch



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to