@Test
  public void testSuggestUpgradePack() throws Exception{
    final String clusterName = "c1";
    final StackId sourceStackId = new StackId("HDP", "2.1.1");
    final StackId targetStackId = new StackId("HDP", "2.2.0");
    final Direction upgradeDirection = Direction.UPGRADE;
    final UpgradeType upgradeType = UpgradeType.ROLLING;

    makeCluster();
    try {
      String preferredUpgradePackName = "upgrade_test";
      UpgradePack up = m_upgradeHelper.suggestUpgradePack(clusterName, sourceStackId, targetStackId, upgradeDirection, upgradeType, preferredUpgradePackName);
      assertEquals(upgradeType, up.getType());
    } catch (AmbariException e){
      assertTrue(false);
    }
  }
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