[ISSUE #62]Uses the YML format instead of the Properties format. (#63)

* [ISSUE #62]Uses the YML format instead of the Properties format.

* retrigger ci

* Solve the apache-rat check

Co-authored-by: zhangjidi <zhangjidi@cmss.chinamobile.com>
This commit is contained in:
zhangjidi2016
2022-01-08 22:05:21 +08:00
committed by GitHub
parent 529501c007
commit e281b74456
8 changed files with 84 additions and 70 deletions

View File

@@ -17,6 +17,7 @@
package org.apache.rocketmq.dashboard.config;
import com.google.common.collect.Lists;
import java.io.File;
import org.junit.Assert;
import org.junit.Test;
@@ -39,6 +40,7 @@ public class RMQConfigureTest {
rmqConfigure.setLoginRequired(true);
rmqConfigure.setNamesrvAddr("127.0.0.1:9876");
rmqConfigure.setTimeoutMillis(3000L);
rmqConfigure.setNamesrvAddrs(Lists.asList("127.0.0.1:9876", new String[] {"127.0.0.2:9876"}));
}
@Test
@@ -54,6 +56,7 @@ public class RMQConfigureTest {
Assert.assertTrue(rmqConfigure.isEnableDashBoardCollect());
Assert.assertTrue(rmqConfigure.isLoginRequired());
Assert.assertEquals(rmqConfigure.getNamesrvAddr(), "127.0.0.1:9876");
Assert.assertEquals(rmqConfigure.getNamesrvAddrs().size(), 2);
Assert.assertEquals(rmqConfigure.getTimeoutMillis().longValue(), 3000L);
ErrorPageRegistrar registrar = rmqConfigure.errorPageRegistrar();
registrar.registerErrorPages(new ErrorPageRegistry() {

View File

@@ -17,6 +17,7 @@
package org.apache.rocketmq.dashboard.controller;
import com.google.common.collect.Lists;
import org.apache.rocketmq.dashboard.BaseTest;
import org.apache.rocketmq.dashboard.config.RMQConfigure;
import org.apache.rocketmq.dashboard.support.GlobalExceptionHandler;
@@ -62,7 +63,7 @@ public abstract class BaseControllerTest extends BaseTest {
when(configure.getAccessKey()).thenReturn("12345678");
when(configure.getSecretKey()).thenReturn("rocketmq");
when(configure.getNamesrvAddr()).thenReturn("127.0.0.1:9876");
when(configure.getNamesrvAddrs()).thenReturn("127.0.0.1:9876");
when(configure.getNamesrvAddrs()).thenReturn(Lists.asList("127.0.0.1:9876", new String[] {"127.0.0.2:9876"}));
when(configure.isACLEnabled()).thenReturn(true);
when(configure.isUseTLS()).thenReturn(false);
}

View File

@@ -64,7 +64,7 @@ public class OpsControllerTest extends BaseControllerTest {
.andExpect(jsonPath("$.data").isMap())
.andExpect(jsonPath("$.data.useVIPChannel").value(false))
.andExpect(jsonPath("$.data.namesvrAddrList").isArray())
.andExpect(jsonPath("$.data.namesvrAddrList", hasSize(1)))
.andExpect(jsonPath("$.data.namesvrAddrList", hasSize(2)))
.andExpect(jsonPath("$.data.namesvrAddrList[0]").value("127.0.0.1:9876"));
}
@@ -96,7 +96,6 @@ public class OpsControllerTest extends BaseControllerTest {
.andExpect(jsonPath("$.data").value(true));
}
@Test
public void testUpdateUseTLS() throws Exception {
final String url = "/ops/updateUseTLS.do";