|
|
|
@ -188,6 +188,18 @@ public class WebMvcMetricsFilterTests {
|
|
|
|
|
.tags("exception", "RuntimeException").timer().count()).isEqualTo(1L);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void anonymousError() {
|
|
|
|
|
try {
|
|
|
|
|
this.mvc.perform(get("/api/c1/anonymousError/10"));
|
|
|
|
|
}
|
|
|
|
|
catch (Throwable ignore) {
|
|
|
|
|
}
|
|
|
|
|
assertThat(this.registry.get("http.server.requests")
|
|
|
|
|
.tag("uri", "/api/c1/anonymousError/{id}").timer().getId()
|
|
|
|
|
.getTag("exception")).endsWith("$1");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void asyncCallableRequest() throws Exception {
|
|
|
|
|
AtomicReference<MvcResult> result = new AtomicReference<>();
|
|
|
|
@ -440,6 +452,14 @@ public class WebMvcMetricsFilterTests {
|
|
|
|
|
throw new IllegalStateException("Boom on " + id + "!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Timed
|
|
|
|
|
@GetMapping("/anonymousError/{id}")
|
|
|
|
|
public String alwaysThrowsAnonymousException(@PathVariable Long id)
|
|
|
|
|
throws Exception {
|
|
|
|
|
throw new Exception("this exception won't have a simple class name") {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Timed
|
|
|
|
|
@GetMapping("/unhandledError/{id}")
|
|
|
|
|
public String alwaysThrowsUnhandledException(@PathVariable Long id) {
|
|
|
|
|