diff --git a/cli/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/InitCommandTests.java b/cli/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/InitCommandTests.java index 53ad18de35f..c198632e30f 100644 --- a/cli/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/InitCommandTests.java +++ b/cli/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/InitCommandTests.java @@ -409,8 +409,10 @@ class InitCommandTests extends AbstractHttpClientMockTests { void userAgent() throws Exception { this.command.run("--list", "--target=https://fake-service"); then(this.http).should() - .executeOpen(any(HttpHost.class), assertArg((request) -> assertThat( - request.getHeaders("User-Agent")[0].getValue().startsWith("SpringBootCli/"))), isNull()); + .executeOpen(any(HttpHost.class), + assertArg((request) -> assertThat(request.getHeaders("User-Agent")[0].getValue()) + .startsWith("SpringBootCli/")), + isNull()); } private void withUserDir(File userDir, ThrowingRunnable action) throws Exception { diff --git a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java index f832726a6de..c4f690c5465 100644 --- a/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java +++ b/core/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfigurationTests.java @@ -102,7 +102,7 @@ class JmxAutoConfigurationTests { try (AnnotationConfigApplicationContext parent = new AnnotationConfigApplicationContext()) { parent.register(JmxAutoConfiguration.class); parent.refresh(); - this.contextRunner.withParent(parent).run((context) -> assertThat(context.isRunning())); + this.contextRunner.withParent(parent).run((context) -> assertThat(context.isRunning()).isTrue()); } } @@ -113,7 +113,7 @@ class JmxAutoConfigurationTests { parent.refresh(); this.contextRunner.withParent(parent) .withConfiguration(UserConfigurations.of(TestConfiguration.class)) - .run((context) -> assertThat(context.isRunning())); + .run((context) -> assertThat(context.isRunning()).isTrue()); } } diff --git a/loader/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/Zip64EndOfCentralDirectoryRecordTests.java b/loader/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/Zip64EndOfCentralDirectoryRecordTests.java index 857500cb9e4..0c36514d51a 100644 --- a/loader/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/Zip64EndOfCentralDirectoryRecordTests.java +++ b/loader/spring-boot-loader/src/test/java/org/springframework/boot/loader/zip/Zip64EndOfCentralDirectoryRecordTests.java @@ -52,7 +52,7 @@ class Zip64EndOfCentralDirectoryRecordTests { assertThat(eocd.numberOfCentralDirectoryEntriesOnThisDisk()).isEqualTo(6); assertThat(eocd.totalNumberOfCentralDirectoryEntries()).isEqualTo(7); assertThat(eocd.sizeOfCentralDirectory()).isEqualTo(8); - assertThat(eocd.offsetToStartOfCentralDirectory()); + assertThat(eocd.offsetToStartOfCentralDirectory()).isEqualTo(9); } @Test diff --git a/module/spring-boot-elasticsearch/src/test/java/org/springframework/boot/elasticsearch/autoconfigure/ElasticsearchRestClientAutoConfigurationTests.java b/module/spring-boot-elasticsearch/src/test/java/org/springframework/boot/elasticsearch/autoconfigure/ElasticsearchRestClientAutoConfigurationTests.java index 64592e88c7f..a507a8c3917 100644 --- a/module/spring-boot-elasticsearch/src/test/java/org/springframework/boot/elasticsearch/autoconfigure/ElasticsearchRestClientAutoConfigurationTests.java +++ b/module/spring-boot-elasticsearch/src/test/java/org/springframework/boot/elasticsearch/autoconfigure/ElasticsearchRestClientAutoConfigurationTests.java @@ -203,8 +203,8 @@ class ElasticsearchRestClientAutoConfigurationTests { Rest5Client client = context.getBean(Rest5Client.class); assertThat(client).extracting("defaultHeaders", InstanceOfAssertFactories.list(Header.class)) .satisfiesOnlyOnce((header) -> { - assertThat(header.getName().equals("Authorization")); - assertThat(header.getValue().equals("ApiKey some-api-key")); + assertThat(header.getName()).isEqualTo("Authorization"); + assertThat(header.getValue()).isEqualTo("ApiKey some-api-key"); }); }); } @@ -218,8 +218,8 @@ class ElasticsearchRestClientAutoConfigurationTests { Rest5Client client = context.getBean(Rest5Client.class); assertThat(client).extracting("defaultHeaders", InstanceOfAssertFactories.list(Header.class)) .satisfiesOnlyOnce((header) -> { - assertThat(header.getName().equals("Authorization")); - assertThat(header.getValue().equals("ApiKey some-api-key")); + assertThat(header.getName()).isEqualTo("Authorization"); + assertThat(header.getValue()).isEqualTo("ApiKey some-api-key"); }); assertThat(client) .extracting("client.credentialsProvider", InstanceOfAssertFactories.type(CredentialsProvider.class)) diff --git a/module/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketServerAutoConfigurationTests.java b/module/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketServerAutoConfigurationTests.java index c20f5067f2f..41b67ca22f8 100644 --- a/module/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketServerAutoConfigurationTests.java +++ b/module/spring-boot-rsocket/src/test/java/org/springframework/boot/rsocket/autoconfigure/RSocketServerAutoConfigurationTests.java @@ -174,7 +174,7 @@ class RSocketServerAutoConfigurationTests { .run((context) -> { assertThat(context).hasFailed(); assertThat(context.getStartupFailure()).hasRootCauseInstanceOf(NoSuchSslBundleException.class) - .withFailMessage("SSL bundle name 'test-bundle' is not valid"); + .hasRootCauseMessage("SSL bundle name 'test-bundle' cannot be found"); }); } diff --git a/module/spring-boot-security-saml2/src/test/java/org/springframework/boot/security/saml2/autoconfigure/Saml2RelyingPartyAutoConfigurationTests.java b/module/spring-boot-security-saml2/src/test/java/org/springframework/boot/security/saml2/autoconfigure/Saml2RelyingPartyAutoConfigurationTests.java index 8061f26a175..3dcaf841d53 100644 --- a/module/spring-boot-security-saml2/src/test/java/org/springframework/boot/security/saml2/autoconfigure/Saml2RelyingPartyAutoConfigurationTests.java +++ b/module/spring-boot-security-saml2/src/test/java/org/springframework/boot/security/saml2/autoconfigure/Saml2RelyingPartyAutoConfigurationTests.java @@ -340,8 +340,7 @@ class Saml2RelyingPartyAutoConfigurationTests { void causesManagementWebSecurityAutoConfigurationToBackOff() { WebApplicationContextRunner contextRunner = this.contextRunner.withConfiguration( AutoConfigurations.of(ManagementWebSecurityAutoConfiguration.class, WebMvcAutoConfiguration.class)); - assertThat(contextRunner - .run((context) -> assertThat(context).hasSingleBean(ManagementWebSecurityAutoConfiguration.class))); + contextRunner.run((context) -> assertThat(context).hasSingleBean(ManagementWebSecurityAutoConfiguration.class)); contextRunner.withPropertyValues(PREFIX + ".simplesamlphp.assertingparty.single-sign-on.url=https://simplesaml-for-spring-saml/SSOService.php", PREFIX + ".simplesamlphp.assertingparty.single-sign-on.sign-request=false", diff --git a/module/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/autoconfigure/reactive/AbstractReactiveWebServerAutoConfigurationTests.java b/module/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/autoconfigure/reactive/AbstractReactiveWebServerAutoConfigurationTests.java index ce0fe8a0628..d4d29ca6311 100644 --- a/module/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/autoconfigure/reactive/AbstractReactiveWebServerAutoConfigurationTests.java +++ b/module/spring-boot-web-server/src/testFixtures/java/org/springframework/boot/web/server/autoconfigure/reactive/AbstractReactiveWebServerAutoConfigurationTests.java @@ -107,7 +107,7 @@ public abstract class AbstractReactiveWebServerAutoConfigurationTests { .run((context) -> { assertThat(context).hasFailed(); assertThat(context.getStartupFailure().getCause()).isInstanceOf(NoSuchSslBundleException.class) - .withFailMessage("test"); + .hasMessage("SSL bundle name 'test-bundle' cannot be found"); }); }