Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye committed May 21, 2023
1 parent 2d7406b commit 4655981
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import static com.github.tomakehurst.wiremock.client.WireMock.any;
import static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;

/**
* Tests for {@link MicrometerHttpClientInterceptor}.
Expand Down Expand Up @@ -64,14 +63,12 @@ void asyncRequest(@WiremockResolver.Wiremock WireMockServer server) throws Excep
HttpResponse response = future.get();

assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200);
assertThatCode(() -> {
assertThat(registry.get("httpcomponents.httpclient.request")
.tag("method", "GET")
.tag("status", "200")
.tag("outcome", "SUCCESS")
.timer()
.count()).isEqualTo(1);
}).doesNotThrowAnyException();
assertThat(registry.get("httpcomponents.httpclient.request")
.tag("method", "GET")
.tag("status", "200")
.tag("outcome", "SUCCESS")
.timer()
.count()).isEqualTo(1);

client.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import static com.github.tomakehurst.wiremock.client.WireMock.any;
import static com.github.tomakehurst.wiremock.client.WireMock.anyUrl;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;

/**
* Tests for {@link MicrometerHttpClientInterceptor}.
Expand Down Expand Up @@ -67,14 +66,12 @@ void asyncRequest(@WiremockResolver.Wiremock WireMockServer server) throws Excep
HttpResponse response = future.get();

assertThat(response.getCode()).isEqualTo(200);
assertThatCode(() -> {
assertThat(registry.get("httpcomponents.httpclient.request")
.tag("method", "GET")
.tag("status", "200")
.tag("outcome", "SUCCESS")
.timer()
.count()).isEqualTo(1);
}).doesNotThrowAnyException();
assertThat(registry.get("httpcomponents.httpclient.request")
.tag("method", "GET")
.tag("status", "200")
.tag("outcome", "SUCCESS")
.timer()
.count()).isEqualTo(1);

client.close();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 VMware, Inc.
* Copyright 2023 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 VMware, Inc.
* Copyright 2023 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 4655981

Please sign in to comment.