pull/33082/head
Phillip Webb 2 years ago
parent 0e6d3697e4
commit 32b9945632

@ -16,7 +16,6 @@
package org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive; package org.springframework.boot.actuate.autoconfigure.cloudfoundry.reactive;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.aot.hint.RuntimeHints; 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.autoconfigure.cloudfoundry.reactive.CloudFoundryWebFluxEndpointHandlerMapping.CloudFoundryWebFluxEndpointHandlerMappingRuntimeHints;
import org.springframework.boot.actuate.endpoint.web.Link; import org.springframework.boot.actuate.endpoint.web.Link;
import static org.assertj.core.api.Assertions.assertThat;
/** /**
* Tests for {@link CloudFoundryWebFluxEndpointHandlerMapping}. * Tests for {@link CloudFoundryWebFluxEndpointHandlerMapping}.
* *
@ -37,9 +38,9 @@ class CloudFoundryWebFluxEndpointHandlerMappingTests {
RuntimeHints runtimeHints = new RuntimeHints(); RuntimeHints runtimeHints = new RuntimeHints();
new CloudFoundryWebFluxEndpointHandlerMappingRuntimeHints().registerHints(runtimeHints, new CloudFoundryWebFluxEndpointHandlerMappingRuntimeHints().registerHints(runtimeHints,
getClass().getClassLoader()); getClass().getClassLoader());
Assertions.assertThat(RuntimeHintsPredicates.reflection().onMethod(CloudFoundryLinksHandler.class, "links")) assertThat(RuntimeHintsPredicates.reflection().onMethod(CloudFoundryLinksHandler.class, "links"))
.accepts(runtimeHints); .accepts(runtimeHints);
Assertions.assertThat(RuntimeHintsPredicates.reflection().onType(Link.class)).accepts(runtimeHints); assertThat(RuntimeHintsPredicates.reflection().onType(Link.class)).accepts(runtimeHints);
} }
} }

@ -25,7 +25,6 @@ import java.util.UUID;
import javax.sql.DataSource; import javax.sql.DataSource;
import org.assertj.core.api.Assertions;
import org.flywaydb.core.Flyway; import org.flywaydb.core.Flyway;
import org.flywaydb.core.api.Location; import org.flywaydb.core.api.Location;
import org.flywaydb.core.api.MigrationVersion; import org.flywaydb.core.api.MigrationVersion;
@ -671,9 +670,8 @@ class FlywayAutoConfigurationTests {
void shouldRegisterResourceHints() { void shouldRegisterResourceHints() {
RuntimeHints runtimeHints = new RuntimeHints(); RuntimeHints runtimeHints = new RuntimeHints();
new FlywayAutoConfigurationRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader()); new FlywayAutoConfigurationRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
Assertions.assertThat(RuntimeHintsPredicates.resource().forResource("db/migration/")).accepts(runtimeHints); assertThat(RuntimeHintsPredicates.resource().forResource("db/migration/")).accepts(runtimeHints);
Assertions.assertThat(RuntimeHintsPredicates.resource().forResource("db/migration/V1__init.sql")) assertThat(RuntimeHintsPredicates.resource().forResource("db/migration/V1__init.sql")).accepts(runtimeHints);
.accepts(runtimeHints);
} }
private ContextConsumer<AssertableApplicationContext> validateFlywayTeamsPropertyOnly(String propertyName) { private ContextConsumer<AssertableApplicationContext> validateFlywayTeamsPropertyOnly(String propertyName) {

@ -17,7 +17,6 @@
package smoketest.rsocket; package smoketest.rsocket;
import io.rsocket.metadata.WellKnownMimeType; import io.rsocket.metadata.WellKnownMimeType;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
import reactor.test.StepVerifier; 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.security.rsocket.metadata.UsernamePasswordMetadata;
import org.springframework.util.MimeTypeUtils; import org.springframework.util.MimeTypeUtils;
import static org.assertj.core.api.Assertions.assertThat;
@SpringBootTest(properties = "spring.rsocket.server.port=0") @SpringBootTest(properties = "spring.rsocket.server.port=0")
class SampleRSocketApplicationTests { class SampleRSocketApplicationTests {
@ -54,8 +55,7 @@ class SampleRSocketApplicationTests {
MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.getString())) MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.getString()))
.tcp("localhost", this.port); .tcp("localhost", this.port);
Mono<Project> result = requester.route("find.project.spring-boot").retrieveMono(Project.class); Mono<Project> result = requester.route("find.project.spring-boot").retrieveMono(Project.class);
StepVerifier.create(result) StepVerifier.create(result).assertNext((project) -> assertThat(project.getName()).isEqualTo("spring-boot"))
.assertNext((project) -> Assertions.assertThat(project.getName()).isEqualTo("spring-boot"))
.verifyComplete(); .verifyComplete();
} }

Loading…
Cancel
Save