### Question:
AssignableNode implements Comparable<AssignableNode> { public String getFaultZone() { return _faultZone; } AssignableNode(ClusterConfig clusterConfig, InstanceConfig instanceConfig, String instanceName); Set<String> getAssignedPartitionsByResource(String resource); int getAssignedTopStatePartitionsCount(); int getAssignedReplicaCount(); Map<String, Integer> getRemainingCapacity(); Map<String, Integer> getMaxCapacity(); float getProjectedHighestUtilization(Map<String, Integer> newUsage); String getInstanceName(); Set<String> getInstanceTags(); String getFaultZone(); boolean hasFaultZone(); Map<String, List<String>> getDisabledPartitionsMap(); int getMaxPartition(); @Override int hashCode(); @Override int compareTo(AssignableNode o); @Override String toString();  }### Answer:
@Test public void testParseFaultZoneNotFound() throws IOException { ResourceControllerDataProvider testCache = setupClusterDataCache(); ClusterConfig testClusterConfig = new ClusterConfig("testClusterConfigId"); testClusterConfig.setFaultZoneType("zone"); testClusterConfig.setTopologyAwareEnabled(true); testClusterConfig.setTopology("/zone/"); when(testCache.getClusterConfig()).thenReturn(testClusterConfig); InstanceConfig testInstanceConfig = new InstanceConfig("testInstanceConfigId"); testInstanceConfig.setDomain("instance=testInstance"); Map<String, InstanceConfig> instanceConfigMap = new HashMap<>(); instanceConfigMap.put(_testInstanceId, testInstanceConfig); when(testCache.getInstanceConfigMap()).thenReturn(instanceConfigMap); AssignableNode node = new AssignableNode(testCache.getClusterConfig(), testCache.getInstanceConfigMap().get(_testInstanceId), _testInstanceId); Assert.assertEquals(node.getFaultZone(), "Helix_default_zone"); }
@Test public void testParseFaultZone() throws IOException { ResourceControllerDataProvider testCache = setupClusterDataCache(); ClusterConfig testClusterConfig = new ClusterConfig("testClusterConfigId"); testClusterConfig.setFaultZoneType("zone"); testClusterConfig.setTopologyAwareEnabled(true); testClusterConfig.setTopology("/zone/instance"); when(testCache.getClusterConfig()).thenReturn(testClusterConfig); InstanceConfig testInstanceConfig = new InstanceConfig("testInstanceConfigId"); testInstanceConfig.setDomain("zone=2, instance=testInstance"); Map<String, InstanceConfig> instanceConfigMap = new HashMap<>(); instanceConfigMap.put(_testInstanceId, testInstanceConfig); when(testCache.getInstanceConfigMap()).thenReturn(instanceConfigMap); AssignableNode assignableNode = new AssignableNode(testCache.getClusterConfig(), testCache.getInstanceConfigMap().get(_testInstanceId), _testInstanceId); Assert.assertEquals(assignableNode.getFaultZone(), "2"); testClusterConfig = new ClusterConfig("testClusterConfigId"); testClusterConfig.setFaultZoneType("instance"); testClusterConfig.setTopologyAwareEnabled(true); testClusterConfig.setTopology("/zone/instance"); when(testCache.getClusterConfig()).thenReturn(testClusterConfig); testInstanceConfig = new InstanceConfig("testInstanceConfigId"); testInstanceConfig.setDomain("zone=2, instance=testInstance"); instanceConfigMap = new HashMap<>(); instanceConfigMap.put(_testInstanceId, testInstanceConfig); when(testCache.getInstanceConfigMap()).thenReturn(instanceConfigMap); assignableNode = new AssignableNode(testCache.getClusterConfig(), testCache.getInstanceConfigMap().get(_testInstanceId), _testInstanceId); Assert.assertEquals(assignableNode.getFaultZone(), "2/testInstance"); }