Merge branch '3.3.x'

Closes gh-41858
This commit is contained in:
Moritz Halbritter
2024-08-14 17:20:59 +02:00
98 changed files with 141 additions and 44 deletions

View File

@@ -23,6 +23,7 @@ import org.springframework.util.ObjectUtils;
*
* @author Phillip Webb
* @see DefinitionsParser
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -41,6 +41,7 @@ import org.springframework.util.StringUtils;
*
* @author Phillip Webb
* @author Stephane Nicoll
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -37,6 +37,7 @@ import static org.mockito.Mockito.mock;
* A complete definition that can be used to create a Mockito mock.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -28,6 +28,7 @@ import org.springframework.test.context.MergedContextConfiguration;
* A {@link ContextCustomizer} to add Mockito support.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -27,6 +27,7 @@ import org.springframework.test.context.TestContextAnnotationUtils;
* A {@link ContextCustomizerFactory} to add Mockito support.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import org.springframework.core.annotation.MergedAnnotations;
* @author Phillip Webb
* @author Stephane Nicoll
* @see Definition
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -37,6 +37,7 @@ import static org.mockito.Mockito.mock;
* A complete definition that can be used to create a Mockito spy.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito;
* Concrete implementation of {@link AbstractMockBeanOnGenericTests}.
*
* @author Madhura Bhave
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -31,6 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @param <T> type of thing
* @param <U> type of something
* @author Madhura Bhave
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -36,6 +36,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* Tests for {@link DefinitionsParser}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -42,6 +42,7 @@ import static org.mockito.Mockito.mock;
* Tests for application context caching when using {@link MockBean @MockBean}.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.Mockito.mock;
* Test {@link MockBean @MockBean} for a factory bean.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -35,6 +35,7 @@ import static org.mockito.BDDMockito.given;
* existing beans.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.given;
* instances.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@ExtendWith(SpringExtension.class)

View File

@@ -35,6 +35,7 @@ import static org.mockito.BDDMockito.given;
* used to replace existing beans.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@ExtendWith(SpringExtension.class)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.given;
* used to inject new mock instances.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@ExtendWith(SpringExtension.class)

View File

