forked from trpc-group/trpc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigAdminTest.java
More file actions
45 lines (40 loc) · 1.75 KB
/
Copy pathConfigAdminTest.java
File metadata and controls
45 lines (40 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Tencent is pleased to support the open source community by making tRPC available.
*
* Copyright (C) 2023 Tencent.
* All rights reserved.
*
* If you have downloaded a copy of the tRPC source code from Tencent,
* please note that tRPC source code is licensed under the Apache 2.0 License,
* A copy of the Apache 2.0 License can be found in the LICENSE file.
*/
package com.tencent.trpc.admin;
import com.tencent.trpc.admin.dto.CommonDto;
import com.tencent.trpc.admin.dto.ConfigOverviewDto;
import com.tencent.trpc.admin.impl.ConfigAdmin;
import com.tencent.trpc.core.common.ConfigManager;
import com.tencent.trpc.core.common.config.GlobalConfig;
import com.tencent.trpc.core.common.config.ProtocolConfig;
import com.tencent.trpc.core.common.config.ServerConfig;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import org.junit.Assert;
import org.junit.Test;
public class ConfigAdminTest {
@Test
public void test() {
ConfigManager applicationConfig = ConfigManager.getInstance();
applicationConfig.setServerConfig(new ServerConfig());
applicationConfig.setGlobalConfig(new GlobalConfig());
Map<String, ProtocolConfig> protocolConfigMap = new HashMap<>();
protocolConfigMap.put("META-INF/trpc", new ProtocolConfig());
// applicationConfig.setProtocolConfigMap(protocolConfigMap);
ConfigAdmin configAdmin = new ConfigAdmin();
ConfigOverviewDto configOverviewDto = configAdmin.getServerConfigInfo();
configOverviewDto.toString();
configOverviewDto.setContent(configOverviewDto.getContent());
Assert.assertTrue(CommonDto.SUCCESS.equals(configOverviewDto.getErrorcode()));
Assert.assertTrue(Objects.nonNull(configOverviewDto.getContent()));
}
}