use of org.junit.jupiter.api.extension.TestExtensionContext in project spring-framework by spring-projects.
the class DisabledIfConditionTestCase method buildExtensionContext.
// -------------------------------------------------------------------------
private TestExtensionContext buildExtensionContext(String methodName) {
Class<?> testClass = SpringTestCase.class;
Method method = ReflectionUtils.findMethod(getClass(), methodName);
Store store = mock(Store.class);
when(store.getOrComputeIfAbsent(any(), any(), any())).thenReturn(new TestContextManager(testClass));
TestExtensionContext extensionContext = mock(TestExtensionContext.class);
when(extensionContext.getTestClass()).thenReturn(Optional.of(testClass));
when(extensionContext.getElement()).thenReturn(Optional.of(method));
when(extensionContext.getStore(any())).thenReturn(store);
return extensionContext;
}
Aggregations