@@ -20,10 +20,6 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBeanOnContextHierarchyIntegrationTests.ChildConfig;
import org.springframework.boot.test.mock.mockito.MockBeanOnContextHierarchyIntegrationTests.ParentConfig;
import org.springframework.boot.test.mock.mockito.example.ExampleService;
import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
@@ -38,12 +34,13 @@ import static org.assertj.core.api.Assertions.assertThat;
* {@link ContextHierarchy @ContextHierarchy}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)
@ExtendWith(SpringExtension.class)
@ContextHierarchy({ @ContextConfiguration(classes = ParentConfig.class),
@ContextConfiguration(classes = ChildConfig.class) })
@ContextHierarchy({ @ContextConfiguration(classes = MockBeanOnContextHierarchyIntegrationTests.ParentConfig.class),
@ContextConfiguration(classes = MockBeanOnContextHierarchyIntegrationTests.ChildConfig.class) })
class MockBeanOnContextHierarchyIntegrationTests {
@Autowired
@@ -53,22 +50,30 @@ class MockBeanOnContextHierarchyIntegrationTests {
void testMocking() {
ApplicationContext context = this.childConfig.getContext();
ApplicationContext parentContext = context.getParent();
assertThat(parentContext.getBeanNamesForType(ExampleService.class)).hasSize(1);
assertThat(parentContext.getBeanNamesForType(ExampleServiceCaller.class)).isEmpty();
assertThat(context.getBeanNamesForType(ExampleService.class)).isEmpty();
assertThat(context.getBeanNamesForType(ExampleServiceCaller.class)).hasSize(1);
assertThat(context.getBean(ExampleService.class)).isNotNull();
assertThat(context.getBean(ExampleServiceCaller.class)).isNotNull();
assertThat(parentContext
.getBeanNamesForType(org.springframework.boot.test.mock.mockito.example.ExampleService.class)).hasSize(1);
assertThat(parentContext
.getBeanNamesForType(org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller.class))
.isEmpty();
assertThat(context.getBeanNamesForType(org.springframework.boot.test.mock.mockito.example.ExampleService.class))
.isEmpty();
assertThat(context
.getBeanNamesForType(org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller.class))
.hasSize(1);
assertThat(context.getBean(org.springframework.boot.test.mock.mockito.example.ExampleService.class))
.isNotNull();
assertThat(context.getBean(org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller.class))
.isNotNull();
}
@Configuration(proxyBeanMethods = false)
@MockBean(ExampleService.class)
@MockBean(org.springframework.boot.test.mock.mockito.example.ExampleService.class)
static class ParentConfig {
}
@Configuration(proxyBeanMethods = false)
@MockBean(ExampleServiceCaller.class)
@MockBean(org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller.class)
static class ChildConfig implements ApplicationContextAware {
private ApplicationContext context;

View File

@@ -38,6 +38,7 @@ import static org.mockito.BDDMockito.given;
*
* @author Phillip Webb
* @see <a href="https://github.com/spring-projects/spring-boot/issues/5724">gh-5724</a>
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.given;
* Test {@link MockBean @MockBean} on a test class can be used to replace existing beans.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.given;
* instances.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -36,6 +36,7 @@ import static org.mockito.BDDMockito.given;
*
* @author Phillip Webb
* @see MockBeanOnTestFieldForExistingBeanIntegrationTests
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -27,6 +27,7 @@ import org.springframework.context.annotation.Import;
* config to trigger caching.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.given;
*
* @author Phillip Webb
* @see MockBeanOnTestFieldForExistingBeanCacheIntegrationTests
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -39,6 +39,7 @@ import static org.mockito.BDDMockito.then;
*
* @author Stephane Nicoll
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.given;
* instances.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -45,6 +45,7 @@ import static org.mockito.Mockito.times;
*
* @author Phillip Webb
* @see <a href="https://github.com/spring-projects/spring-boot/issues/5837">5837</a>
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -33,6 +33,7 @@ import static org.mockito.BDDMockito.given;
* Tests for a mock bean where the mocked interface has an async method.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -36,6 +36,7 @@ import static org.mockito.BDDMockito.given;
* {@link DirtiesContext @DirtiesContext} and {@link ClassMode#BEFORE_EACH_TEST_METHOD}.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.given;
* instances.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -31,6 +31,7 @@ import static org.mockito.BDDMockito.given;
* Tests for a mock bean where the class being mocked uses field injection.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -30,6 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Andy Wilkinson
* @see <a href="https://github.com/spring-projects/spring-boot/issues/27693">gh-27693</a>
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -33,6 +33,7 @@ import static org.mockito.Mockito.mock;
* Tests for {@link MockDefinition}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -28,6 +28,7 @@ import static org.mockito.Mockito.withSettings;
* Tests for {@link MockReset}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -26,6 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Tests for {@link MockitoContextCustomizerFactory}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Tests for {@link MockitoContextCustomizer}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -50,6 +50,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Andy Wilkinson
* @author Andreas Neiser
* @author Madhura Bhave
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -49,6 +49,7 @@ import static org.mockito.BDDMockito.given;
* Integration tests for {@link MockitoTestExecutionListener}.
*
* @author Moritz Halbritter
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -41,6 +41,7 @@ import static org.mockito.Mockito.mock;
* Tests for {@link MockitoTestExecutionListener}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -40,6 +40,7 @@ import static org.mockito.BDDMockito.then;
* Tests for {@link QualifierDefinition}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -39,6 +39,7 @@ import static org.mockito.Mockito.mock;
*
* @author Phillip Webb
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -25,6 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Integration tests for {@link SpringBootMockResolver}.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -29,6 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Tests for {@link SpringBootMockResolver}.
*
* @author Moritz Halbritter
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.then;
* beans.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.then;
* instances.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -35,6 +35,7 @@ import static org.mockito.BDDMockito.then;
* to replace existing beans.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.then;
* to inject new spy instances.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -20,11 +20,6 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.SpyBeanOnContextHierarchyIntegrationTests.ChildConfig;
import org.springframework.boot.test.mock.mockito.SpyBeanOnContextHierarchyIntegrationTests.ParentConfig;
import org.springframework.boot.test.mock.mockito.example.ExampleService;
import org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller;
import org.springframework.boot.test.mock.mockito.example.SimpleExampleService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Configuration;
@@ -39,12 +34,13 @@ import static org.assertj.core.api.Assertions.assertThat;
* {@link ContextHierarchy @ContextHierarchy}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)
@ExtendWith(SpringExtension.class)
@ContextHierarchy({ @ContextConfiguration(classes = ParentConfig.class),
@ContextConfiguration(classes = ChildConfig.class) })
@ContextHierarchy({ @ContextConfiguration(classes = SpyBeanOnContextHierarchyIntegrationTests.ParentConfig.class),
@ContextConfiguration(classes = SpyBeanOnContextHierarchyIntegrationTests.ChildConfig.class) })
class SpyBeanOnContextHierarchyIntegrationTests {
@Autowired
@@ -54,22 +50,30 @@ class SpyBeanOnContextHierarchyIntegrationTests {
void testSpying() {
ApplicationContext context = this.childConfig.getContext();
ApplicationContext parentContext = context.getParent();
assertThat(parentContext.getBeanNamesForType(ExampleService.class)).hasSize(1);
assertThat(parentContext.getBeanNamesForType(ExampleServiceCaller.class)).isEmpty();
assertThat(context.getBeanNamesForType(ExampleService.class)).isEmpty();
assertThat(context.getBeanNamesForType(ExampleServiceCaller.class)).hasSize(1);
assertThat(context.getBean(ExampleService.class)).isNotNull();
assertThat(context.getBean(ExampleServiceCaller.class)).isNotNull();
assertThat(parentContext
.getBeanNamesForType(org.springframework.boot.test.mock.mockito.example.ExampleService.class)).hasSize(1);
assertThat(parentContext
.getBeanNamesForType(org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller.class))
.isEmpty();
assertThat(context.getBeanNamesForType(org.springframework.boot.test.mock.mockito.example.ExampleService.class))
.isEmpty();
assertThat(context
.getBeanNamesForType(org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller.class))
.hasSize(1);
assertThat(context.getBean(org.springframework.boot.test.mock.mockito.example.ExampleService.class))
.isNotNull();
assertThat(context.getBean(org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller.class))
.isNotNull();
}
@Configuration(proxyBeanMethods = false)
@SpyBean(SimpleExampleService.class)
@SpyBean(org.springframework.boot.test.mock.mockito.example.SimpleExampleService.class)
static class ParentConfig {
}
@Configuration(proxyBeanMethods = false)
@SpyBean(ExampleServiceCaller.class)
@SpyBean(org.springframework.boot.test.mock.mockito.example.ExampleServiceCaller.class)
static class ChildConfig implements ApplicationContextAware {
private ApplicationContext context;

View File

@@ -33,6 +33,7 @@ import static org.mockito.BDDMockito.then;
* Test {@link SpyBean @SpyBean} on a test class can be used to replace existing beans.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -33,6 +33,7 @@ import static org.mockito.BDDMockito.then;
* Test {@link SpyBean @SpyBean} on a test class can be used to inject new spy instances.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -36,6 +36,7 @@ import static org.mockito.BDDMockito.then;
*
* @author Phillip Webb
* @see SpyBeanOnTestFieldForExistingBeanIntegrationTests
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -27,6 +27,7 @@ import org.springframework.context.annotation.Import;
* config to trigger caching.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.then;
*
* @author Phillip Webb
* @see SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -38,6 +38,7 @@ import static org.mockito.BDDMockito.then;
* bean while preserving qualifiers.
*
* @author Andreas Neiser
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -20,7 +20,6 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.SpyBeanOnTestFieldForExistingCircularBeansConfig;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
@@ -32,11 +31,13 @@ import static org.mockito.BDDMockito.then;
* beans with circular dependencies.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)
@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = SpyBeanOnTestFieldForExistingCircularBeansConfig.class)
@ContextConfiguration(
classes = SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests.SpyBeanOnTestFieldForExistingCircularBeansConfig.class)
class SpyBeanOnTestFieldForExistingCircularBeansIntegrationTests {
@SpyBean

View File

@@ -38,6 +38,7 @@ import static org.mockito.BDDMockito.then;
*
* @author Phillip Webb
* @see SpyBeanOnTestFieldForExistingBeanCacheIntegrationTests
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -39,6 +39,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* bean with generics that's produced by a factory bean.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -37,6 +37,7 @@ import static org.mockito.BDDMockito.then;
* instance when there are multiple candidates and one is primary.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.then;
* instances.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -43,6 +43,7 @@ import static org.mockito.Mockito.reset;
*
* @author Phillip Webb
* @see <a href="https://github.com/spring-projects/spring-boot/issues/5837">5837</a>
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -43,6 +43,7 @@ import static org.mockito.BDDMockito.then;
*
* @author Phillip Webb
* @see <a href="https://github.com/spring-projects/spring-boot/issues/5837">5837</a>
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -35,6 +35,7 @@ import static org.mockito.BDDMockito.then;
* {@link DirtiesContext @DirtiesContext} and {@link ClassMode#BEFORE_EACH_TEST_METHOD}.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.BDDMockito.then;
* Tests for {@link SpyBean @SpyBean} with a JDK proxy.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*
* @author Phillip Webb
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -34,6 +34,7 @@ import static org.mockito.Mockito.mock;
* Tests for {@link SpyDefinition}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
* Custom qualifier for testing.
*
* @author Stephane Nicoll
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@Deprecated(since = "3.4.0", forRemoval = true)
@Qualifier

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito.example;
* An {@link ExampleService} that uses a custom qualifier.
*
* @author Andy Wilkinson
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito.example;
* Example extra interface for mocking tests.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@Deprecated(since = "3.4.0", forRemoval = true)
public interface ExampleExtraInterface {

View File

@@ -21,6 +21,7 @@ package org.springframework.boot.test.mock.mockito.example;
*
* @param <T> the generic type
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@Deprecated(since = "3.4.0", forRemoval = true)
public interface ExampleGenericService<T> {

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito.example;
* Example bean for mocking tests that calls {@link ExampleGenericService}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito.example;
* Example bean for mocking tests that calls {@link ExampleGenericService}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito.example;
* Example service interface for mocking tests.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@Deprecated(since = "3.4.0", forRemoval = true)
public interface ExampleService {

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito.example;
* Example bean for mocking tests that calls {@link ExampleService}.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
* An {@link ExampleService} that always throws an exception.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito.example;
* Example service implementation for spy tests.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito.example;
* Example generic service implementation for spy tests.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito.example;
* Example service implementation for spy tests.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)

View File

@@ -20,6 +20,7 @@ package org.springframework.boot.test.mock.mockito.example;
* Example generic service implementation for spy tests.
*
* @author Phillip Webb
* @deprecated since 3.4.0 for removal in 3.6.0
*/
@SuppressWarnings("removal")
@Deprecated(since = "3.4.0", forRemoval = true)