diff --git a/spring-test/src/main/java/org/springframework/test/context/NestedTestConfiguration.java b/spring-test/src/main/java/org/springframework/test/context/NestedTestConfiguration.java index d7102667e0..9b716cc7f4 100644 --- a/spring-test/src/main/java/org/springframework/test/context/NestedTestConfiguration.java +++ b/spring-test/src/main/java/org/springframework/test/context/NestedTestConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 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. @@ -82,6 +82,9 @@ import org.springframework.lang.Nullable; *
  • {@link ActiveProfiles @ActiveProfiles}
  • *
  • {@link TestPropertySource @TestPropertySource}
  • *
  • {@link DynamicPropertySource @DynamicPropertySource}
  • + *
  • {@link org.springframework.test.context.bean.override.convention.TestBean @TestBean}
  • + *
  • {@link org.springframework.test.context.bean.override.mockito.MockitoBean @MockitoBean}
  • + *
  • {@link org.springframework.test.context.bean.override.mockito.MockitoSpyBean @MockitoSpyBean}
  • *
  • {@link org.springframework.test.annotation.DirtiesContext @DirtiesContext}
  • *
  • {@link org.springframework.transaction.annotation.Transactional @Transactional}
  • *
  • {@link org.springframework.test.annotation.Rollback @Rollback}
  • diff --git a/spring-test/src/main/java/org/springframework/test/context/bean/override/convention/TestBean.java b/spring-test/src/main/java/org/springframework/test/context/bean/override/convention/TestBean.java index f6a63ed457..9393a17ed0 100644 --- a/spring-test/src/main/java/org/springframework/test/context/bean/override/convention/TestBean.java +++ b/spring-test/src/main/java/org/springframework/test/context/bean/override/convention/TestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 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. @@ -110,6 +110,10 @@ import org.springframework.test.context.bean.override.BeanOverride; * {@code protected}, package-private (default visibility), or {@code private} * depending on the needs or coding practices of the project. * + *

    {@code @TestBean} fields will be inherited from an enclosing test class by default. See + * {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration} + * for details. + * * @author Simon Baslé * @author Stephane Nicoll * @author Sam Brannen diff --git a/spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoBean.java b/spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoBean.java index f01d0fc10b..640a75bb22 100644 --- a/spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoBean.java +++ b/spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoBean.java @@ -63,6 +63,10 @@ import org.springframework.test.context.bean.override.BeanOverride; * (default visibility), or {@code private} depending on the needs or coding * practices of the project. * + *

    {@code @MockitoBean} fields will be inherited from an enclosing test class by default. + * See {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration} + * for details. + * * @author Simon Baslé * @author Sam Brannen * @since 6.2 diff --git a/spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoSpyBean.java b/spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoSpyBean.java index 6320a54845..d10674b753 100644 --- a/spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoSpyBean.java +++ b/spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoSpyBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 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. @@ -56,6 +56,10 @@ import org.springframework.test.context.bean.override.BeanOverride; * (default visibility), or {@code private} depending on the needs or coding * practices of the project. * + *

    {@code @MockitoSpyBean} fields will be inherited from an enclosing test class by default. + * See {@link org.springframework.test.context.NestedTestConfiguration @NestedTestConfiguration} + * for details. + * * @author Simon Baslé * @author Sam Brannen * @since 6.2