testExecutionListener.afterTestClass(getTestContext());
@Test public void beforeAndAfterTestClassForDirtiesContextDeclaredLocallyOnMethod() throws Exception { Class<?> clazz = getClass(); BDDMockito.<Class<?>> given(testContext.getTestClass()).willReturn(clazz); beforeListener.beforeTestClass(testContext); afterListener.beforeTestClass(testContext); afterListener.afterTestClass(testContext); beforeListener.afterTestClass(testContext); verify(testContext, times(0)).markApplicationContextDirty(any(HierarchyMode.class)); }
@Test public void beforeAndAfterTestClassForDirtiesContextDeclaredLocallyOnClassBeforeEachTestMethod() throws Exception { Class<?> clazz = DirtiesContextDeclaredLocallyBeforeEachTestMethod.class; BDDMockito.<Class<?>> given(testContext.getTestClass()).willReturn(clazz); beforeListener.beforeTestClass(testContext); afterListener.beforeTestClass(testContext); afterListener.afterTestClass(testContext); beforeListener.afterTestClass(testContext); verify(testContext, times(0)).markApplicationContextDirty(any(HierarchyMode.class)); }
@Test public void beforeAndAfterTestClassForDirtiesContextDeclaredViaMetaAnnotationOnClassAfterEachTestMethod() throws Exception { Class<?> clazz = DirtiesContextDeclaredViaMetaAnnotationAfterEachTestMethod.class; BDDMockito.<Class<?>> given(testContext.getTestClass()).willReturn(clazz); beforeListener.beforeTestClass(testContext); afterListener.beforeTestClass(testContext); afterListener.afterTestClass(testContext); beforeListener.afterTestClass(testContext); verify(testContext, times(0)).markApplicationContextDirty(any(HierarchyMode.class)); }
@Test public void beforeAndAfterTestClassForDirtiesContextDeclaredViaMetaAnnotationWithOverrides() throws Exception { Class<?> clazz = DirtiesContextViaMetaAnnotationWithOverrides.class; BDDMockito.<Class<?>> given(testContext.getTestClass()).willReturn(clazz); beforeListener.beforeTestClass(testContext); afterListener.beforeTestClass(testContext); afterListener.afterTestClass(testContext); beforeListener.afterTestClass(testContext); verify(testContext, times(0)).markApplicationContextDirty(any(HierarchyMode.class)); }
@Test public void beforeAndAfterTestClassForDirtiesContextDeclaredLocallyOnClassAfterEachTestMethod() throws Exception { Class<?> clazz = DirtiesContextDeclaredLocallyAfterEachTestMethod.class; BDDMockito.<Class<?>> given(testContext.getTestClass()).willReturn(clazz); beforeListener.beforeTestClass(testContext); afterListener.beforeTestClass(testContext); afterListener.afterTestClass(testContext); beforeListener.afterTestClass(testContext); verify(testContext, times(0)).markApplicationContextDirty(any(HierarchyMode.class)); }
@Test public void beforeAndAfterTestClassForDirtiesContextDeclaredLocallyOnClassBeforeClass() throws Exception { Class<?> clazz = DirtiesContextDeclaredLocallyBeforeClass.class; BDDMockito.<Class<?>> given(testContext.getTestClass()).willReturn(clazz); beforeListener.beforeTestClass(testContext); afterListener.beforeTestClass(testContext); verify(testContext, times(1)).markApplicationContextDirty(EXHAUSTIVE); afterListener.afterTestClass(testContext); beforeListener.afterTestClass(testContext); verify(testContext, times(1)).markApplicationContextDirty(EXHAUSTIVE); }
@Test public void beforeAndAfterTestClassForDirtiesContextDeclaredLocallyOnClassAfterClass() throws Exception { Class<?> clazz = DirtiesContextDeclaredLocallyAfterClass.class; BDDMockito.<Class<?>> given(testContext.getTestClass()).willReturn(clazz); beforeListener.beforeTestClass(testContext); afterListener.beforeTestClass(testContext); verify(testContext, times(0)).markApplicationContextDirty(any(HierarchyMode.class)); afterListener.afterTestClass(testContext); beforeListener.afterTestClass(testContext); verify(testContext, times(1)).markApplicationContextDirty(EXHAUSTIVE); }
@Test public void beforeAndAfterTestClassForDirtiesContextDeclaredViaMetaAnnotationOnClassAfterClass() throws Exception { Class<?> clazz = DirtiesContextDeclaredViaMetaAnnotationAfterClass.class; BDDMockito.<Class<?>> given(testContext.getTestClass()).willReturn(clazz); beforeListener.beforeTestClass(testContext); afterListener.beforeTestClass(testContext); verify(testContext, times(0)).markApplicationContextDirty(any(HierarchyMode.class)); afterListener.afterTestClass(testContext); beforeListener.afterTestClass(testContext); verify(testContext, times(1)).markApplicationContextDirty(EXHAUSTIVE); }
@Test public void beforeAndAfterTestClassForDirtiesContextDeclaredViaMetaAnnotationWithOverridenAttributes() throws Exception { Class<?> clazz = DirtiesContextViaMetaAnnotationWithOverridenAttributes.class; BDDMockito.<Class<?>> given(testContext.getTestClass()).willReturn(clazz); beforeListener.beforeTestClass(testContext); afterListener.beforeTestClass(testContext); verify(testContext, times(0)).markApplicationContextDirty(any(HierarchyMode.class)); afterListener.afterTestClass(testContext); beforeListener.afterTestClass(testContext); verify(testContext, times(1)).markApplicationContextDirty(EXHAUSTIVE); }
@Override public void afterTestClass(TestContext testContext) throws Exception { delegate.afterTestClass(testContext); } }
@Override public void afterTestClass(TestContext testContext) throws Exception { delegate.afterTestClass(testContext); } }
public void call(TestExecutionListener listener) throws Exception { listener.afterTestClass(testContext); } });
public void call(TestExecutionListener listener) throws Exception { listener.afterTestClass(testContext); } });
testExecutionListener.afterTestClass(getTestContext());
testExecutionListener.afterTestClass(getTestContext());