Polish
This commit is contained in:
@@ -186,7 +186,7 @@ class WebMvcMetricsFilterTests {
|
||||
void streamingError() throws Exception {
|
||||
MvcResult result = this.mvc.perform(get("/api/c1/streamingError")).andExpect(request().asyncStarted())
|
||||
.andReturn();
|
||||
assertThatCode(() -> this.mvc.perform(asyncDispatch(result)).andExpect(status().isOk()));
|
||||
this.mvc.perform(asyncDispatch(result)).andExpect(status().isOk());
|
||||
assertThat(this.registry.get("http.server.requests").tags("exception", "IOException").timer().count())
|
||||
.isEqualTo(1L);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user