Pace2Car commented on code in PR #24016:
URL: https://github.com/apache/shardingsphere/pull/24016#discussion_r1096974232


##########
proxy/backend/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetDistVariableExecutorTest.java:
##########
@@ -92,4 +89,38 @@ public void assertExecuteWithConfigurationKey() throws 
SQLException {
         assertThat(actualValue.toString(), is("1024"));
         
assertThat(contextManager.getMetaDataContexts().getMetaData().getProps().getValue(ConfigurationPropertyKey.PROXY_FRONTEND_FLUSH_THRESHOLD),
 is(1024));
     }
+    
+    @Test
+    public void assertExecuteWithSystemLogLevel() throws SQLException {
+        ContextManager contextManager = mockContextManager();
+        SetDistVariableStatement statement = new 
SetDistVariableStatement("system_log_level", "debug");
+        SetDistVariableHandler handler = new SetDistVariableHandler();
+        handler.init(statement, connectionSession);
+        handler.execute();
+        Object actualValue = 
contextManager.getMetaDataContexts().getMetaData().getProps().getProps().get("system-log-level");
+        assertThat(actualValue.toString(), is("DEBUG"));
+        
assertThat(contextManager.getMetaDataContexts().getMetaData().getProps().getValue(ConfigurationPropertyKey.SYSTEM_LOG_LEVEL),
 is(LoggerLevel.DEBUG));
+    }
+    
+    @Test(expected = InvalidValueException.class)
+    public void assertExecuteWithWrongSystemLogLevel() throws SQLException {
+        ContextManager contextManager = mockContextManager();
+        SetDistVariableStatement statement = new 
SetDistVariableStatement("system_log_level", "debag");
+        SetDistVariableHandler handler = new SetDistVariableHandler();
+        handler.init(statement, connectionSession);
+        handler.execute();
+        Object actualValue = 
contextManager.getMetaDataContexts().getMetaData().getProps().getProps().get("system-log-level");
+        assertThat(actualValue.toString(), is("DEBUG"));

Review Comment:
   Thanks for pointing it out, I've removed the redundant code



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