From b20b7415d88604fc0ca9bb1a22c69e3c788c0842 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 11 Dec 2013 01:23:03 +0100 Subject: [PATCH] Make methods of TestContext non-final MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit makes several methods of TestContext non-final in order to allow TestContext to be mocked — for example with Mockito. Note, however, that TestContext has been converted to an interface in Spring Framework 4.0. Issue: SPR-11144 --- .../org/springframework/test/context/TestContext.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 63d1de2863..0863cc48d6 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 @@ -20,10 +20,10 @@ import java.lang.reflect.Method; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - import org.springframework.context.ApplicationContext; import org.springframework.core.AttributeAccessorSupport; import org.springframework.core.style.ToStringCreator; +import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext.HierarchyMode; import org.springframework.util.Assert; @@ -126,7 +126,7 @@ public class TestContext extends AttributeAccessorSupport { * Get the {@link Class test class} for this test context. * @return the test class (never {@code null}) */ - public final Class getTestClass() { + public Class getTestClass() { return testClass; } @@ -136,7 +136,7 @@ public class TestContext extends AttributeAccessorSupport { * @return the current test instance (may be {@code null}) * @see #updateState(Object, Method, Throwable) */ - public final Object getTestInstance() { + public Object getTestInstance() { return testInstance; } @@ -146,7 +146,7 @@ public class TestContext extends AttributeAccessorSupport { * @return the current test method (may be {@code null}) * @see #updateState(Object, Method, Throwable) */ - public final Method getTestMethod() { + public Method getTestMethod() { return testMethod; } @@ -158,7 +158,7 @@ public class TestContext extends AttributeAccessorSupport { * exception was thrown * @see #updateState(Object, Method, Throwable) */ - public final Throwable getTestException() { + public Throwable getTestException() { return testException; }