remove location metadata (#535)

pull/541/head
lepdou 2 years ago committed by GitHub
parent 0d894b6096
commit b823e7e084
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,3 +16,4 @@
- [fix:fix only config file metadata can be used in routing bug.](https://github.com/Tencent/spring-cloud-tencent/pull/518) - [fix:fix only config file metadata can be used in routing bug.](https://github.com/Tencent/spring-cloud-tencent/pull/518)
- [optimizeoptimize config module code](https://github.com/Tencent/spring-cloud-tencent/pull/520) - [optimizeoptimize config module code](https://github.com/Tencent/spring-cloud-tencent/pull/520)
- [feat:optimize pushgateway plugin.](https://github.com/Tencent/spring-cloud-tencent/pull/530) - [feat:optimize pushgateway plugin.](https://github.com/Tencent/spring-cloud-tencent/pull/530)
- [Feature: remove location metadata](https://github.com/Tencent/spring-cloud-tencent/pull/535)

@ -109,9 +109,6 @@ public class PolarisRegistration implements Registration {
instanceMetadata.putAll(staticMetadataManager.getMergedStaticMetadata()); instanceMetadata.putAll(staticMetadataManager.getMergedStaticMetadata());
// location info will be putted both in metadata and instance's field
instanceMetadata.putAll(staticMetadataManager.getLocationMetadata());
this.metadata = Collections.unmodifiableMap(instanceMetadata); this.metadata = Collections.unmodifiableMap(instanceMetadata);
} }
return metadata; return metadata;

@ -74,7 +74,6 @@ public class PolarisRegistrationTest {
// mock StaticMetadataManager // mock StaticMetadataManager
StaticMetadataManager staticMetadataManager = mock(StaticMetadataManager.class); StaticMetadataManager staticMetadataManager = mock(StaticMetadataManager.class);
doReturn(Collections.singletonMap("key1", "value1")).when(staticMetadataManager).getMergedStaticMetadata(); doReturn(Collections.singletonMap("key1", "value1")).when(staticMetadataManager).getMergedStaticMetadata();
doReturn(Collections.singletonMap("key2", "value2")).when(staticMetadataManager).getLocationMetadata();
polarisRegistration = new PolarisRegistration(polarisDiscoveryProperties, consulContextProperties, polarisRegistration = new PolarisRegistration(polarisDiscoveryProperties, consulContextProperties,
polarisContext, staticMetadataManager); polarisContext, staticMetadataManager);
@ -110,9 +109,8 @@ public class PolarisRegistrationTest {
Map<String, String> metadata = polarisRegistration.getMetadata(); Map<String, String> metadata = polarisRegistration.getMetadata();
assertThat(metadata).isNotNull(); assertThat(metadata).isNotNull();
assertThat(metadata).isNotEmpty(); assertThat(metadata).isNotEmpty();
assertThat(metadata.size()).isEqualTo(4); assertThat(metadata.size()).isEqualTo(3);
assertThat(metadata.get("key1")).isEqualTo("value1"); assertThat(metadata.get("key1")).isEqualTo("value1");
assertThat(metadata.get("key2")).isEqualTo("value2");
} }
@Test @Test

Loading…
Cancel
Save