From 12939debe50ddf89a68827ed0e5fb74ab19786a7 Mon Sep 17 00:00:00 2001 From: Yuhao Bi Date: Sat, 19 Jan 2019 01:35:25 +0800 Subject: [PATCH] Bring back redis auth UT --- .../dubbo/rpc/protocol/redis/RedisProtocolTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dubbo-rpc/dubbo-rpc-redis/src/test/java/org/apache/dubbo/rpc/protocol/redis/RedisProtocolTest.java b/dubbo-rpc/dubbo-rpc-redis/src/test/java/org/apache/dubbo/rpc/protocol/redis/RedisProtocolTest.java index 720f4f657b3..fd87e400a32 100644 --- a/dubbo-rpc/dubbo-rpc-redis/src/test/java/org/apache/dubbo/rpc/protocol/redis/RedisProtocolTest.java +++ b/dubbo-rpc/dubbo-rpc-redis/src/test/java/org/apache/dubbo/rpc/protocol/redis/RedisProtocolTest.java @@ -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"); @@ -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 @@ -197,8 +198,8 @@ public void testAuthRedis() { refer.destroy(); } - @Disabled - //@Test + + @Test public void testWrongAuthRedis() { String password = "1234567"; this.registryUrl = this.registryUrl.setPassword(password);