@Override public void evaluate() throws Throwable { try { base.evaluate(); } finally { Toothpick.reset(); } } }
@After public void tearDown() throws Exception { Toothpick.reset(); } }
@After public void tearDown() throws Exception { //needs to be performed after test execution //not before as rule are initialized before @Before Toothpick.reset(); }
@After public void tearDown() throws Exception { //needs to be performed after test execution //not before as rule are initialized before @Before Toothpick.reset(); }
@After public void tearDown() throws Exception { //needs to be performed after test execution //not before as rule are initialized before @Before Toothpick.reset(); }
@After public void tearDown() throws Exception { Toothpick.reset(); }
@After public void tearDown() throws Exception { Toothpick.reset(); } }
@After public void tearDown() throws Exception { //needs to be performed after test execution //not before as rule are initialized before @Before Toothpick.reset(); }
@After public void tearDown() throws Exception { //needs to be performed after test execution //not before as rule are initialized before @Before Toothpick.reset(); }
@After public void tearDown() throws Exception { Toothpick.reset(); }
@AfterClass public static void tearDown() throws Exception { //needs to be performed after test execution //not before as rule are initialized before @Before Toothpick.reset(); }
@After public void tearDown() throws Exception { Toothpick.reset(); }
@After public void tearDown() throws Exception { Toothpick.reset(); }
@After public void tearDown() throws Exception { Toothpick.reset(); }
@After public void tearDown() throws Exception { Toothpick.reset(); }
@Test public void reset_shouldCallResetForProvidedScope() throws Exception { // GIVEN ScopeNode mockScope = createMock(ScopeNode.class); mockScope.reset(); replay(mockScope); // WHEN Toothpick.reset(mockScope); // THEN verify(mockScope); }
@After public void tearDown() throws Exception { Toothpick.reset(); FactoryRegistryLocator.setRootRegistry(null); MemberInjectorRegistryLocator.setRootRegistry(null); ThreadTestUtil.shutdown(); }
@Test public void reset_shouldClear_WhenSomeScopesWereCreated() throws Exception { //GIVEN Toothpick.setConfiguration(Configuration.forProduction()); Scope scope0 = Toothpick.openScope("foo"); Scope scope1 = Toothpick.openScope("bar"); //WHEN Toothpick.reset(); Scope scope0AfterReset = Toothpick.openScope("foo"); Scope scope1AfterReset = Toothpick.openScope("bar"); //THEN assertThat(scope0AfterReset, not(sameInstance(scope0))); assertThat(scope1AfterReset, not(sameInstance(scope1))); }
@After public void tearDown() { Toothpick.reset(appScope); application.initToothpick(appScope); }