From 32b9945632f36b226860835f7637eee57b03118c Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 8 Nov 2022 23:15:30 -0800 Subject: [PATCH] Polish --- .../CloudFoundryWebFluxEndpointHandlerMappingTests.java | 7 ++++--- .../autoconfigure/flyway/FlywayAutoConfigurationTests.java | 6 ++---- .../smoketest/rsocket/SampleRSocketApplicationTests.java | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointHandlerMappingTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointHandlerMappingTests.java index ae612e9740..f97d71db90 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointHandlerMappingTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/CloudFoundryWebFluxEndpointHandlerMappingTests.java @@ -16,7 +16,6 @@ package org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.aot.hint.RuntimeHints; @@ -25,6 +24,8 @@ import org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive.Clou import org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive.CloudFoundryWebFluxEndpointHandlerMapping.CloudFoundryWebFluxEndpointHandlerMappingRuntimeHints; import org.springframework.boot.actuate.endpoint.web.Link; +import static org.assertj.core.api.Assertions.assertThat; + /** * Tests for {@link CloudFoundryWebFluxEndpointHandlerMapping}. * @@ -37,9 +38,9 @@ class CloudFoundryWebFluxEndpointHandlerMappingTests { RuntimeHints runtimeHints = new RuntimeHints(); new CloudFoundryWebFluxEndpointHandlerMappingRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader()); - Assertions.assertThat(RuntimeHintsPredicates.reflection().onMethod(CloudFoundryLinksHandler.class, "links")) + assertThat(RuntimeHintsPredicates.reflection().onMethod(CloudFoundryLinksHandler.class, "links")) .accepts(runtimeHints); - Assertions.assertThat(RuntimeHintsPredicates.reflection().onType(Link.class)).accepts(runtimeHints); + assertThat(RuntimeHintsPredicates.reflection().onType(Link.class)).accepts(runtimeHints); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java index 0f067db51b..e019b39efc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java @@ -25,7 +25,6 @@ import java.util.UUID; import javax.sql.DataSource; -import org.assertj.core.api.Assertions; import org.flywaydb.core.Flyway; import org.flywaydb.core.api.Location; import org.flywaydb.core.api.MigrationVersion; @@ -671,9 +670,8 @@ class FlywayAutoConfigurationTests { void shouldRegisterResourceHints() { RuntimeHints runtimeHints = new RuntimeHints(); new FlywayAutoConfigurationRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader()); - Assertions.assertThat(RuntimeHintsPredicates.resource().forResource("db/migration/")).accepts(runtimeHints); - Assertions.assertThat(RuntimeHintsPredicates.resource().forResource("db/migration/V1__init.sql")) - .accepts(runtimeHints); + assertThat(RuntimeHintsPredicates.resource().forResource("db/migration/")).accepts(runtimeHints); + assertThat(RuntimeHintsPredicates.resource().forResource("db/migration/V1__init.sql")).accepts(runtimeHints); } private ContextConsumer validateFlywayTeamsPropertyOnly(String propertyName) { diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/src/test/java/smoketest/rsocket/SampleRSocketApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/src/test/java/smoketest/rsocket/SampleRSocketApplicationTests.java index 97a5899cbd..c526f89d5e 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/src/test/java/smoketest/rsocket/SampleRSocketApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/src/test/java/smoketest/rsocket/SampleRSocketApplicationTests.java @@ -17,7 +17,6 @@ package smoketest.rsocket; import io.rsocket.metadata.WellKnownMimeType; -import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -30,6 +29,8 @@ import org.springframework.security.rsocket.metadata.SimpleAuthenticationEncoder import org.springframework.security.rsocket.metadata.UsernamePasswordMetadata; import org.springframework.util.MimeTypeUtils; +import static org.assertj.core.api.Assertions.assertThat; + @SpringBootTest(properties = "spring.rsocket.server.port=0") class SampleRSocketApplicationTests { @@ -54,8 +55,7 @@ class SampleRSocketApplicationTests { MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.getString())) .tcp("localhost", this.port); Mono result = requester.route("find.project.spring-boot").retrieveMono(Project.class); - StepVerifier.create(result) - .assertNext((project) -> Assertions.assertThat(project.getName()).isEqualTo("spring-boot")) + StepVerifier.create(result).assertNext((project) -> assertThat(project.getName()).isEqualTo("spring-boot")) .verifyComplete(); }