Merge branch '6.1.x'

This commit is contained in:
Brian Clozel 2024-06-19 12:51:23 +02:00
commit c72e31bcf5
2 changed files with 3 additions and 6 deletions

View File

@ -247,19 +247,16 @@ final class DefaultRestClient implements RestClient {
ResolvableType.forType(bodyType) + "] and content type [" + contentType + "]", cause);
if (observation != null) {
observation.error(restClientException);
observation.stop();
}
throw restClientException;
}
catch (RestClientException restClientException) {
if (observation != null) {
observation.error(restClientException);
}
throw restClientException;
}
finally {
if (observation != null) {
observation.stop();
}
throw restClientException;
}
}

View File

@ -73,7 +73,6 @@ class RestClientObservationTests {
@BeforeEach
void setupEach() {
this.client = RestClient.builder()
.messageConverters(converters -> converters.add(0, this.converter))
.requestFactory(this.requestFactory)
@ -267,6 +266,7 @@ class RestClientObservationTests {
private TestObservationRegistryAssert.TestObservationRegistryAssertReturningObservationContextAssert assertThatHttpObservation() {
TestObservationRegistryAssert.assertThat(this.observationRegistry).hasNumberOfObservationsWithNameEqualTo("http.client.requests",1);
return TestObservationRegistryAssert.assertThat(this.observationRegistry)
.hasObservationWithNameEqualTo("http.client.requests").that();
}