Browse Source

Merge branch '3.0.x' into 3.1.x

Closes gh-37661
pull/38706/head
Andy Wilkinson 2 years ago
parent
commit
a4100e12ff
  1. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/ValidationFailureAnalyzerTests.java
  2. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfigurationTests.java
  3. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java
  4. 2
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfigurationTests.java
  5. 2
      spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/SilentExitExceptionHandlerTests.java
  6. 2
      spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/test/AbstractDockerComposeIntegrationTests.java
  7. 2
      spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigureAnnotationProcessorTests.java
  8. 6
      spring-boot-project/spring-boot-tools/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/InitCommandTests.java
  9. 2
      spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java
  10. 2
      spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/process/DisabledIfProcessUnavailableTests.java
  11. 26
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/PropertyMapperTests.java
  12. 2
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/ValueObjectBinderTests.java
  13. 2
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BeanCurrentlyInCreationFailureAnalyzerTests.java
  14. 2
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BeanNotOfRequiredTypeFailureAnalyzerTests.java
  15. 2
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/util/LambdaSafeTests.java
  16. 2
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java
  17. 2
      src/checkstyle/checkstyle.xml

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/ValidationFailureAnalyzerTests.java

@ -30,7 +30,7 @@ import org.springframework.context.annotation.Configuration; @@ -30,7 +30,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link ValidationFailureAnalyzer}.

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfigurationTests.java

@ -43,7 +43,7 @@ import org.springframework.jmx.export.MBeanExporter; @@ -43,7 +43,7 @@ import org.springframework.jmx.export.MBeanExporter;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link SpringApplicationAdminJmxAutoConfiguration}.

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/TomcatDataSourceConfigurationTests.java

@ -37,7 +37,7 @@ import org.springframework.context.annotation.Configuration; @@ -37,7 +37,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableMBeanExport;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link TomcatDataSourceConfiguration}.

2
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/websocket/servlet/WebSocketMessagingAutoConfigurationTests.java

@ -69,7 +69,7 @@ import org.springframework.web.socket.sockjs.client.Transport; @@ -69,7 +69,7 @@ import org.springframework.web.socket.sockjs.client.Transport;
import org.springframework.web.socket.sockjs.client.WebSocketTransport;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link WebSocketMessagingAutoConfiguration}.

2
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/SilentExitExceptionHandlerTests.java

@ -21,7 +21,7 @@ import java.util.concurrent.CountDownLatch; @@ -21,7 +21,7 @@ import java.util.concurrent.CountDownLatch;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link SilentExitExceptionHandler}.

2
spring-boot-project/spring-boot-docker-compose/src/test/java/org/springframework/boot/docker/compose/service/connection/test/AbstractDockerComposeIntegrationTests.java

@ -38,7 +38,7 @@ import org.springframework.core.io.Resource; @@ -38,7 +38,7 @@ import org.springframework.core.io.Resource;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.function.ThrowingSupplier;
import static org.junit.Assert.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Abstract base class for integration tests.

2
spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigureAnnotationProcessorTests.java

@ -27,7 +27,7 @@ import org.springframework.core.test.tools.SourceFile; @@ -27,7 +27,7 @@ import org.springframework.core.test.tools.SourceFile;
import org.springframework.core.test.tools.TestCompiler;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link AutoConfigureAnnotationProcessor}.

6
spring-boot-project/spring-boot-tools/spring-boot-cli/src/test/java/org/springframework/boot/cli/command/init/InitCommandTests.java

