kirklund commented on a change in pull request #6933:
URL: https://github.com/apache/geode/pull/6933#discussion_r721744036



##########
File path: 
geode-apis-compatible-with-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/CommandIntegrationTest.java
##########
@@ -73,6 +76,25 @@ public void commandReturnsResultsMatchingNativeRedis() {
     softly.assertAll();
   }
 
+  @Test
+  public void 
commandDoesNotReturnUnsupported_whenUnsupportedCommandsAreDisabled() {
+    radishServer.setEnableUnsupportedCommands(false);
+    try {
+      Map<String, CommandStructure> results = 
processRawCommands(radishClient.command());
+
+      // Find an unsupported command
+      RedisCommandType someUnsupported = 
Arrays.stream(RedisCommandType.values())
+          .filter(RedisCommandType::isUnsupported).findFirst()
+          .orElseThrow(() -> new AssertionFailedError("Could not find any 
UNSUPPORTED commands"));
+
+      for (CommandStructure meta : results.values()) {
+        assertThat(meta.name).isNotEqualToIgnoringCase(someUnsupported.name());
+      }
+    } finally {
+      radishServer.setEnableUnsupportedCommands(true);
+    }

Review comment:
       It's generally best and cleaner if you can avoid using finally-blocks 
for tear down. You should consider hoisting the finally-block to a dedicated 
tear down method instead:
   ```
   @After
   public void tearDown() {
     radishServer.setEnableUnsupportedCommands(true);
   }
   ```
   You can always add a conditional to the tear down if needed.

##########
File path: 
geode-apis-compatible-with-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/CommandIntegrationTest.java
##########
@@ -19,20 +19,23 @@
 import static org.assertj.core.api.Assertions.assertThat;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import io.lettuce.core.RedisClient;
 import io.lettuce.core.api.sync.RedisCommands;
+import junit.framework.AssertionFailedError;

Review comment:
       You should use `java.lang.AssertionError` instead. `junit.framework` is 
JUnit 1-1.3, while `org.junit` is JUnit 1.4. Anything in `junit.framework` 
should be considered deprecated.




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