mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish
This commit is contained in:
parent
b29e81fcd9
commit
2cdceb92bf
@ -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);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class TestJsonConverter extends JsonConverter {
|
||||
|
||||
@Override
|
||||
public JSONArray toJsonArray(ConfigurationMetadata metadata, ItemType itemType) throws Exception {
|
||||
return toJsonArray(metadata, itemType);
|
||||
return super.toJsonArray(metadata, itemType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -106,7 +106,9 @@ public class NettyWebServer implements WebServer {
|
||||
}
|
||||
|
||||
private void applyRouteProviders(HttpServerRoutes routes) {
|
||||
this.routeProviders.forEach((provider) -> provider.apply(routes));
|
||||
for (NettyRouteProvider provider : this.routeProviders) {
|
||||
routes = provider.apply(routes);
|
||||
}
|
||||
routes.route(ALWAYS, this.handlerAdapter);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user