Skip to content

Commit

Permalink
Addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GumpacG committed Jun 6, 2024
1 parent ddea285 commit ca410ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.concurrent.CompletableFuture;

/**
* Supports commands for the "Transactions Commands" group for a standalone and cluster clients.
* Supports commands for the "Transactions Commands" group for standalone and cluster clients.
*
* @see <a href="https://redis.io/commands/?group=transactions">Transactions Commands</a>
*/
Expand All @@ -20,7 +20,7 @@ public interface TransactionsBaseCommands {
* @return The string <code>OK</code>.
* @example
* <pre>{@code
* client.watch("sampleKey");
* client.watch(new String[] {"sampleKey"});
* transaction.set("sampleKey", "foobar");
* client.exec(transaction).get(); // Executes successfully and keys are unwatched.
* }</pre>
Expand All @@ -35,7 +35,7 @@ public interface TransactionsBaseCommands {
* @return The string <code>OK</code>.
* @example
* <pre>{@code
* client.watch("sampleKey");
* client.watch(new String[] {"sampleKey"});
* client.unwatch(); // Flushes "sampleKey" from watched keys.
* }</pre>
*/
Expand Down
9 changes: 1 addition & 8 deletions java/integTest/src/test/java/glide/SharedCommandTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -4986,7 +4986,7 @@ public void watch(BaseClient client) {
assertEquals(foobarString, standaloneClient.get(key2).get());
assertEquals(foobarString, standaloneClient.get(key3).get());

// Transaction executes command successfully with an unmodified watched key
// Transaction executes command successfully with unmodified watched keys
assertEquals(OK, standaloneClient.watch(keys).get());
assertArrayEquals(expectedExecResponse, standaloneClient.exec(setFoobarTransaction).get());
assertEquals(foobarString, standaloneClient.get(key1).get());
Expand All @@ -5002,13 +5002,6 @@ public void watch(BaseClient client) {
assertEquals(helloString, standaloneClient.get(key2).get());
assertEquals(helloString, standaloneClient.get(key3).get());

// Transaction executes command successfully with an unmodified watched key
assertEquals(OK, standaloneClient.watch(keys).get());
assertArrayEquals(expectedExecResponse, standaloneClient.exec(setFoobarTransaction).get());
assertEquals(foobarString, standaloneClient.get(key1).get());
assertEquals(foobarString, standaloneClient.get(key2).get());
assertEquals(foobarString, standaloneClient.get(key3).get());

// WATCH can not have an empty String array parameter
ExecutionException executionException =
assertThrows(ExecutionException.class, () -> standaloneClient.watch(new String[] {}).get());
Expand Down

0 comments on commit ca410ea

Please sign in to comment.