Merge branch '6.1.x'
This commit is contained in:
commit
c72e31bcf5
|
|
@ -247,19 +247,16 @@ final class DefaultRestClient implements RestClient {
|
||||||
ResolvableType.forType(bodyType) + "] and content type [" + contentType + "]", cause);
|
ResolvableType.forType(bodyType) + "] and content type [" + contentType + "]", cause);
|
||||||
if (observation != null) {
|
if (observation != null) {
|
||||||
observation.error(restClientException);
|
observation.error(restClientException);
|
||||||
|
observation.stop();
|
||||||
}
|
}
|
||||||
throw restClientException;
|
throw restClientException;
|
||||||
}
|
}
|
||||||
catch (RestClientException restClientException) {
|
catch (RestClientException restClientException) {
|
||||||
if (observation != null) {
|
if (observation != null) {
|
||||||
observation.error(restClientException);
|
observation.error(restClientException);
|
||||||
}
|
|
||||||
throw restClientException;
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
if (observation != null) {
|
|
||||||
observation.stop();
|
observation.stop();
|
||||||
}
|
}
|
||||||
|
throw restClientException;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ class RestClientObservationTests {
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setupEach() {
|
void setupEach() {
|
||||||
|
|
||||||
this.client = RestClient.builder()
|
this.client = RestClient.builder()
|
||||||
.messageConverters(converters -> converters.add(0, this.converter))
|
.messageConverters(converters -> converters.add(0, this.converter))
|
||||||
.requestFactory(this.requestFactory)
|
.requestFactory(this.requestFactory)
|
||||||
|
|
@ -267,6 +266,7 @@ class RestClientObservationTests {
|
||||||
|
|
||||||
|
|
||||||
private TestObservationRegistryAssert.TestObservationRegistryAssertReturningObservationContextAssert assertThatHttpObservation() {
|
private TestObservationRegistryAssert.TestObservationRegistryAssertReturningObservationContextAssert assertThatHttpObservation() {
|
||||||
|
TestObservationRegistryAssert.assertThat(this.observationRegistry).hasNumberOfObservationsWithNameEqualTo("http.client.requests",1);
|
||||||
return TestObservationRegistryAssert.assertThat(this.observationRegistry)
|
return TestObservationRegistryAssert.assertThat(this.observationRegistry)
|
||||||
.hasObservationWithNameEqualTo("http.client.requests").that();
|
.hasObservationWithNameEqualTo("http.client.requests").that();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue