### Question:
AmbariCustomCommandExecutionHelper { public boolean isTopologyRefreshRequired(String actionName, String clusterName, String serviceName) throws AmbariException { if (actionName.equals(START_COMMAND_NAME) || actionName.equals(RESTART_COMMAND_NAME)) { Cluster cluster = clusters.getCluster(clusterName); StackId stackId = null; if (serviceName != null) { try { Service service = cluster.getService(serviceName); stackId = service.getDesiredStackId(); } catch (AmbariException e) { LOG.debug("Could not load service {}, skipping topology check", serviceName); } } if (stackId == null) { stackId = cluster.getDesiredStackVersion(); } AmbariMetaInfo ambariMetaInfo = managementController.getAmbariMetaInfo(); StackInfo stack = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion()); if (stack != null) { ServiceInfo serviceInfo = stack.getService(serviceName); if (serviceInfo != null) { Boolean restartRequiredAfterRackChange = serviceInfo.isRestartRequiredAfterRackChange(); if (restartRequiredAfterRackChange != null && restartRequiredAfterRackChange) { return true; } } } } return false; }  void addServiceCheckAction(Stage stage, String hostname, String smokeTestRole,
      long nowTimestamp, String serviceName, String componentName,
      Map<String, String> actionParameters, boolean retryAllowed, boolean autoSkipFailure, boolean useLatestConfigs); void validateAction(ExecuteActionRequest actionRequest); void addExecutionCommandsToStage(ActionExecutionContext actionExecutionContext,
      Stage stage, Map<String, String> requestParams, ExecuteCommandJson executeCommandJson); ExecuteCommandJson getCommandJson(ActionExecutionContext actionExecContext,
      Cluster cluster, StackId stackId, String requestContext); boolean isTopologyRefreshRequired(String actionName, String clusterName, String serviceName); String getStatusCommandTimeout(ServiceInfo serviceInfo); static final Map<String, String> masterToSlaveMappingForDecom; final static String DECOM_INCLUDED_HOSTS; final static String DECOM_EXCLUDED_HOSTS; final static String ALL_DECOMMISSIONED_HOSTS; final static String DECOM_SLAVE_COMPONENT; final static String HBASE_MARK_DRAINING_ONLY; final static String UPDATE_FILES_ONLY; final static String IS_ADD_OR_DELETE_SLAVE_REQUEST; final static int MIN_STRICT_SERVICE_CHECK_TIMEOUT; static final String DECOMMISSION_COMMAND_NAME; }### Answer:
@Test public void testIsTopologyRefreshRequired() throws Exception { AmbariCustomCommandExecutionHelper helper = injector.getInstance(AmbariCustomCommandExecutionHelper.class); EasyMock.expect(configHelper.getHostActualConfigs(EasyMock.anyLong())).andReturn( new AgentConfigsUpdateEvent(null, new TreeMap<>())).anyTimes(); EasyMock.replay(configHelper); createClusterFixture("c2", new StackId("HDP-2.1.1"), "2.1.1.0-1234", "c2"); EasyMock.verify(configHelper); Assert.assertTrue(helper.isTopologyRefreshRequired("START", "c2", "HDFS")); Assert.assertTrue(helper.isTopologyRefreshRequired("RESTART", "c2", "HDFS")); Assert.assertFalse(helper.isTopologyRefreshRequired("STOP", "c2", "HDFS")); }