steve-sienk commented on a change in pull request #7278:
URL: https://github.com/apache/geode/pull/7278#discussion_r794857700



##########
File path: 
geode-for-redis/src/integrationTest/java/org/apache/geode/redis/internal/commands/executor/set/AbstractSScanIntegrationTest.java
##########
@@ -54,295 +74,397 @@ public void tearDown() {
   }
 
   @Test
-  public void givenNoKeyArgument_returnsWrongNumberOfArgumentsError() {
-    assertThatThrownBy(() -> jedis.sendCommand("key", Protocol.Command.SSCAN))
-        .hasMessageContaining("ERR wrong number of arguments for 'sscan' 
command");
+  public void givenLessThanTwoArguments_returnsWrongNumberOfArgumentsError() {
+    assertAtLeastNArgs(jedis, Protocol.Command.SSCAN, 2);
+  }
+
+  @Test
+  public void givenNonexistentKey_returnsEmptyArray() {
+    ScanResult<String> result = jedis.sscan("nonexistent", ZERO_CURSOR);
+
+    assertThat(result.isCompleteIteration()).isTrue();
+    assertThat(result.getResult()).isEmpty();
+  }
+
+  @Test
+  public void 
givenNonexistentKeyAndIncorrectOptionalArguments_returnsEmptyArray() {
+    result = sendCustomSscanCommand("nonexistentKey", "nonexistentKey", 
ZERO_CURSOR, "ANY");
+    assertThat(result.getResult()).isEmpty();
   }
 
   @Test
-  public void givenNoCursorArgument_returnsWrongNumberOfArgumentsError() {
-    assertThatThrownBy(() -> jedis.sendCommand("key", Protocol.Command.SSCAN, 
"key"))
+  public void givenIncorrectOptionalArgumentAndKeyExists_returnsSyntaxError() {
+    assertThatThrownBy(() -> jedis.sendCommand(KEY, Protocol.Command.SSCAN, 
KEY))
         .hasMessageContaining("ERR wrong number of arguments for 'sscan' 
command");
   }

Review comment:
       s




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