remove location metadata (#534)

pull/540/head
lepdou 2 years ago committed by GitHub
parent bae5ead5fc
commit 87c780f242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,4 +22,5 @@
- [Code optimization for rpc-enhancement module](https://github.com/Tencent/spring-cloud-tencent/pull/525) - [Code optimization for rpc-enhancement module](https://github.com/Tencent/spring-cloud-tencent/pull/525)
- [Feature: Optimized configuration update](https://github.com/Tencent/spring-cloud-tencent/pull/527) - [Feature: Optimized configuration update](https://github.com/Tencent/spring-cloud-tencent/pull/527)
- [Featuresupport pushGateway push metrics](https://github.com/Tencent/spring-cloud-tencent/pull/531) - [Featuresupport pushGateway push metrics](https://github.com/Tencent/spring-cloud-tencent/pull/531)
- [Feature: remove location metadata](https://github.com/Tencent/spring-cloud-tencent/pull/534)
- [add feature-env plugin & add spring cloud gateway staining plugin](https://github.com/Tencent/spring-cloud-tencent/pull/532) - [add feature-env plugin & add spring cloud gateway staining plugin](https://github.com/Tencent/spring-cloud-tencent/pull/532)

@ -108,9 +108,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