@Test
  public void testExecuteAddNewConfiguration() throws Exception {
    // mock two different answers
    expect(m_mockCluster.getDesiredConfigByType(FOO_SITE)).andReturn(null).once();
    expect(m_mockCluster.getDesiredConfigByType(FOO_SITE)).andReturn(m_mockConfig).once();

    m_mockConfigHelper.createConfigType(eq(m_mockCluster), eq(m_stackId), eq(m_mockController),
        eq(FOO_SITE), eq(new HashMap<>()), eq(AUTH_USERNAME), eq("Upgrade to 1.0.0.0-b1"));

    expectLastCall();

    Map<String, String> configUpdates = new HashMap<>();
    configUpdates.put("property-name", "property-value");

    m_mockConfig.updateProperties(configUpdates);
    expectLastCall().once();

    m_mockConfig.save();
    expectLastCall().once();

    PowerMock.replay(m_action);
    replayAll();

    m_action.execute(null);

    // easymock verify
    verifyAll();
  }
Tests that when a new configuration type is specified in the list of
configurattion changes, that the new type is created first.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/PluginUpgradeServerActionTest.java