diff --git a/src/test/java/redis/clients/jedis/tests/commands/TransactionCommandsTest.java b/src/test/java/redis/clients/jedis/tests/commands/TransactionCommandsTest.java index b6ce9592ba..f65351255c 100644 --- a/src/test/java/redis/clients/jedis/tests/commands/TransactionCommandsTest.java +++ b/src/test/java/redis/clients/jedis/tests/commands/TransactionCommandsTest.java @@ -350,7 +350,6 @@ public void testCloseable() throws IOException { } } - @Test public void testTransactionWithGeneralCommand(){ Transaction t = jedis.multi(); @@ -369,17 +368,14 @@ public void testTransactionWithGeneralCommand(){ Response x = t.sendCommand(GET, "x"); t.exec(); - assertEquals("foo", string.get()); assertEquals("foo", list.get()); assertEquals("bar", hash.get()); assertEquals("foo", zset.get().iterator().next()); assertEquals("foo", set.get()); assertEquals("2", SafeEncoder.encode((byte[]) x.get())); - } - @Test public void transactionResponseWithErrorWithGeneralCommand() { Transaction t = jedis.multi(); @@ -401,4 +397,20 @@ public void transactionResponseWithErrorWithGeneralCommand() { assertEquals("1", SafeEncoder.encode((byte[]) x.get())); } + @Test + public void unwatchWithinMulti() { + final String key = "foo"; + final String val = "bar"; + jedis.set(key, val); + jedis.watch(key); + + List exp = new ArrayList(); + Transaction t = jedis.multi(); + t.get(key); exp.add(val); + t.unwatch(); exp.add("OK"); + t.get(key); exp.add(val); + List res = t.exec(); + assertEquals(exp, res); + } + } \ No newline at end of file