fix:fix junit error

pull/15/head
SkyeBeFreeman 3 years ago
parent 3b6ba1f4a7
commit 08e3dd5dcb

@ -74,7 +74,7 @@ public class MetadataContextHolderTest {
@Test @Test
public void test2() { public void test2() {
Assertions.assertThat(MetadataContextHolder.LOCAL_NAMESPACE).isEqualTo("Production"); Assertions.assertThat(MetadataContextHolder.LOCAL_NAMESPACE).isEqualTo("default");
Assertions.assertThat(MetadataContextHolder.LOCAL_SERVICE).isEqualTo("test"); Assertions.assertThat(MetadataContextHolder.LOCAL_SERVICE).isEqualTo("test");
} }

@ -64,7 +64,7 @@ public class Metadata2HeaderFeignInterceptorTest {
public void test1() { public void test1() {
String metadata = testFeign.test(); String metadata = testFeign.test();
Assertions.assertThat(metadata).isEqualTo("{\"a\":\"11\",\"b\":\"22\",\"c\":\"33\"}{\"LOCAL_SERVICE\":\"test" Assertions.assertThat(metadata).isEqualTo("{\"a\":\"11\",\"b\":\"22\",\"c\":\"33\"}{\"LOCAL_SERVICE\":\"test"
+ "\",\"LOCAL_PATH\":\"/test\",\"LOCAL_NAMESPACE\":\"Production\"}"); + "\",\"LOCAL_PATH\":\"/test\",\"LOCAL_NAMESPACE\":\"default\"}");
Assertions.assertThat(metadataLocalProperties.getContent().get("a")).isEqualTo("1"); Assertions.assertThat(metadataLocalProperties.getContent().get("a")).isEqualTo("1");
Assertions.assertThat(metadataLocalProperties.getContent().get("b")).isEqualTo("2"); Assertions.assertThat(metadataLocalProperties.getContent().get("b")).isEqualTo("2");
Assertions.assertThat(MetadataContextHolder.get().getTransitiveCustomMetadata("a")).isEqualTo("11"); Assertions.assertThat(MetadataContextHolder.get().getTransitiveCustomMetadata("a")).isEqualTo("11");

@ -72,7 +72,7 @@ public class MetadataRestTemplateInterceptorTest {
String metadata = restTemplate.exchange("http://localhost:" + localServerPort + "/test", String metadata = restTemplate.exchange("http://localhost:" + localServerPort + "/test",
HttpMethod.GET, httpEntity, String.class).getBody(); HttpMethod.GET, httpEntity, String.class).getBody();
Assertions.assertThat(metadata).isEqualTo("{\"a\":\"11\",\"b\":\"22\",\"c\":\"33\"}{\"LOCAL_SERVICE\":\"test" Assertions.assertThat(metadata).isEqualTo("{\"a\":\"11\",\"b\":\"22\",\"c\":\"33\"}{\"LOCAL_SERVICE\":\"test"
+ "\",\"LOCAL_PATH\":\"/test\",\"LOCAL_NAMESPACE\":\"Production\"}"); + "\",\"LOCAL_PATH\":\"/test\",\"LOCAL_NAMESPACE\":\"default\"}");
Assertions.assertThat(metadataLocalProperties.getContent().get("a")).isEqualTo("1"); Assertions.assertThat(metadataLocalProperties.getContent().get("a")).isEqualTo("1");
Assertions.assertThat(metadataLocalProperties.getContent().get("b")).isEqualTo("2"); Assertions.assertThat(metadataLocalProperties.getContent().get("b")).isEqualTo("2");
Assertions.assertThat(MetadataContextHolder.get().getTransitiveCustomMetadata("a")).isEqualTo("11"); Assertions.assertThat(MetadataContextHolder.get().getTransitiveCustomMetadata("a")).isEqualTo("11");

Loading…
Cancel
Save