Skip to content

Commit c0e3ae9

Browse files
committed
Polish
1 parent 996a7cf commit c0e3ae9

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebAnnotationEndpointDiscovererTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class CloudFoundryWebAnnotationEndpointDiscovererTests {
4949

5050
@Test
5151
public void discovererShouldAddSuppliedExtensionForHealthEndpoint() throws Exception {
52-
load(TestConfiguration.class, endpointDiscoverer -> {
52+
load(TestConfiguration.class, (endpointDiscoverer) -> {
5353
Collection<EndpointInfo<WebOperation>> endpoints = endpointDiscoverer
5454
.discoverEndpoints();
5555
assertThat(endpoints.size()).isEqualTo(2);

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundryActuatorAutoConfigurationTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,8 @@ public void healthEndpointInvokerShouldBeCloudFoundryWebExtension() throws Excep
235235
this.context.refresh();
236236
Collection<EndpointInfo<WebOperation>> endpoints = getHandlerMapping()
237237
.getEndpoints();
238-
EndpointInfo endpointInfo = (EndpointInfo) (endpoints.toArray()[0]);
239-
WebOperation webOperation = (WebOperation) endpointInfo.getOperations()
240-
.toArray()[0];
238+
EndpointInfo<WebOperation> endpointInfo = endpoints.iterator().next();
239+
WebOperation webOperation = endpointInfo.getOperations().iterator().next();
241240
ReflectiveOperationInvoker invoker = (ReflectiveOperationInvoker) webOperation
242241
.getInvoker();
243242
assertThat(ReflectionTestUtils.getField(invoker, "target"))

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfigurationTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,8 @@ public void healthEndpointInvokerShouldBeCloudFoundryWebExtension() throws Excep
259259
.getBean("cloudFoundryWebEndpointServletHandlerMapping",
260260
CloudFoundryWebEndpointServletHandlerMapping.class)
261261
.getEndpoints();
262-
EndpointInfo endpointInfo = (EndpointInfo) (endpoints.toArray()[0]);
263-
WebOperation webOperation = (WebOperation) endpointInfo.getOperations()
264-
.toArray()[0];
262+
EndpointInfo<WebOperation> endpointInfo = endpoints.iterator().next();
263+
WebOperation webOperation = endpointInfo.getOperations().iterator().next();
265264
ReflectiveOperationInvoker invoker = (ReflectiveOperationInvoker) webOperation
266265
.getInvoker();
267266
assertThat(ReflectionTestUtils.getField(invoker, "target"))

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationReactiveIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ private MockServerWebExchange render(String viewName) throws Exception {
130130
Mono<View> view = resolver.resolveViewName(viewName, Locale.UK);
131131
MockServerWebExchange exchange = MockServerWebExchange
132132
.from(MockServerHttpRequest.get("/path"));
133-
view.flatMap(v -> v.render(null, MediaType.TEXT_HTML, exchange)).block();
133+
view.flatMap((v) -> v.render(null, MediaType.TEXT_HTML, exchange)).block();
134134
return exchange;
135135
}
136136

0 commit comments

Comments
 (0)