Skip to content

Commit b20b741

Browse files
committed
Make methods of TestContext non-final
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
1 parent 38ad39f commit b20b741

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-test/src/main/java/org/springframework/test/context/TestContext.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
import org.apache.commons.logging.Log;
2222
import org.apache.commons.logging.LogFactory;
23-
2423
import org.springframework.context.ApplicationContext;
2524
import org.springframework.core.AttributeAccessorSupport;
2625
import org.springframework.core.style.ToStringCreator;
26+
import org.springframework.test.annotation.DirtiesContext;
2727
import org.springframework.test.annotation.DirtiesContext.HierarchyMode;
2828
import org.springframework.util.Assert;
2929

@@ -126,7 +126,7 @@ public ApplicationContext getApplicationContext() {
126126
* Get the {@link Class test class} for this test context.
127127
* @return the test class (never {@code null})
128128
*/
129-
public final Class<?> getTestClass() {
129+
public Class<?> getTestClass() {
130130
return testClass;
131131
}
132132

@@ -136,7 +136,7 @@ public final Class<?> getTestClass() {
136136
* @return the current test instance (may be {@code null})
137137
* @see #updateState(Object, Method, Throwable)
138138
*/
139-
public final Object getTestInstance() {
139+
public Object getTestInstance() {
140140
return testInstance;
141141
}
142142

@@ -146,7 +146,7 @@ public final Object getTestInstance() {
146146
* @return the current test method (may be {@code null})
147147
* @see #updateState(Object, Method, Throwable)
148148
*/
149-
public final Method getTestMethod() {
149+
public Method getTestMethod() {
150150
return testMethod;
151151
}
152152

@@ -158,7 +158,7 @@ public final Method getTestMethod() {
158158
* exception was thrown
159159
* @see #updateState(Object, Method, Throwable)
160160
*/
161-
public final Throwable getTestException() {
161+
public Throwable getTestException() {
162162
return testException;
163163
}
164164

0 commit comments

Comments
 (0)