@After
  public void teardown() throws AmbariException, SQLException {
    try{
    H2DatabaseCleaner.clearDatabaseAndStopPersistenceService(injector);

    // Clear the authenticated user
    SecurityContextHolder.getContext().setAuthentication(null);

    if (stackManagerMock != null) {
      stackManagerMock.invalidateCurrentPaths();
    }
   }finally {
      EasyMock.reset(m_configHelper, m_masterHostResolver);
    }
  }
Because test cases need to share config mocks, put common ones in this function.
@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/stack/upgrade/orchestrate/UpgradeHelperTest.java