diff --git a/buildSrc/src/test/java/org/springframework/boot/build/mavenplugin/PluginXmlParserTests.java b/buildSrc/src/test/java/org/springframework/boot/build/mavenplugin/PluginXmlParserTests.java index d3c130dfc5..fa0ea8d433 100644 --- a/buildSrc/src/test/java/org/springframework/boot/build/mavenplugin/PluginXmlParserTests.java +++ b/buildSrc/src/test/java/org/springframework/boot/build/mavenplugin/PluginXmlParserTests.java @@ -18,7 +18,6 @@ package org.springframework.boot.build.mavenplugin; import java.io.File; import java.io.FileNotFoundException; -import java.util.Arrays; import java.util.stream.Collectors; import org.junit.jupiter.api.Test; @@ -46,7 +45,7 @@ public class PluginXmlParserTests { assertThat(plugin.getVersion()).isEqualTo("2.2.0.GRADLE-SNAPSHOT"); assertThat(plugin.getGoalPrefix()).isEqualTo("spring-boot"); assertThat(plugin.getMojos().stream().map(PluginXmlParser.Mojo::getGoal).collect(Collectors.toList())) - .isEqualTo(Arrays.asList("build-info", "help", "repackage", "run", "start", "stop")); + .containsExactly("build-info", "help", "repackage", "run", "start", "stop"); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java index efd85f9fed..4fa457c2e7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceAutoConfigurationTests.java @@ -154,6 +154,7 @@ class DataSourceAutoConfigurationTests { @Test void dataSourceWhenNoConnectionPoolsAreAvailableWithUrlDoesNotCreateDataSource() { this.contextRunner.with(hideConnectionPools()) + .withPropertyValues("spring.datasource.url:jdbc:hsqldb:mem:testdb") .run((context) -> assertThat(context).doesNotHaveBean(DataSource.class)); } @@ -210,8 +211,8 @@ class DataSourceAutoConfigurationTests { } private static Function hideConnectionPools() { - return (runner) -> runner.withClassLoader(new FilteredClassLoader("org.apache.tomcat", "com.zaxxer.hikari", - "org.apache.commons.dbcp", "org.apache.commons.dbcp2")); + return (runner) -> runner.withClassLoader( + new FilteredClassLoader("org.apache.tomcat", "com.zaxxer.hikari", "org.apache.commons.dbcp2")); } private void assertDataSource(Class expectedType, List hiddenPackages,