nonbinaryprogrammer commented on a change in pull request #7134:
URL: https://github.com/apache/geode/pull/7134#discussion_r753604225



##########
File path: 
geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/server/CommandIntegrationTest.java
##########
@@ -81,6 +87,32 @@ public void commandReturnsResultsMatchingNativeRedis() {
     softly.assertAll();
   }
 
+  @Test
+  public void commandWithInvalidSubcommand_returnError() {
+    String invalidSubcommand = "fakeSubcommand";
+    RedisCodec<String, String> codec = StringCodec.UTF8;
+
+    CommandArgs<String, String> args =
+        new 
CommandArgs<>(codec).add(CommandType.COMMAND).add(invalidSubcommand);
+    assertThatThrownBy(
+        () -> radishClient.dispatch(CommandType.COMMAND, new 
NestedMultiOutput<>(codec), args))
+            .hasMessageContaining(
+                "ERR Unknown subcommand or wrong number of arguments for 
'COMMAND'");

Review comment:
       it would be good to use `ERROR_UNKNOWN_COMMAND_COMMAND_SUBCOMMAND` from 
`RedisConstants` so that if we change the error message it'll still work. I 
don't think we're really testing that the constant is right, just that the 
constant we expect gets returned.




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