interestedKeyPrefixes =
- annotatedInterestedKeyPrefixes.length > 0 ? Sets.newHashSet(annotatedInterestedKeyPrefixes)
- : null;
+ annotatedInterestedKeyPrefixes.length > 0 ? Sets.newHashSet(annotatedInterestedKeyPrefixes) : null;
addChangeListener(configChangeListener, interestedKeys, interestedKeyPrefixes);
}
-
}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/annotation/PolarisConfigKVFileChangeListener.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/annotation/PolarisConfigKVFileChangeListener.java
index 6acbf2336..a324c4d78 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/annotation/PolarisConfigKVFileChangeListener.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/annotation/PolarisConfigKVFileChangeListener.java
@@ -38,7 +38,7 @@ public @interface PolarisConfigKVFileChangeListener {
/**
* The keys interested in the listener, will only be notified if any of the interested keys is changed.
- *
+ *
* If neither of {@code interestedKeys} and {@code interestedKeyPrefixes} is specified then the {@code listener} will be notified when any key is changed.
* @return interested keys in the listener
*/
@@ -49,10 +49,9 @@ public @interface PolarisConfigKVFileChangeListener {
* The prefixes will simply be used to determine whether the {@code listener} should be notified or not using {@code changedKey.startsWith(prefix)}.
* e.g. "spring." means that {@code listener} is interested in keys that starts with "spring.", such as "spring.banner", "spring.jpa", etc.
* and "application" means that {@code listener} is interested in keys that starts with "application", such as "applicationName", "application.port", etc.
- *
+ *
* If neither of {@code interestedKeys} and {@code interestedKeyPrefixes} is specified then the {@code listener} will be notified when whatever key is changed.
* @return interested key-prefixed in the listener
*/
String[] interestedKeyPrefixes() default {};
-
}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/config/ConfigFileGroup.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/config/ConfigFileGroup.java
index 05f1d7c5d..b52ffd13e 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/config/ConfigFileGroup.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/config/ConfigFileGroup.java
@@ -56,5 +56,4 @@ public class ConfigFileGroup {
public String toString() {
return "ConfigFileGroup{" + "name='" + name + '\'' + ", file=" + files + '}';
}
-
}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/config/PolarisConfigProperties.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/config/PolarisConfigProperties.java
index a2c9032fe..f39c5337f 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/config/PolarisConfigProperties.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/config/PolarisConfigProperties.java
@@ -94,5 +94,4 @@ public class PolarisConfigProperties {
public void setGroups(List groups) {
this.groups = groups;
}
-
}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/endpoint/PolarisConfigEndpoint.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/endpoint/PolarisConfigEndpoint.java
new file mode 100644
index 000000000..eb9e94f5b
--- /dev/null
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/endpoint/PolarisConfigEndpoint.java
@@ -0,0 +1,58 @@
+/*
+ * Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
+ *
+ * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
+ *
+ * Licensed under the BSD 3-Clause License (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://opensource.org/licenses/BSD-3-Clause
+ *
+ * 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.tencent.cloud.polaris.config.endpoint;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.tencent.cloud.polaris.config.adapter.PolarisPropertySource;
+import com.tencent.cloud.polaris.config.adapter.PolarisPropertySourceManager;
+import com.tencent.cloud.polaris.config.config.PolarisConfigProperties;
+
+import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
+import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
+
+/**
+ * Endpoint of polaris config.
+ *
+ * @author shuiqingliu
+ **/
+@Endpoint(id = "polaris-config")
+public class PolarisConfigEndpoint {
+
+ private final PolarisConfigProperties polarisConfigProperties;
+ private final PolarisPropertySourceManager polarisPropertySourceManager;
+
+ public PolarisConfigEndpoint(PolarisConfigProperties polarisConfigProperties, PolarisPropertySourceManager polarisPropertySourceManager) {
+ this.polarisConfigProperties = polarisConfigProperties;
+ this.polarisPropertySourceManager = polarisPropertySourceManager;
+ }
+
+ @ReadOperation
+ public Map polarisConfig() {
+ Map configInfo = new HashMap<>();
+ configInfo.put("PolarisConfigProperties", polarisConfigProperties);
+
+ List propertySourceList = polarisPropertySourceManager.getAllPropertySources();
+ configInfo.put("PolarisPropertySource", propertySourceList);
+
+ return configInfo;
+ }
+}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/endpoint/PolarisConfigEndpointAutoConfiguration.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/endpoint/PolarisConfigEndpointAutoConfiguration.java
new file mode 100644
index 000000000..cb26462ee
--- /dev/null
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/endpoint/PolarisConfigEndpointAutoConfiguration.java
@@ -0,0 +1,49 @@
+/*
+ * Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
+ *
+ * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
+ *
+ * Licensed under the BSD 3-Clause License (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://opensource.org/licenses/BSD-3-Clause
+ *
+ * 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.tencent.cloud.polaris.config.endpoint;
+
+import com.tencent.cloud.polaris.config.adapter.PolarisPropertySourceManager;
+import com.tencent.cloud.polaris.config.config.PolarisConfigProperties;
+
+import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
+import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * The AutoConfiguration for Polaris Config's endpoint.
+ *
+ * @author shuiqingliu
+ **/
+@Configuration(proxyBeanMethods = false)
+@ConditionalOnClass(Endpoint.class)
+@ConditionalOnProperty(value = "spring.cloud.polaris.config.enabled",
+ matchIfMissing = true)
+public class PolarisConfigEndpointAutoConfiguration {
+
+ @Bean
+ @ConditionalOnAvailableEndpoint
+ @ConditionalOnMissingBean
+ public PolarisConfigEndpoint polarisConfigEndpoint(PolarisConfigProperties polarisConfigProperties, PolarisPropertySourceManager polarisPropertySourceManager) {
+ return new PolarisConfigEndpoint(polarisConfigProperties, polarisPropertySourceManager);
+ }
+}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/enums/ConfigFileFormat.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/enums/ConfigFileFormat.java
index 024ad67d0..d7c7b590c 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/enums/ConfigFileFormat.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/enums/ConfigFileFormat.java
@@ -80,5 +80,4 @@ public enum ConfigFileFormat {
}
return true;
}
-
}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/ConfigChangeEvent.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/ConfigChangeEvent.java
index 119a5ce4c..367740d8c 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/ConfigChangeEvent.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/ConfigChangeEvent.java
@@ -84,5 +84,4 @@ public final class ConfigChangeEvent {
public Set interestedChangedKeys() {
return interestedChangedKeys;
}
-
}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/ConfigChangeListener.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/ConfigChangeListener.java
index 14ab64a32..1ff9d139c 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/ConfigChangeListener.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/ConfigChangeListener.java
@@ -31,5 +31,4 @@ public interface ConfigChangeListener {
* @param changeEvent the event for this change
*/
void onChange(ConfigChangeEvent changeEvent);
-
}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigChangeEventListener.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigChangeEventListener.java
index 0a55255d5..378f69628 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigChangeEventListener.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigChangeEventListener.java
@@ -107,5 +107,4 @@ public final class PolarisConfigChangeEventListener implements ApplicationListen
});
return ret;
}
-
}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigListenerContext.java b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigListenerContext.java
index 05ac41756..15a9a9336 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigListenerContext.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/java/com/tencent/cloud/polaris/config/listener/PolarisConfigListenerContext.java
@@ -52,6 +52,7 @@ import static com.tencent.polaris.configuration.api.core.ChangeType.MODIFIED;
* Refer to the Apollo project implementation:
*
* AbstractConfig
+ *
* @author Palmer Xu 2022-06-06
*/
public final class PolarisConfigListenerContext {
@@ -60,32 +61,30 @@ public final class PolarisConfigListenerContext {
* Logger instance.
*/
private static final Logger LOG = LoggerFactory.getLogger(PolarisConfigListenerContext.class);
-
/**
* Execute service Atomic Reference Cache .
*/
private static final AtomicReference EAR = new AtomicReference<>();
-
/**
* All custom {@link ConfigChangeListener} instance defined in application .
*/
private static final List listeners = Lists.newCopyOnWriteArrayList();
-
/**
* All custom interested keys defined in application .
*/
private static final Map> interestedKeys = Maps.newHashMap();
-
/**
* All custom interested key prefixes defined in application .
*/
private static final Map> interestedKeyPrefixes = Maps.newHashMap();
-
/**
* Cache all latest configuration information for users in the application environment .
*/
private static final Cache properties = CacheBuilder.newBuilder().build();
+ private PolarisConfigListenerContext() {
+ }
+
/**
* Get or Created new execute server .
* @return execute service instance of {@link ExecutorService}
@@ -273,5 +272,4 @@ public final class PolarisConfigListenerContext {
return Collections.unmodifiableSet(interestedChangedKeys);
}
-
}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/resources/META-INF/spring.factories b/spring-cloud-starter-tencent-polaris-config/src/main/resources/META-INF/spring.factories
index a0c33067e..98221a39a 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/main/resources/META-INF/spring.factories
+++ b/spring-cloud-starter-tencent-polaris-config/src/main/resources/META-INF/spring.factories
@@ -1,4 +1,5 @@
org.springframework.cloud.bootstrap.BootstrapConfiguration=\
com.tencent.cloud.polaris.config.PolarisConfigBootstrapAutoConfiguration
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
- com.tencent.cloud.polaris.config.PolarisConfigAutoConfiguration
+ com.tencent.cloud.polaris.config.PolarisConfigAutoConfiguration,\
+ com.tencent.cloud.polaris.config.endpoint.PolarisConfigEndpointAutoConfiguration
diff --git a/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/MockedConfigKVFile.java b/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/MockedConfigKVFile.java
index 026fe4d52..59e89ebcc 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/MockedConfigKVFile.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/MockedConfigKVFile.java
@@ -31,7 +31,8 @@ import com.tencent.polaris.configuration.api.core.ConfigKVFileChangeListener;
/**
* Mock config kv file for test.
- *@author lepdou 2022-06-11
+ *
+ * @author lepdou 2022-06-11
*/
public class MockedConfigKVFile implements ConfigKVFile {
diff --git a/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/PolarisConfigFileLocatorTest.java b/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/PolarisConfigFileLocatorTest.java
index 8c072ef9d..bfe1fc5d2 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/PolarisConfigFileLocatorTest.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/PolarisConfigFileLocatorTest.java
@@ -41,12 +41,15 @@ import org.springframework.core.env.PropertySource;
import static org.mockito.Mockito.when;
/**
- * test for {@link PolarisConfigFileLocator}
- *@author lepdou 2022-06-11
+ * test for {@link PolarisConfigFileLocator}.
+ *
+ * @author lepdou 2022-06-11
*/
@RunWith(MockitoJUnitRunner.class)
public class PolarisConfigFileLocatorTest {
+ private final String testNamespace = "testNamespace";
+ private final String testServiceName = "testServiceName";
@Mock
private PolarisConfigProperties polarisConfigProperties;
@Mock
@@ -58,9 +61,6 @@ public class PolarisConfigFileLocatorTest {
@Mock
private Environment environment;
- private final String testNamespace = "testNamespace";
- private final String testServiceName = "testServiceName";
-
@Test
public void testLoadApplicationPropertiesFile() {
PolarisConfigFileLocator locator = new PolarisConfigFileLocator(polarisConfigProperties, polarisContextProperties,
diff --git a/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/PolarisPropertiesSourceAutoRefresherTest.java b/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/PolarisPropertiesSourceAutoRefresherTest.java
index 04d455b46..ff9e405d1 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/PolarisPropertiesSourceAutoRefresherTest.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/adapter/PolarisPropertiesSourceAutoRefresherTest.java
@@ -48,12 +48,16 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
/**
- * test for {@link PolarisPropertySourceAutoRefresher}
- *@author lepdou 2022-06-11
+ * test for {@link PolarisPropertySourceAutoRefresher}.
+ *
+ * @author lepdou 2022-06-11
*/
@RunWith(MockitoJUnitRunner.class)
public class PolarisPropertiesSourceAutoRefresherTest {
+ private final String testNamespace = "testNamespace";
+ private final String testServiceName = "testServiceName";
+ private final String testFileName = "application.properties";
@Mock
private PolarisConfigProperties polarisConfigProperties;
@Mock
@@ -67,10 +71,6 @@ public class PolarisPropertiesSourceAutoRefresherTest {
@Mock
private PlaceholderHelper placeholderHelper;
- private final String testNamespace = "testNamespace";
- private final String testServiceName = "testServiceName";
- private final String testFileName = "application.properties";
-
@Test
public void testConfigFileChanged() throws Exception {
PolarisPropertySourceAutoRefresher refresher = new PolarisPropertySourceAutoRefresher(polarisConfigProperties,
@@ -83,8 +83,7 @@ public class PolarisPropertiesSourceAutoRefresherTest {
when(applicationContext.getBeanFactory()).thenReturn(beanFactory);
refresher.setApplicationContext(applicationContext);
when(typeConverter.convertIfNecessary(any(), any(), (Field) any())).thenReturn("v11");
-
-
+
Collection springValues = new ArrayList<>();
MockedConfigChange mockedConfigChange = new MockedConfigChange();
mockedConfigChange.setK1("v1");
@@ -95,8 +94,7 @@ public class PolarisPropertiesSourceAutoRefresherTest {
when(springValueRegistry.get(any(), any())).thenReturn(springValues);
when(polarisConfigProperties.isAutoRefresh()).thenReturn(true);
-
-
+
Map content = new HashMap<>();
content.put("k1", "v1");
content.put("k2", "v2");
@@ -123,5 +121,4 @@ public class PolarisPropertiesSourceAutoRefresherTest {
Assert.assertEquals("v11", mockedConfigChange.getK1());
}
-
}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/endpoint/PolarisConfigEndpointTest.java b/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/endpoint/PolarisConfigEndpointTest.java
new file mode 100644
index 000000000..93190ee1a
--- /dev/null
+++ b/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/endpoint/PolarisConfigEndpointTest.java
@@ -0,0 +1,70 @@
+/*
+ * Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
+ *
+ * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
+ *
+ * Licensed under the BSD 3-Clause License (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://opensource.org/licenses/BSD-3-Clause
+ *
+ * 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.tencent.cloud.polaris.config.endpoint;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.google.common.collect.Lists;
+import com.tencent.cloud.polaris.config.adapter.MockedConfigKVFile;
+import com.tencent.cloud.polaris.config.adapter.PolarisPropertySource;
+import com.tencent.cloud.polaris.config.adapter.PolarisPropertySourceManager;
+import com.tencent.cloud.polaris.config.config.PolarisConfigProperties;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.junit.MockitoJUnitRunner;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.when;
+
+/**
+ * Test for polaris config endpoint.
+ *
+ * @author shuiqingliu
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class PolarisConfigEndpointTest {
+
+ private final String testNamespace = "testNamespace";
+ private final String testServiceName = "testServiceName";
+ private final String testFileName = "application.properties";
+
+ @Mock
+ private PolarisConfigProperties polarisConfigProperties;
+ @Mock
+ private PolarisPropertySourceManager polarisPropertySourceManager;
+
+ @Test
+ public void testPolarisConfigEndpoint() {
+ Map content = new HashMap<>();
+ content.put("k1", "v1");
+ content.put("k2", "v2");
+ content.put("k3", "v3");
+ MockedConfigKVFile file = new MockedConfigKVFile(content);
+ PolarisPropertySource polarisPropertySource = new PolarisPropertySource(testNamespace, testServiceName, testFileName,
+ file, content);
+ when(polarisPropertySourceManager.getAllPropertySources()).thenReturn(Lists.newArrayList(polarisPropertySource));
+
+ PolarisConfigEndpoint endpoint = new PolarisConfigEndpoint(polarisConfigProperties, polarisPropertySourceManager);
+ Map info = endpoint.polarisConfig();
+ assertThat(polarisConfigProperties).isEqualTo(info.get("PolarisConfigProperties"));
+ assertThat(Lists.newArrayList(polarisPropertySource)).isEqualTo(info.get("PolarisPropertySource"));
+ }
+}
diff --git a/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/listener/ConfigChangeListenerTest.java b/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/listener/ConfigChangeListenerTest.java
index c408f4f54..58e39c89f 100644
--- a/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/listener/ConfigChangeListenerTest.java
+++ b/spring-cloud-starter-tencent-polaris-config/src/test/java/com/tencent/cloud/polaris/config/listener/ConfigChangeListenerTest.java
@@ -39,13 +39,13 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
/**
* Integration testing for change listener.
- *@author lepdou 2022-06-11
+ *
+ * @author lepdou 2022-06-11
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = DEFINED_PORT,
classes = ConfigChangeListenerTest.TestApplication.class,
- properties = {"server.port=8081",
- "spring.config.location = classpath:application-test.yml"})
+ properties = {"server.port=8081", "spring.config.location = classpath:application-test.yml"})
public class ConfigChangeListenerTest {
@Autowired
@@ -120,5 +120,4 @@ public class ConfigChangeListenerTest {
}
}
}
-
}
diff --git a/spring-cloud-starter-tencent-polaris-discovery/pom.xml b/spring-cloud-starter-tencent-polaris-discovery/pom.xml
index 39d8d5f83..ac077bb7b 100644
--- a/spring-cloud-starter-tencent-polaris-discovery/pom.xml
+++ b/spring-cloud-starter-tencent-polaris-discovery/pom.xml
@@ -93,6 +93,18 @@
test