Skip to content

Commit

Permalink
[Test] Address ACL.GETUSER change(s) (#3149)
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 authored Sep 25, 2022
1 parent 0817f0e commit 899eb05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package redis.clients.jedis.commands.jedis;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.junit.Assert.*;

import java.util.List;
Expand Down Expand Up @@ -72,11 +73,10 @@ public void aclUsers() {

@Test
public void aclGetUser() {

// get default user information
AccessControlUser userInfo = jedis.aclGetUser("default");

assertEquals(1, userInfo.getFlags().size());
assertThat(userInfo.getFlags().size(), greaterThanOrEqualTo(1));
assertEquals(1, userInfo.getPassword().size());
assertEquals("+@all", userInfo.getCommands());
assertEquals("~*", userInfo.getKeys().get(0));
Expand All @@ -85,7 +85,7 @@ public void aclGetUser() {
jedis.aclDelUser(USER_NAME);
jedis.aclSetUser(USER_NAME);
userInfo = jedis.aclGetUser(USER_NAME);
assertEquals(1, userInfo.getFlags().size());
assertThat(userInfo.getFlags().size(), greaterThanOrEqualTo(1));
assertEquals("off", userInfo.getFlags().get(0));
assertTrue(userInfo.getPassword().isEmpty());
assertTrue(userInfo.getKeys().isEmpty());
Expand All @@ -99,7 +99,6 @@ public void aclGetUser() {
assertThat(userInfo.getCommands(), containsString("+debug|digest"));

jedis.aclDelUser(USER_NAME);

}

@Test
Expand Down Expand Up @@ -156,7 +155,6 @@ public void createUserAndPasswords() {
}

jedis2.close();

}

@Test
Expand Down

0 comments on commit 899eb05

Please sign in to comment.