DonalEvans commented on a change in pull request #7319:
URL: https://github.com/apache/geode/pull/7319#discussion_r794121541



##########
File path: 
geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/commands/executor/set/AbstractSPopIntegrationTest.java
##########
@@ -52,213 +56,137 @@ public void tearDown() {
   }
 
   @Test
-  public void givenKeyNotProvided_returnsWrongNumberOfArgumentsError() {
-    assertThatThrownBy(() -> jedis.sendCommand("key", Protocol.Command.SPOP))
-        .hasMessageContaining("ERR wrong number of arguments for 'spop' 
command");
+  public void spopTooFewArgs_returnsError() {
+    assertAtLeastNArgs(jedis, Protocol.Command.SPOP, 1);
   }
 
   @Test
-  public void givenMoreThanThreeArguments_returnsSyntaxError() {
+  public void spopTooManyArgs_returnsError() {
     assertThatThrownBy(
-        () -> jedis.sendCommand("key", Protocol.Command.SPOP, "key", "NaN", 
"extraArg"))
+        () -> jedis.sendCommand(SET_KEY, Protocol.Command.SPOP, SET_KEY, "5", 
"5"))
             .hasMessageContaining(ERROR_SYNTAX);

Review comment:
       Aah, I see what the problem is. When SPOP has too few arguments it uses 
the "ERR wrong number of arguments for 'spop' command" error message, but when 
it has too many arguments, it uses the "ERR syntax error" error message. The 
`assertAtMostNArgs()` method only expects to see the first error message, which 
is why it was failing.
   
   I withdraw this comment, the test was right to begin with.




-- 
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: notifications-unsubscr...@geode.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to