Browse Source

Polish

pull/17778/head
Phillip Webb 7 years ago
parent
commit
2cdceb92bf
  1. 2
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java
  2. 5
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsIntegrationTests.java
  3. 2
      spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/TestJsonConverter.java
  4. 4
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyWebServer.java

2
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilterTests.java

@ -186,7 +186,7 @@ class WebMvcMetricsFilterTests { @@ -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);
}

5
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsIntegrationTests.java

@ -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);
}

2
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/metadata/TestJsonConverter.java

@ -31,7 +31,7 @@ public class TestJsonConverter extends JsonConverter { @@ -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

4
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyWebServer.java

@ -106,7 +106,9 @@ public class NettyWebServer implements WebServer { @@ -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…
Cancel
Save