diff --git a/spring-test/src/main/java/org/springframework/test/context/cache/ContextCache.java b/spring-test/src/main/java/org/springframework/test/context/cache/ContextCache.java index 66528de3ead..260e8b60b17 100644 --- a/spring-test/src/main/java/org/springframework/test/context/cache/ContextCache.java +++ b/spring-test/src/main/java/org/springframework/test/context/cache/ContextCache.java @@ -116,7 +116,10 @@ public interface ContextCache { * @param context the {@code ApplicationContext}; never {@code null} * @see #get(MergedContextConfiguration) * @see #put(MergedContextConfiguration, LoadFunction) + * @deprecated since Spring Framework 7.0 in favor of + * {@link #put(MergedContextConfiguration, LoadFunction)} */ + @Deprecated(since = "7.0") void put(MergedContextConfiguration key, ApplicationContext context); /** diff --git a/spring-test/src/main/java/org/springframework/test/context/cache/DefaultContextCache.java b/spring-test/src/main/java/org/springframework/test/context/cache/DefaultContextCache.java index b00c261393b..3b102fa4e3d 100644 --- a/spring-test/src/main/java/org/springframework/test/context/cache/DefaultContextCache.java +++ b/spring-test/src/main/java/org/springframework/test/context/cache/DefaultContextCache.java @@ -154,6 +154,7 @@ public class DefaultContextCache implements ContextCache { } @Override + @Deprecated(since = "7.0") public void put(MergedContextConfiguration key, ApplicationContext context) { Assert.notNull(key, "Key must not be null"); Assert.notNull(context, "ApplicationContext must not be null"); diff --git a/spring-test/src/test/java/org/springframework/test/context/cache/LruContextCacheTests.java b/spring-test/src/test/java/org/springframework/test/context/cache/LruContextCacheTests.java index 8067565fb25..186addab6b5 100644 --- a/spring-test/src/test/java/org/springframework/test/context/cache/LruContextCacheTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/cache/LruContextCacheTests.java @@ -83,6 +83,7 @@ class LruContextCacheTests { @Nested + @SuppressWarnings("deprecation") class PutUnitTests { @Test