This commit is contained in:
Johnny Lim
2023-02-15 22:22:58 +09:00
parent 3e3f046dc9
commit ce3be72e7f
18 changed files with 49 additions and 51 deletions

View File

@@ -45,6 +45,8 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
private static final KeyValue URI_NONE = KeyValue.of(LowCardinalityKeyNames.URI, KeyValue.NONE_VALUE);
private static final KeyValue URI_ROOT = KeyValue.of(LowCardinalityKeyNames.URI, ROOT_PATH);
private static final KeyValue METHOD_NONE = KeyValue.of(LowCardinalityKeyNames.METHOD, KeyValue.NONE_VALUE);
private static final KeyValue STATUS_IO_ERROR = KeyValue.of(LowCardinalityKeyNames.STATUS, "IO_ERROR");
@@ -101,7 +103,7 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
}
ClientRequest request = context.getRequest();
if (request != null && ROOT_PATH.equals(request.url().getPath())) {
return KeyValue.of(LowCardinalityKeyNames.URI, ROOT_PATH);
return URI_ROOT;
}
return URI_NONE;
}

View File

@@ -18,7 +18,7 @@ package org.springframework.web.reactive.function.client.support
import kotlinx.coroutines.runBlocking
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
import org.assertj.core.api.Assertions
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
@@ -66,7 +66,7 @@ class KotlinWebClientHttpServiceProxyTests {
}
runBlocking {
val greeting = initHttpService().getGreetingSuspending()
Assertions.assertThat(greeting).isEqualTo("Hello Spring!")
assertThat(greeting).isEqualTo("Hello Spring!")
}
}
@@ -93,7 +93,7 @@ class KotlinWebClientHttpServiceProxyTests {
).setBody("Hello Spring!")
}
val greeting = initHttpService().getGreetingBlocking()
Assertions.assertThat(greeting).isEqualTo("Hello Spring!")
assertThat(greeting).isEqualTo("Hello Spring!")
}
@Test
@@ -115,8 +115,8 @@ class KotlinWebClientHttpServiceProxyTests {
val service = initHttpService(webClient)
runBlocking {
val greeting = service.getGreetingSuspendingWithAttribute("myAttributeValue")
Assertions.assertThat(greeting).isEqualTo("Hello Spring!")
Assertions.assertThat(attributes).containsEntry("myAttribute", "myAttributeValue")
assertThat(greeting).isEqualTo("Hello Spring!")
assertThat(attributes).containsEntry("myAttribute", "myAttributeValue")
}
}