Skip to content

Commit 95efbff

Browse files
gerzsesazzad16
andauthored
More concise unit test code
Co-authored-by: M Sazzadul Hoque <[email protected]>
1 parent 2285071 commit 95efbff

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/test/java/redis/clients/jedis/commands/jedis/ClientCommandsTest.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,14 @@ public void killAddrIpPort() {
222222

223223
@Test
224224
public void killUser() {
225+
client.aclSetUser("test_kill", "on", "+acl", ">password1");
225226
try (Jedis client2 = new Jedis(hnp.getHost(), hnp.getPort(), 500)) {
226-
client.aclSetUser("test_kill", "on", "+acl", ">password1");
227-
try {
228-
client2.auth("test_kill", "password1");
229-
assertEquals(1, jedis.clientKill(new ClientKillParams().user("test_kill")));
230-
assertDisconnected(client2);
231-
} finally {
232-
jedis.aclDelUser("test_kill");
233-
}
227+
client2.auth("test_kill", "password1");
228+
229+
assertEquals(1, jedis.clientKill(new ClientKillParams().user("test_kill")));
230+
assertDisconnected(client2);
231+
} finally {
232+
jedis.aclDelUser("test_kill");
234233
}
235234
}
236235

0 commit comments

Comments
 (0)