diff --git a/spring-test/src/main/java/org/springframework/test/context/CacheAwareContextLoaderDelegate.java b/spring-test/src/main/java/org/springframework/test/context/CacheAwareContextLoaderDelegate.java index af10f3890a..f5d548ad88 100644 --- a/spring-test/src/main/java/org/springframework/test/context/CacheAwareContextLoaderDelegate.java +++ b/spring-test/src/main/java/org/springframework/test/context/CacheAwareContextLoaderDelegate.java @@ -46,7 +46,7 @@ public interface CacheAwareContextLoaderDelegate { * {@link org.springframework.test.context.cache.ContextCache#logStatistics()}. * @param mergedContextConfiguration the merged context configuration to use * to load the application context; never {@code null} - * @return the application context + * @return the application context (never {@code null}) * @throws IllegalStateException if an error occurs while retrieving or loading * the application context */ diff --git a/spring-test/src/main/java/org/springframework/test/context/TestContext.java b/spring-test/src/main/java/org/springframework/test/context/TestContext.java index 5b3e0f345f..d4760c6c11 100644 --- a/spring-test/src/main/java/org/springframework/test/context/TestContext.java +++ b/spring-test/src/main/java/org/springframework/test/context/TestContext.java @@ -49,7 +49,7 @@ public interface TestContext extends AttributeAccessor, Serializable { *
Implementations of this method are responsible for loading the * application context if the corresponding context has not already been * loaded, potentially caching the context as well. - * @return the application context + * @return the application context (never {@code null}) * @throws IllegalStateException if an error occurs while retrieving the * application context */ @@ -72,7 +72,7 @@ public interface TestContext extends AttributeAccessor, Serializable { /** * Get the current {@linkplain Method test method} for this test context. *
Note: this is a mutable property. - * @return the current test method + * @return the current test method (may be {@code null}) * @see #updateState(Object, Method, Throwable) */ Method getTestMethod(); @@ -101,6 +101,8 @@ public interface TestContext extends AttributeAccessor, Serializable { /** * Update this test context to reflect the state of the currently executing test. + *
WARNING: this method should only be invoked by the + * {@link TestContextManager}. *
Caution: concurrent invocations of this method might not be thread-safe, * depending on the underlying implementation. * @param testInstance the current test instance (may be {@code null})