Merge branch '5.3.x'
# Conflicts: # spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java # spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java # spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java # spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java # spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ViewResolutionIntegrationTests.java
This commit is contained in:
@@ -52,7 +52,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
import static java.lang.annotation.ElementType.METHOD;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.assertj.core.api.Assertions.assertThatRuntimeException;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.never;
|
||||
import static org.mockito.Mockito.only;
|
||||
@@ -130,9 +130,9 @@ public class EventPublishingTestExecutionListenerIntegrationTests {
|
||||
@Test
|
||||
public void beforeTestMethodAnnotationWithFailingEventListener() throws Exception {
|
||||
Method method = ReflectionUtils.findMethod(ExampleTestCase.class, "testWithFailingEventListener");
|
||||
assertThatExceptionOfType(RuntimeException.class).isThrownBy(() ->
|
||||
testContextManager.beforeTestMethod(testInstance, method))
|
||||
.withMessageContaining("Boom!");
|
||||
assertThatRuntimeException()
|
||||
.isThrownBy(() -> testContextManager.beforeTestMethod(testInstance, method))
|
||||
.withMessageContaining("Boom!");
|
||||
verify(listener, only()).beforeTestMethod(testContext);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,7 +26,7 @@ import org.springframework.test.annotation.Timed;
|
||||
import org.springframework.test.context.TestContextManager;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.assertj.core.api.Assertions.assertThatException;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link SpringJUnit4ClassRunner}.
|
||||
@@ -53,8 +53,7 @@ public class SpringJUnit4ClassRunnerTests {
|
||||
};
|
||||
}
|
||||
};
|
||||
assertThatExceptionOfType(Exception.class).isThrownBy(
|
||||
runner::createTest);
|
||||
assertThatException().isThrownBy(runner::createTest);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user