Skip to content

Commit

Permalink
Bring back redis auth UT (apache#3278)
Browse files Browse the repository at this point in the history
  • Loading branch information
biyuhao authored and ralf0131 committed Jan 20, 2019
1 parent fda71e7 commit 576a413
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public class RedisProtocolTest {
@BeforeEach
public void setUp(TestInfo testInfo) {
int redisPort = NetUtils.getAvailablePort();
if (testInfo.getTestMethod().equals("testAuthRedis") || testInfo.getTestMethod().equals("testWrongAuthRedis")) {
String methodName = testInfo.getTestMethod().get().getName();
if ("testAuthRedis".equals(methodName) || ("testWrongAuthRedis".equals(methodName))) {
String password = "123456";
this.redisServer = RedisServer.builder().port(redisPort).setting("requirepass " + password).build();
this.registryUrl = URL.valueOf("redis://username:" + password + "@localhost:" + redisPort + "?db.index=0");
Expand Down Expand Up @@ -135,7 +136,7 @@ public void testWrongRedis() {
public void testExport() {
Assertions.assertThrows(UnsupportedOperationException.class, () -> protocol.export(protocol.refer(IDemoService.class, registryUrl)));
}
@Disabled

@Test
public void testAuthRedis() {
// default db.index=0
Expand Down Expand Up @@ -197,8 +198,8 @@ public void testAuthRedis() {

refer.destroy();
}
@Disabled
//@Test

@Test
public void testWrongAuthRedis() {
String password = "1234567";
this.registryUrl = this.registryUrl.setPassword(password);
Expand Down

0 comments on commit 576a413

Please sign in to comment.