Skip to content

Commit

Permalink
Add WATCH returns null standalone IT test
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
  • Loading branch information
acarbonetto committed Apr 29, 2024
1 parent 057a432 commit 7a4c856
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

Expand Down Expand Up @@ -185,4 +186,14 @@ public void zrank_zrevrank_withscores() {
assertArrayEquals(new Object[] {0L, 1.0}, (Object[]) result[1]);
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());
}
}

0 comments on commit 7a4c856

Please sign in to comment.