sabbey37 commented on a change in pull request #5988:
URL: https://github.com/apache/geode/pull/5988#discussion_r569622226



##########
File path: 
geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHashesIntegrationTest.java
##########
@@ -344,31 +336,40 @@ public void incrByFloatFailsWithNonFloatFieldValue() {
   }
 
   @Test
-  public void testHExists() {
-    String key = Double.valueOf(rand.nextDouble()).toString();
-    String field = Double.valueOf(rand.nextInt(50)).toString() + ".field";
-    String value = Double.valueOf(rand.nextInt(50)).toString() + ".value";
-
-    assertThat(jedis.hexists(key, field)).isFalse();
+  public void testHExists_isFalseForNonexistentKeyOrField() {
+    jedis.hset("key", "field", "value");
 
-    jedis.hset(key, field, value);
-
-    assertThat(jedis.hget(key, field)).isEqualTo(value);
-
-    assertThat(jedis.hexists(key, field)).isTrue();
+    assertThat(jedis.hexists("nonexitentKey", "someField")).isFalse();

Review comment:
       Not super important, but `nonexistent` is spelled incorrectly.

##########
File path: 
geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHashesIntegrationTest.java
##########
@@ -251,12 +248,7 @@ public void testHStrLen_failsForNonHashes() {
 
   @Test
   public void testHStrlen_givenWrongNumberOfArguments() {
-    assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HSTRLEN))
-        .hasMessageContaining("ERR wrong number of arguments for 'hstrlen' 
command");
-    assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HSTRLEN, "1"))
-        .hasMessageContaining("ERR wrong number of arguments for 'hstrlen' 
command");
-    assertThatThrownBy(() -> jedis.sendCommand(Protocol.Command.HSTRLEN, "1", 
"2", "3"))
-        .hasMessageContaining("ERR wrong number of arguments for 'hstrlen' 
command");
+    assertExactNumberOfArgs(Protocol.Command.HSTRLEN, 2);
   }

Review comment:
       This is great!




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to