Commit c0e3ae90 authored by Andy Wilkinson's avatar Andy Wilkinson

Polish

parent 996a7cf0
...@@ -49,7 +49,7 @@ public class CloudFoundryWebAnnotationEndpointDiscovererTests { ...@@ -49,7 +49,7 @@ public class CloudFoundryWebAnnotationEndpointDiscovererTests {
@Test @Test
public void discovererShouldAddSuppliedExtensionForHealthEndpoint() throws Exception { public void discovererShouldAddSuppliedExtensionForHealthEndpoint() throws Exception {
load(TestConfiguration.class, endpointDiscoverer -> { load(TestConfiguration.class, (endpointDiscoverer) -> {
Collection<EndpointInfo<WebOperation>> endpoints = endpointDiscoverer Collection<EndpointInfo<WebOperation>> endpoints = endpointDiscoverer
.discoverEndpoints(); .discoverEndpoints();
assertThat(endpoints.size()).isEqualTo(2); assertThat(endpoints.size()).isEqualTo(2);
......
...@@ -235,9 +235,8 @@ public class ReactiveCloudFoundryActuatorAutoConfigurationTests { ...@@ -235,9 +235,8 @@ public class ReactiveCloudFoundryActuatorAutoConfigurationTests {
this.context.refresh(); this.context.refresh();
Collection<EndpointInfo<WebOperation>> endpoints = getHandlerMapping() Collection<EndpointInfo<WebOperation>> endpoints = getHandlerMapping()
.getEndpoints(); .getEndpoints();
EndpointInfo endpointInfo = (EndpointInfo) (endpoints.toArray()[0]); EndpointInfo<WebOperation> endpointInfo = endpoints.iterator().next();
WebOperation webOperation = (WebOperation) endpointInfo.getOperations() WebOperation webOperation = endpointInfo.getOperations().iterator().next();
.toArray()[0];
ReflectiveOperationInvoker invoker = (ReflectiveOperationInvoker) webOperation ReflectiveOperationInvoker invoker = (ReflectiveOperationInvoker) webOperation
.getInvoker(); .getInvoker();
assertThat(ReflectionTestUtils.getField(invoker, "target")) assertThat(ReflectionTestUtils.getField(invoker, "target"))
......
...@@ -259,9 +259,8 @@ public class CloudFoundryActuatorAutoConfigurationTests { ...@@ -259,9 +259,8 @@ public class CloudFoundryActuatorAutoConfigurationTests {
.getBean("cloudFoundryWebEndpointServletHandlerMapping", .getBean("cloudFoundryWebEndpointServletHandlerMapping",
CloudFoundryWebEndpointServletHandlerMapping.class) CloudFoundryWebEndpointServletHandlerMapping.class)
.getEndpoints(); .getEndpoints();
EndpointInfo endpointInfo = (EndpointInfo) (endpoints.toArray()[0]); EndpointInfo<WebOperation> endpointInfo = endpoints.iterator().next();
WebOperation webOperation = (WebOperation) endpointInfo.getOperations() WebOperation webOperation = endpointInfo.getOperations().iterator().next();
.toArray()[0];
ReflectiveOperationInvoker invoker = (ReflectiveOperationInvoker) webOperation ReflectiveOperationInvoker invoker = (ReflectiveOperationInvoker) webOperation
.getInvoker(); .getInvoker();
assertThat(ReflectionTestUtils.getField(invoker, "target")) assertThat(ReflectionTestUtils.getField(invoker, "target"))
......
...@@ -130,7 +130,7 @@ public class FreeMarkerAutoConfigurationReactiveIntegrationTests { ...@@ -130,7 +130,7 @@ public class FreeMarkerAutoConfigurationReactiveIntegrationTests {
Mono<View> view = resolver.resolveViewName(viewName, Locale.UK); Mono<View> view = resolver.resolveViewName(viewName, Locale.UK);
MockServerWebExchange exchange = MockServerWebExchange MockServerWebExchange exchange = MockServerWebExchange
.from(MockServerHttpRequest.get("/path")); .from(MockServerHttpRequest.get("/path"));
view.flatMap(v -> v.render(null, MediaType.TEXT_HTML, exchange)).block(); view.flatMap((v) -> v.render(null, MediaType.TEXT_HTML, exchange)).block();
return exchange; return exchange;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment