|
|
|
|
@ -46,7 +46,6 @@ import org.springframework.web.context.WebApplicationContext;
@@ -46,7 +46,6 @@ import org.springframework.web.context.WebApplicationContext;
|
|
|
|
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc; |
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat; |
|
|
|
|
import static org.assertj.core.api.Assertions.assertThatCode; |
|
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; |
|
|
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; |
|
|
|
|
|
|
|
|
|
@ -84,8 +83,8 @@ class WebMvcMetricsIntegrationTests {
@@ -84,8 +83,8 @@ class WebMvcMetricsIntegrationTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void rethrownExceptionIsRecordedInMetricTag() { |
|
|
|
|
assertThatCode(() -> this.mvc.perform(get("/api/rethrownError")).andExpect(status().is5xxServerError())); |
|
|
|
|
void rethrownExceptionIsRecordedInMetricTag() throws Exception { |
|
|
|
|
this.mvc.perform(get("/api/rethrownError")).andExpect(status().is5xxServerError()); |
|
|
|
|
assertThat(this.registry.get("http.server.requests").tags("exception", "Exception2", "status", "500").timer() |
|
|
|
|
.count()).isEqualTo(1L); |
|
|
|
|
} |
|
|
|
|
|