@ -34,7 +34,7 @@ import org.mockito.junit.jupiter.MockitoExtension; @@ -34,7 +34,7 @@ import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.boot.cli.command.status.ExitStatus;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.assertArg;
import static org.mockito.ArgumentMatchers.isNull;
@ -192,7 +192,7 @@ class InitCommandTests extends AbstractHttpClientMockTests { @@ -192,7 +192,7 @@ class InitCommandTests extends AbstractHttpClientMockTests {
}
@Test
void generateProjectAndExtractUnknownContentType(@TempDir File tempDir) throws Exception {
void generateProjectAndExtractUnknownContentType(@TempDir File tempDir) {
String fileName = UUID.randomUUID().toString() + ".zip";
File file = new File(fileName);
assertThat(file).as("file should not exist").doesNotExist();
@ -204,7 +204,7 @@ class InitCommandTests extends AbstractHttpClientMockTests { @@ -204,7 +204,7 @@ class InitCommandTests extends AbstractHttpClientMockTests {
assertThat(file).as("file should have been saved instead").exists();
}
catch (Exception ex) {
fail(ex);
fail(null, ex);
}
finally {
assertThat(file.delete()).as("failed to delete test file").isTrue();

2
spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java

@ -61,7 +61,7 @@ import org.springframework.util.FileCopyUtils; @@ -61,7 +61,7 @@ import org.springframework.util.FileCopyUtils;
import org.springframework.util.FileSystemUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* A {@code GradleBuild} is used to run a Gradle build using {@link GradleRunner}.

2
spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/process/DisabledIfProcessUnavailableTests.java

@ -18,7 +18,7 @@ package org.springframework.boot.testsupport.process; @@ -18,7 +18,7 @@ package org.springframework.boot.testsupport.process;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link DisabledIfProcessUnavailable}.

26
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/PropertyMapperTests.java

@ -18,11 +18,11 @@ package org.springframework.boot.context.properties; @@ -18,11 +18,11 @@ package org.springframework.boot.context.properties;
import java.util.function.Supplier;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link PropertyMapper}.
@ -57,7 +57,7 @@ class PropertyMapperTests { @@ -57,7 +57,7 @@ class PropertyMapperTests {
@Test
void fromValueAlwaysApplyingWhenNonNullShouldAlwaysApplyNonNullToSource() {
this.map.alwaysApplyingWhenNonNull().from((String) null).toCall(Assertions::fail);
this.map.alwaysApplyingWhenNonNull().from((String) null).toCall(() -> fail(null));
}
@Test
@ -101,14 +101,14 @@ class PropertyMapperTests { @@ -101,14 +101,14 @@ class PropertyMapperTests {
@Test
void whenNonNullWhenSuppliedNullShouldNotMap() {
this.map.from(() -> null).whenNonNull().as(String::valueOf).toCall(Assertions::fail);
this.map.from(() -> null).whenNonNull().as(String::valueOf).toCall(() -> fail(null));
}
@Test
void whenNonNullWhenSuppliedThrowsNullPointerExceptionShouldNotMap() {
this.map.from(() -> {
throw new NullPointerException();
}).whenNonNull().as(String::valueOf).toCall(Assertions::fail);
}).whenNonNull().as(String::valueOf).toCall(() -> fail(null));
}
@Test
@ -119,7 +119,7 @@ class PropertyMapperTests { @@ -119,7 +119,7 @@ class PropertyMapperTests {
@Test
void whenTrueWhenValueIsFalseShouldNotMap() {
this.map.from(false).whenTrue().toCall(Assertions::fail);
this.map.from(false).whenTrue().toCall(() -> fail(null));
}
@Test
@ -130,17 +130,17 @@ class PropertyMapperTests { @@ -130,17 +130,17 @@ class PropertyMapperTests {
@Test
void whenFalseWhenValueIsTrueShouldNotMap() {
this.map.from(true).whenFalse().toCall(Assertions::fail);
this.map.from(true).whenFalse().toCall(() -> fail(null));
}
@Test
void whenHasTextWhenValueIsNullShouldNotMap() {
this.map.from(() -> null).whenHasText().toCall(Assertions::fail);
this.map.from(() -> null).whenHasText().toCall(() -> fail(null));
}
@Test
void whenHasTextWhenValueIsEmptyShouldNotMap() {
this.map.from("").whenHasText().toCall(Assertions::fail);
this.map.from("").whenHasText().toCall(() -> fail(null));
}
@Test
@ -157,7 +157,7 @@ class PropertyMapperTests { @@ -157,7 +157,7 @@ class PropertyMapperTests {
@Test
void whenEqualToWhenValueIsNotEqualShouldNotMatch() {
this.map.from("123").whenEqualTo("321").toCall(Assertions::fail);
this.map.from("123").whenEqualTo("321").toCall(() -> fail(null));
}
@Test
@ -169,7 +169,7 @@ class PropertyMapperTests { @@ -169,7 +169,7 @@ class PropertyMapperTests {
@Test
void whenInstanceOfWhenValueIsNotTargetTypeShouldNotMatch() {
Supplier<Number> supplier = () -> 123L;
this.map.from(supplier).whenInstanceOf(Double.class).toCall(Assertions::fail);
this.map.from(supplier).whenInstanceOf(Double.class).toCall(() -> fail(null));
}
@Test
@ -180,7 +180,7 @@ class PropertyMapperTests { @@ -180,7 +180,7 @@ class PropertyMapperTests {
@Test
void whenWhenValueDoesNotMatchShouldNotMap() {
this.map.from("123").when("321"::equals).toCall(Assertions::fail);
this.map.from("123").when("321"::equals).toCall(() -> fail(null));
}
@Test
@ -198,12 +198,12 @@ class PropertyMapperTests { @@ -198,12 +198,12 @@ class PropertyMapperTests {
@Test
void alwaysApplyingWhenNonNullShouldAlwaysApplyNonNullToSource() {
this.map.alwaysApplyingWhenNonNull().from(() -> null).toCall(Assertions::fail);
this.map.alwaysApplyingWhenNonNull().from(() -> null).toCall(() -> fail(null));
}
@Test
void whenWhenValueNotMatchesShouldSupportChainedCalls() {
this.map.from("123").when("456"::equals).when("123"::equals).toCall(Assertions::fail);
this.map.from("123").when("456"::equals).when("123"::equals).toCall(() -> fail(null));
}
@Test

2
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/ValueObjectBinderTests.java

@ -40,7 +40,7 @@ import org.springframework.util.Assert; @@ -40,7 +40,7 @@ import org.springframework.util.Assert;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link ValueObjectBinder}.

2
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BeanCurrentlyInCreationFailureAnalyzerTests.java

@ -36,7 +36,7 @@ import org.springframework.context.annotation.Bean; @@ -36,7 +36,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link BeanCurrentlyInCreationFailureAnalyzer}.

2
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/BeanNotOfRequiredTypeFailureAnalyzerTests.java

@ -29,7 +29,7 @@ import org.springframework.scheduling.annotation.Async; @@ -29,7 +29,7 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
/**
* Tests for {@link BeanNotOfRequiredTypeFailureAnalyzer}.

2
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/util/LambdaSafeTests.java

@ -29,7 +29,7 @@ import org.springframework.boot.util.LambdaSafe.InvocationResult; @@ -29,7 +29,7 @@ import org.springframework.boot.util.LambdaSafe.InvocationResult;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.contains;
import static org.mockito.BDDMockito.given;

2
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java

@ -160,7 +160,7 @@ import static org.assertj.core.api.Assertions.assertThatIOException; @@ -160,7 +160,7 @@ import static org.assertj.core.api.Assertions.assertThatIOException;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;
import static org.mockito.BDDMockito.then;

2
src/checkstyle/checkstyle.xml

@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineJavaCheck">
<property name="maximum" value="0"/>
<property name="format" value="org\.junit\.Assert\.assert" />
<property name="format" value="org\.junit\.Assert|org\.junit\.jupiter\.api\.Assertions" />
<property name="message"
value="Please use AssertJ imports." />
<property name="ignoreComments" value="true" />

Loading…
Cancel
Save