mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
format code with maven plugins
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,17 +16,18 @@
|
||||
|
||||
package com.alibaba.cloud.nacos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClient;
|
||||
import com.alibaba.nacos.api.naming.NamingService;
|
||||
import com.alibaba.nacos.api.naming.pojo.Instance;
|
||||
import com.alibaba.nacos.api.naming.pojo.ListView;
|
||||
import org.junit.Test;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import org.springframework.cloud.client.ServiceInstance;
|
||||
|
||||
import static com.alibaba.cloud.nacos.test.NacosMockTest.serviceInstance;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -40,7 +41,9 @@ import static org.mockito.Mockito.when;
|
||||
public class NacosDiscoveryClientTests {
|
||||
|
||||
private String host = "123.123.123.123";
|
||||
|
||||
private int port = 8888;
|
||||
|
||||
private String serviceName = "test-service";
|
||||
|
||||
@Test
|
||||
@@ -127,4 +130,5 @@ public class NacosDiscoveryClientTests {
|
||||
|
||||
return "http://" + host + ":" + port;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,10 +1,25 @@
|
||||
/*
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.alibaba.cloud.nacos;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
@@ -13,17 +28,18 @@ import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationC
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:lyuzb@lyuzb.com">lyuzb</a>
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = NacosDiscoveryPropertiesServerAddressBothLevelTests.TestConfig.class, properties = {
|
||||
"spring.cloud.nacos.discovery.server-addr=321.321.321.321:8848",
|
||||
"spring.cloud.nacos.server-addr=123.123.123.123:8848" }, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(
|
||||
classes = NacosDiscoveryPropertiesServerAddressBothLevelTests.TestConfig.class,
|
||||
properties = { "spring.cloud.nacos.discovery.server-addr=321.321.321.321:8848",
|
||||
"spring.cloud.nacos.server-addr=123.123.123.123:8848" },
|
||||
webEnvironment = RANDOM_PORT)
|
||||
public class NacosDiscoveryPropertiesServerAddressBothLevelTests {
|
||||
|
||||
@Autowired
|
||||
@@ -31,8 +47,7 @@ public class NacosDiscoveryPropertiesServerAddressBothLevelTests {
|
||||
|
||||
@Test
|
||||
public void testGetServerAddr() {
|
||||
assertEquals("NacosDiscoveryProperties server address was wrong",
|
||||
"321.321.321.321:8848", properties.getServerAddr());
|
||||
assertThat(properties.getServerAddr()).isEqualTo("321.321.321.321:8848");
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@@ -41,5 +56,7 @@ public class NacosDiscoveryPropertiesServerAddressBothLevelTests {
|
||||
NacosDiscoveryClientAutoConfiguration.class,
|
||||
NacosDiscoveryAutoConfiguration.class })
|
||||
public static class TestConfig {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,10 +1,25 @@
|
||||
/*
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.alibaba.cloud.nacos;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
@@ -13,18 +28,18 @@ import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationC
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:lyuzb@lyuzb.com">lyuzb</a>
|
||||
*
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = NacosDiscoveryPropertiesServerAddressTopLevelTests.TestConfig.class, properties = {
|
||||
"spring.cloud.nacos.server-addr=123.123.123.123:8848" }, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(
|
||||
classes = NacosDiscoveryPropertiesServerAddressTopLevelTests.TestConfig.class,
|
||||
properties = { "spring.cloud.nacos.server-addr=123.123.123.123:8848" },
|
||||
webEnvironment = RANDOM_PORT)
|
||||
|
||||
public class NacosDiscoveryPropertiesServerAddressTopLevelTests {
|
||||
|
||||
@@ -33,8 +48,7 @@ public class NacosDiscoveryPropertiesServerAddressTopLevelTests {
|
||||
|
||||
@Test
|
||||
public void testGetServerAddr() {
|
||||
assertEquals("NacosDiscoveryProperties server address was wrong",
|
||||
"123.123.123.123:8848", properties.getServerAddr());
|
||||
assertThat(properties.getServerAddr()).isEqualTo("123.123.123.123:8848");
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@@ -43,5 +57,7 @@ public class NacosDiscoveryPropertiesServerAddressTopLevelTests {
|
||||
NacosDiscoveryClientAutoConfiguration.class,
|
||||
NacosDiscoveryAutoConfiguration.class })
|
||||
public static class TestConfig {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,17 +16,17 @@
|
||||
|
||||
package com.alibaba.cloud.nacos.registry;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetAddress;
|
||||
import java.net.NetworkInterface;
|
||||
import java.util.Enumeration;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
@@ -36,18 +36,19 @@ import org.springframework.cloud.commons.util.InetUtils;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
*/
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = NacosAutoServiceRegistrationIpNetworkInterfaceTests.TestConfig.class, properties = {
|
||||
"spring.application.name=myTestService1",
|
||||
"spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848" }, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(
|
||||
classes = NacosAutoServiceRegistrationIpNetworkInterfaceTests.TestConfig.class,
|
||||
properties = { "spring.application.name=myTestService1",
|
||||
"spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848" },
|
||||
webEnvironment = RANDOM_PORT)
|
||||
public class NacosAutoServiceRegistrationIpNetworkInterfaceTests {
|
||||
|
||||
@Autowired
|
||||
@@ -64,21 +65,16 @@ public class NacosAutoServiceRegistrationIpNetworkInterfaceTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() throws Exception {
|
||||
|
||||
assertNotNull("NacosRegistration was not created", registration);
|
||||
assertNotNull("NacosDiscoveryProperties was not created", properties);
|
||||
assertNotNull("NacosAutoServiceRegistration was not created",
|
||||
nacosAutoServiceRegistration);
|
||||
assertThat(registration).isNotNull();
|
||||
assertThat(properties).isNotNull();
|
||||
assertThat(nacosAutoServiceRegistration).isNotNull();
|
||||
|
||||
checkoutNacosDiscoveryServiceIP();
|
||||
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryServiceIP() {
|
||||
assertEquals("NacosDiscoveryProperties service IP was wrong",
|
||||
getIPFromNetworkInterface(TestConfig.netWorkInterfaceName),
|
||||
registration.getHost());
|
||||
|
||||
assertThat(registration.getHost())
|
||||
.isEqualTo(getIPFromNetworkInterface(TestConfig.netWorkInterfaceName));
|
||||
}
|
||||
|
||||
private String getIPFromNetworkInterface(String networkInterface) {
|
||||
@@ -143,6 +139,7 @@ public class NacosAutoServiceRegistrationIpNetworkInterfaceTests {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
package com.alibaba.cloud.nacos.registry;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
@@ -30,19 +30,19 @@ import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationC
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
*/
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = NacosAutoServiceRegistrationIpTests.TestConfig.class, properties = {
|
||||
"spring.application.name=myTestService1",
|
||||
"spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848",
|
||||
"spring.cloud.nacos.discovery.ip=123.123.123.123" }, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(classes = NacosAutoServiceRegistrationIpTests.TestConfig.class,
|
||||
properties = { "spring.application.name=myTestService1",
|
||||
"spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848",
|
||||
"spring.cloud.nacos.discovery.ip=123.123.123.123" },
|
||||
webEnvironment = RANDOM_PORT)
|
||||
public class NacosAutoServiceRegistrationIpTests {
|
||||
|
||||
@Autowired
|
||||
@@ -56,20 +56,15 @@ public class NacosAutoServiceRegistrationIpTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() throws Exception {
|
||||
|
||||
assertNotNull("NacosRegistration was not created", registration);
|
||||
assertNotNull("NacosDiscoveryProperties was not created", properties);
|
||||
assertNotNull("NacosAutoServiceRegistration was not created",
|
||||
nacosAutoServiceRegistration);
|
||||
assertThat(registration).isNotNull();
|
||||
assertThat(properties).isNotNull();
|
||||
assertThat(nacosAutoServiceRegistration).isNotNull();
|
||||
|
||||
checkoutNacosDiscoveryServiceIP();
|
||||
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryServiceIP() {
|
||||
assertEquals("NacosDiscoveryProperties service IP was wrong", "123.123.123.123",
|
||||
registration.getHost());
|
||||
|
||||
assertThat(registration.getHost()).isEqualTo("123.123.123.123");
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@@ -78,5 +73,7 @@ public class NacosAutoServiceRegistrationIpTests {
|
||||
NacosDiscoveryClientAutoConfiguration.class,
|
||||
NacosDiscoveryAutoConfiguration.class })
|
||||
public static class TestConfig {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
package com.alibaba.cloud.nacos.registry;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
@@ -30,20 +30,22 @@ import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationC
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
*/
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = NacosAutoServiceRegistrationManagementPortTests.TestConfig.class, properties = {
|
||||
"spring.application.name=myTestService1", "management.server.port=8888",
|
||||
"management.server.servlet.context-path=/test-context-path",
|
||||
"spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848",
|
||||
"spring.cloud.nacos.discovery.port=8888" }, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(
|
||||
classes = NacosAutoServiceRegistrationManagementPortTests.TestConfig.class,
|
||||
properties = { "spring.application.name=myTestService1",
|
||||
"management.server.port=8888",
|
||||
"management.server.servlet.context-path=/test-context-path",
|
||||
"spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848",
|
||||
"spring.cloud.nacos.discovery.port=8888" },
|
||||
webEnvironment = RANDOM_PORT)
|
||||
public class NacosAutoServiceRegistrationManagementPortTests {
|
||||
|
||||
@Autowired
|
||||
@@ -57,24 +59,19 @@ public class NacosAutoServiceRegistrationManagementPortTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() throws Exception {
|
||||
|
||||
assertNotNull("NacosRegistration was not created", registration);
|
||||
assertNotNull("NacosDiscoveryProperties was not created", properties);
|
||||
assertNotNull("NacosAutoServiceRegistration was not created",
|
||||
nacosAutoServiceRegistration);
|
||||
assertThat(registration).isNotNull();
|
||||
assertThat(properties).isNotNull();
|
||||
assertThat(nacosAutoServiceRegistration).isNotNull();
|
||||
|
||||
checkoutNacosDiscoveryManagementData();
|
||||
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryManagementData() {
|
||||
assertEquals("NacosDiscoveryProperties management port was wrong", "8888",
|
||||
properties.getMetadata().get(NacosRegistration.MANAGEMENT_PORT));
|
||||
|
||||
assertEquals("NacosDiscoveryProperties management context path was wrong",
|
||||
"/test-context-path",
|
||||
properties.getMetadata().get(NacosRegistration.MANAGEMENT_CONTEXT_PATH));
|
||||
|
||||
assertThat(properties.getMetadata().get(NacosRegistration.MANAGEMENT_PORT))
|
||||
.isEqualTo("8888");
|
||||
assertThat(
|
||||
properties.getMetadata().get(NacosRegistration.MANAGEMENT_CONTEXT_PATH))
|
||||
.isEqualTo("/test-context-path");
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@@ -83,5 +80,7 @@ public class NacosAutoServiceRegistrationManagementPortTests {
|
||||
NacosDiscoveryClientAutoConfiguration.class,
|
||||
NacosDiscoveryAutoConfiguration.class })
|
||||
public static class TestConfig {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,12 +16,12 @@
|
||||
|
||||
package com.alibaba.cloud.nacos.registry;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
@@ -30,19 +30,19 @@ import org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationC
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
*/
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = NacosAutoServiceRegistrationPortTests.TestConfig.class, properties = {
|
||||
"spring.application.name=myTestService1",
|
||||
"spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848",
|
||||
"spring.cloud.nacos.discovery.port=8888" }, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(classes = NacosAutoServiceRegistrationPortTests.TestConfig.class,
|
||||
properties = { "spring.application.name=myTestService1",
|
||||
"spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848",
|
||||
"spring.cloud.nacos.discovery.port=8888" },
|
||||
webEnvironment = RANDOM_PORT)
|
||||
public class NacosAutoServiceRegistrationPortTests {
|
||||
|
||||
@Autowired
|
||||
@@ -56,20 +56,15 @@ public class NacosAutoServiceRegistrationPortTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() throws Exception {
|
||||
|
||||
assertNotNull("NacosRegistration was not created", registration);
|
||||
assertNotNull("NacosDiscoveryProperties was not created", properties);
|
||||
assertNotNull("NacosAutoServiceRegistration was not created",
|
||||
nacosAutoServiceRegistration);
|
||||
assertThat(registration).isNotNull();
|
||||
assertThat(properties).isNotNull();
|
||||
assertThat(nacosAutoServiceRegistration).isNotNull();
|
||||
|
||||
checkoutNacosDiscoveryServicePort();
|
||||
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryServicePort() {
|
||||
assertEquals("NacosDiscoveryProperties service Port was wrong", 8888,
|
||||
registration.getPort());
|
||||
|
||||
assertThat(registration.getPort()).isEqualTo(8888);
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@@ -78,5 +73,7 @@ public class NacosAutoServiceRegistrationPortTests {
|
||||
NacosDiscoveryClientAutoConfiguration.class,
|
||||
NacosDiscoveryAutoConfiguration.class })
|
||||
public static class TestConfig {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,16 +16,16 @@
|
||||
|
||||
package com.alibaba.cloud.nacos.registry;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.NacosNamingManager;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.endpoint.NacosDiscoveryEndpoint;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
@@ -36,31 +36,30 @@ import org.springframework.cloud.commons.util.InetUtils;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import com.alibaba.cloud.nacos.endpoint.NacosDiscoveryEndpoint;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
*/
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = NacosAutoServiceRegistrationTests.TestConfig.class, properties = {
|
||||
"spring.application.name=myTestService1",
|
||||
"spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848",
|
||||
"spring.cloud.nacos.discovery.endpoint=test-endpoint",
|
||||
"spring.cloud.nacos.discovery.namespace=test-namespace",
|
||||
"spring.cloud.nacos.discovery.log-name=test-logName",
|
||||
"spring.cloud.nacos.discovery.weight=2",
|
||||
"spring.cloud.nacos.discovery.clusterName=test-cluster",
|
||||
"spring.cloud.nacos.discovery.namingLoadCacheAtStart=true",
|
||||
"spring.cloud.nacos.discovery.secure=true",
|
||||
"spring.cloud.nacos.discovery.accessKey=test-accessKey",
|
||||
"spring.cloud.nacos.discovery.secretKey=test-secretKey",
|
||||
"spring.cloud.nacos.discovery.heart-beat-interval=3",
|
||||
"spring.cloud.nacos.discovery.heart-beat-timeout=6",
|
||||
"spring.cloud.nacos.discovery.ip-delete-timeout=9", }, webEnvironment = RANDOM_PORT)
|
||||
@SpringBootTest(classes = NacosAutoServiceRegistrationTests.TestConfig.class,
|
||||
properties = { "spring.application.name=myTestService1",
|
||||
"spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848",
|
||||
"spring.cloud.nacos.discovery.endpoint=test-endpoint",
|
||||
"spring.cloud.nacos.discovery.namespace=test-namespace",
|
||||
"spring.cloud.nacos.discovery.log-name=test-logName",
|
||||
"spring.cloud.nacos.discovery.weight=2",
|
||||
"spring.cloud.nacos.discovery.clusterName=test-cluster",
|
||||
"spring.cloud.nacos.discovery.namingLoadCacheAtStart=true",
|
||||
"spring.cloud.nacos.discovery.secure=true",
|
||||
"spring.cloud.nacos.discovery.accessKey=test-accessKey",
|
||||
"spring.cloud.nacos.discovery.secretKey=test-secretKey",
|
||||
"spring.cloud.nacos.discovery.heart-beat-interval=3",
|
||||
"spring.cloud.nacos.discovery.heart-beat-timeout=6",
|
||||
"spring.cloud.nacos.discovery.ip-delete-timeout=9" },
|
||||
webEnvironment = RANDOM_PORT)
|
||||
public class NacosAutoServiceRegistrationTests {
|
||||
|
||||
@Autowired
|
||||
@@ -83,11 +82,9 @@ public class NacosAutoServiceRegistrationTests {
|
||||
|
||||
@Test
|
||||
public void contextLoads() throws Exception {
|
||||
|
||||
assertNotNull("NacosRegistration was not created", registration);
|
||||
assertNotNull("NacosDiscoveryProperties was not created", properties);
|
||||
assertNotNull("NacosAutoServiceRegistration was not created",
|
||||
nacosAutoServiceRegistration);
|
||||
assertThat(registration).isNotNull();
|
||||
assertThat(properties).isNotNull();
|
||||
assertThat(nacosAutoServiceRegistration).isNotNull();
|
||||
|
||||
checkoutNacosDiscoveryServerAddr();
|
||||
checkoutNacosDiscoveryEndpoint();
|
||||
@@ -114,105 +111,84 @@ public class NacosAutoServiceRegistrationTests {
|
||||
}
|
||||
|
||||
private void checkAutoRegister() {
|
||||
assertTrue("Nacos Auto Registration was not start",
|
||||
nacosAutoServiceRegistration.isRunning());
|
||||
assertThat(nacosAutoServiceRegistration.isRunning()).isEqualTo(Boolean.TRUE);
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryServerAddr() {
|
||||
assertEquals("NacosDiscoveryProperties server address was wrong",
|
||||
"127.0.0.1:8848", properties.getServerAddr());
|
||||
|
||||
assertThat(properties.getServerAddr()).isEqualTo("127.0.0.1:8848");
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryEndpoint() {
|
||||
assertEquals("NacosDiscoveryProperties endpoint was wrong", "test-endpoint",
|
||||
properties.getEndpoint());
|
||||
|
||||
assertThat(properties.getEndpoint()).isEqualTo("test-endpoint");
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryNamespace() {
|
||||
assertEquals("NacosDiscoveryProperties namespace was wrong", "test-namespace",
|
||||
properties.getNamespace());
|
||||
|
||||
assertThat(properties.getNamespace()).isEqualTo("test-namespace");
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryLogName() {
|
||||
assertEquals("NacosDiscoveryProperties logName was wrong", "test-logName",
|
||||
properties.getLogName());
|
||||
assertThat(properties.getLogName()).isEqualTo("test-logName");
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryWeight() {
|
||||
assertEquals(2, properties.getWeight(), 0.00000001);
|
||||
assertThat(properties.getWeight()).isEqualTo(2);
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryClusterName() {
|
||||
assertEquals("NacosDiscoveryProperties cluster was wrong", "test-cluster",
|
||||
properties.getClusterName());
|
||||
assertThat(properties.getClusterName()).isEqualTo("test-cluster");
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryCache() {
|
||||
assertEquals("NacosDiscoveryProperties naming load cache was wrong", "true",
|
||||
properties.getNamingLoadCacheAtStart());
|
||||
assertThat(properties.getNamingLoadCacheAtStart()).isEqualTo("true");
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoverySecure() {
|
||||
assertEquals("NacosDiscoveryProperties is secure was wrong", true,
|
||||
properties.isSecure());
|
||||
assertEquals("NacosDiscoveryProperties is secure was wrong", "true",
|
||||
properties.getMetadata().get("secure"));
|
||||
assertThat(properties.isSecure()).isEqualTo(true);
|
||||
assertThat(properties.getMetadata().get("secure")).isEqualTo("true");
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryAccessKey() {
|
||||
assertEquals("NacosDiscoveryProperties is access key was wrong", "test-accessKey",
|
||||
properties.getAccessKey());
|
||||
assertThat(properties.getAccessKey()).isEqualTo("test-accessKey");
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoverySecrectKey() {
|
||||
assertEquals("NacosDiscoveryProperties is secret key was wrong", "test-secretKey",
|
||||
properties.getSecretKey());
|
||||
assertThat(properties.getSecretKey()).isEqualTo("test-secretKey");
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryHeartBeatInterval() {
|
||||
assertEquals("NacosDiscoveryProperties heart beat interval was wrong",
|
||||
Integer.valueOf(3), properties.getHeartBeatInterval());
|
||||
assertThat(properties.getHeartBeatInterval()).isEqualTo(Integer.valueOf(3));
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryHeartBeatTimeout() {
|
||||
assertEquals("NacosDiscoveryProperties heart beat timeout was wrong",
|
||||
Integer.valueOf(6), properties.getHeartBeatTimeout());
|
||||
assertThat(properties.getHeartBeatTimeout()).isEqualTo(Integer.valueOf(6));
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryIpDeleteTimeout() {
|
||||
assertEquals("NacosDiscoveryProperties ip delete timeout was wrong",
|
||||
Integer.valueOf(9), properties.getIpDeleteTimeout());
|
||||
assertThat(properties.getIpDeleteTimeout()).isEqualTo(Integer.valueOf(9));
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryServiceName() {
|
||||
assertEquals("NacosDiscoveryProperties service name was wrong", "myTestService1",
|
||||
properties.getService());
|
||||
|
||||
assertThat(properties.getService()).isEqualTo("myTestService1");
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryServiceIP() {
|
||||
assertEquals("NacosDiscoveryProperties service IP was wrong",
|
||||
inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(),
|
||||
registration.getHost());
|
||||
|
||||
assertThat(registration.getHost())
|
||||
.isEqualTo(inetUtils.findFirstNonLoopbackHostInfo().getIpAddress());
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryServicePort() {
|
||||
assertEquals("NacosDiscoveryProperties service Port was wrong", port,
|
||||
registration.getPort());
|
||||
|
||||
assertThat(registration.getPort()).isEqualTo(port);
|
||||
}
|
||||
|
||||
private void checkoutEndpoint() throws Exception {
|
||||
NacosDiscoveryEndpoint nacosDiscoveryEndpoint = new NacosDiscoveryEndpoint(
|
||||
nacosNamingManager, properties);
|
||||
Map<String, Object> map = nacosDiscoveryEndpoint.nacosDiscovery();
|
||||
assertEquals(map.get("NacosDiscoveryProperties"), properties);
|
||||
assertEquals(map.get("subscribe").toString(),
|
||||
nacosNamingManager.getNamingService().getSubscribeServices().toString());
|
||||
|
||||
assertThat(properties).isEqualTo(map.get("NacosDiscoveryProperties"));
|
||||
assertThat(
|
||||
nacosNamingManager.getNamingService().getSubscribeServices().toString())
|
||||
.isEqualTo(map.get("subscribe").toString());
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@@ -221,5 +197,7 @@ public class NacosAutoServiceRegistrationTests {
|
||||
NacosDiscoveryClientAutoConfiguration.class,
|
||||
NacosDiscoveryAutoConfiguration.class })
|
||||
public static class TestConfig {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,8 +1,26 @@
|
||||
/*
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.alibaba.cloud.nacos.ribbon;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
import com.netflix.client.config.DefaultClientConfigImpl;
|
||||
import com.netflix.client.config.IClientConfig;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
||||
@@ -12,10 +30,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import com.alibaba.cloud.nacos.discovery.NacosDiscoveryClientAutoConfiguration;
|
||||
|
||||
import com.netflix.client.config.DefaultClientConfigImpl;
|
||||
import com.netflix.client.config.IClientConfig;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -16,27 +16,25 @@
|
||||
|
||||
package com.alibaba.cloud.nacos.ribbon;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosNamingManager;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
import com.alibaba.cloud.nacos.NacosNamingManager;
|
||||
import com.alibaba.cloud.nacos.test.NacosMockTest;
|
||||
import com.alibaba.nacos.api.naming.NamingService;
|
||||
import com.alibaba.nacos.api.naming.pojo.Instance;
|
||||
|
||||
import com.netflix.client.config.IClientConfig;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
@@ -172,4 +170,5 @@ public class NacosServerListTests {
|
||||
assertThat(servers.get(0).getInstance().getMetadata().get("instanceNum"))
|
||||
.isEqualTo("1");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -33,4 +33,5 @@ public class CommonTestConfig {
|
||||
RestTemplate loadBalancedRestTemplate() {
|
||||
return new RestTemplate();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018 the original author or authors.
|
||||
* Copyright 2013-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -46,4 +46,5 @@ public class NacosMockTest {
|
||||
instance.setMetadata(metadata);
|
||||
return instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user