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 13, 2024
1 parent fafbf82 commit 3a145be
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public interface TransactionsBaseClusterCommands {
* @return The string <code>OK</code>.
* @example
* <pre>{@code
* client.watch(new String[] {"sampleKey"});
* client.unwatch(ALL_PRIMARIES); // Flushes "sampleKey" from watched keys for all primary nodes.
* assert client.watch(new String[] {"sampleKey"}).get() == "OK";
* assert client.unwatch(ALL_PRIMARIES).get() == "OK"; // Flushes "sampleKey" from watched keys for all primary nodes.
* }</pre>
*/
CompletableFuture<String> unwatch(Route route);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ public interface TransactionsBaseCommands {
* @return The string <code>OK</code>.
* @example
* <pre>{@code
* client.watch(new String[] {"sampleKey"});
* assert client.watch(new String[] {"sampleKey"}).get() == "OK";
* transaction.set("sampleKey", "foobar");
* client.exec(transaction).get(); // Executes successfully and keys are unwatched.
* Object[] result = client.exec(transaction).get();
* assert result != null; // Executes successfully and keys are unwatched.
* }</pre>
*/
CompletableFuture<String> watch(String[] keys);
Expand All @@ -35,8 +36,8 @@ public interface TransactionsBaseCommands {
* @return The string <code>OK</code>.
* @example
* <pre>{@code
* client.watch(new String[] {"sampleKey"});
* client.unwatch(); // Flushes "sampleKey" from watched keys.
* assert client.watch(new String[] {"sampleKey"}).get() == "OK";
* assert client.unwatch().get() == "OK"; // Flushes "sampleKey" from watched keys.
* }</pre>
*/
CompletableFuture<String> unwatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
Expand Down Expand Up @@ -68,17 +67,6 @@ public void custom_command_info() {
assertTrue(((String) result[0]).contains("# Stats"));
}

@Test
@SneakyThrows
public void WATCH_transaction_failure_returns_null() {
ClusterTransaction transaction = new ClusterTransaction();
transaction.get("key");
assertEquals(
OK, clusterClient.customCommand(new String[] {"WATCH", "key"}).get().getSingleValue());
assertEquals(OK, clusterClient.set("key", "foo").get());
assertNull(clusterClient.exec(transaction).get());
}

@Test
@SneakyThrows
public void info_simple_route_test() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
Expand Down Expand Up @@ -222,16 +221,6 @@ public void zrank_zrevrank_withscores() {
assertArrayEquals(new Object[] {2L, 1.0}, (Object[]) result[2]);
}

@Test
@SneakyThrows
public void WATCH_transaction_failure_returns_null() {
Transaction transaction = new Transaction();
transaction.get("key");
assertEquals(OK, client.customCommand(new String[] {"WATCH", "key"}).get());
assertEquals(OK, client.set("key", "foo").get());
assertNull(client.exec(transaction).get());
}

@Test
@SneakyThrows
public void copy() {
Expand Down

0 comments on commit 3a145be

Please sign in to comment.