### Question:
HiveZKQuorumConfigAction extends AbstractUpgradeServerAction { @Override public CommandReport execute(ConcurrentMap<String, Object> requestSharedDataContext) throws AmbariException, InterruptedException { String clusterName = getExecutionCommand().getClusterName(); Cluster cluster = getClusters().getCluster(clusterName); Config hiveSite = cluster.getDesiredConfigByType(HIVE_SITE_CONFIG_TYPE); if (hiveSite == null) { return createCommandReport(0, HostRoleStatus.COMPLETED, "{}", String.format( "The %s configuration type was not found; unable to set Hive configuration properties", HIVE_SITE_CONFIG_TYPE), ""); } String zookeeperQuorum = ZooKeeperQuorumCalculator.getZooKeeperQuorumString(cluster); Map<String, String> hiveSiteProperties = hiveSite.getProperties(); hiveSiteProperties.put(HIVE_SITE_ZK_QUORUM, zookeeperQuorum); hiveSiteProperties.put(HIVE_SITE_ZK_CONNECT_STRING, zookeeperQuorum); hiveSite.setProperties(hiveSiteProperties); hiveSite.save(); agentConfigsHolder.updateData(cluster.getClusterId(), cluster.getHosts().stream().map(Host::getHostId).collect(Collectors.toList())); return createCommandReport(0, HostRoleStatus.COMPLETED, "{}", String.format("Successfully set %s and %s in %s", HIVE_SITE_ZK_QUORUM, HIVE_SITE_ZK_CONNECT_STRING, HIVE_SITE_CONFIG_TYPE), ""); }  @Override CommandReport execute(ConcurrentMap<String, Object> requestSharedDataContext);  }### Answer:
@Test public void testZKQuorumPropertiesSetCorrectly() throws Exception { final String zookeeperQuorum = "c6401.ambari.apache.org:2181,c6402.ambari.apache.org:2181"; PowerMockito.mockStatic(ZooKeeperQuorumCalculator.class); PowerMockito.when(ZooKeeperQuorumCalculator.getZooKeeperQuorumString(m_cluster)).thenReturn( zookeeperQuorum); Map<String, String> hiveSiteProperties = new HashMap<>(); EasyMock.expect(m_hiveSiteConfig.getProperties()).andReturn(hiveSiteProperties).atLeastOnce(); m_hiveSiteConfig.setProperties(EasyMock.anyObject()); EasyMock.expectLastCall().once(); m_hiveSiteConfig.save(); EasyMock.expectLastCall().once(); EasyMock.expect(m_cluster.getDesiredConfigByType(HiveZKQuorumConfigAction.HIVE_SITE_CONFIG_TYPE)).andReturn(m_hiveSiteConfig).atLeastOnce(); EasyMock.expect(m_cluster.getClusterId()).andReturn(1L).atLeastOnce(); EasyMock.expect(m_cluster.getHosts()).andReturn(Collections.emptyList()).atLeastOnce(); agentConfigsHolder.updateData(EasyMock.eq(1L), EasyMock.eq(Collections.emptyList())); EasyMock.expectLastCall().atLeastOnce(); EasyMock.replay(m_executionCommand, m_clusters, m_cluster, m_hiveSiteConfig, agentConfigsHolder); m_action.execute(null); EasyMock.verify(m_executionCommand, m_clusters, m_cluster, m_hiveSiteConfig, agentConfigsHolder); Assert.assertEquals(zookeeperQuorum, hiveSiteProperties.get(HiveZKQuorumConfigAction.HIVE_SITE_ZK_QUORUM)); Assert.assertEquals(zookeeperQuorum, hiveSiteProperties.get(HiveZKQuorumConfigAction.HIVE_SITE_ZK_CONNECT_STRING)); }