@Test
  public void getPartitionsTest() {
    assumeTrue(!overrideEnabled);

    // "good" cases for getPartitions() and getWritablePartitions() only
    // getPartitions(), class null
    List<? extends PartitionId> returnedPartitions = clusterManager.getAllPartitionIds(null);
    checkReturnedPartitions(returnedPartitions,
        Arrays.asList(defaultRw, defaultRo, defaultPrw, specialRw, specialRo, specialPrw, defaultRwForPrw));
    // getWritablePartitions(), class null
    returnedPartitions = clusterManager.getWritablePartitionIds(null);
    checkReturnedPartitions(returnedPartitions,
        Arrays.asList(defaultRw, specialRw, specialPrw, defaultPrw, defaultRwForPrw));
    // getFullyWritablePartitions(), class null
    returnedPartitions = clusterManager.getFullyWritablePartitionIds(null);
    checkReturnedPartitions(returnedPartitions, Arrays.asList(defaultRw, specialRw, defaultRwForPrw));

    // getPartitions(), class default
    returnedPartitions = clusterManager.getAllPartitionIds(DEFAULT_PARTITION_CLASS);
    checkReturnedPartitions(returnedPartitions, Arrays.asList(defaultRw, defaultRo, defaultPrw, defaultRwForPrw));
    // getWritablePartitions(), class default
    returnedPartitions = clusterManager.getWritablePartitionIds(DEFAULT_PARTITION_CLASS);
    checkReturnedPartitions(returnedPartitions, Arrays.asList(defaultRw, defaultPrw, defaultRwForPrw));
    // getFullyWritablePartitions(), class default
    returnedPartitions = clusterManager.getFullyWritablePartitionIds(DEFAULT_PARTITION_CLASS);
    checkReturnedPartitions(returnedPartitions, Arrays.asList(defaultRw, defaultRwForPrw));

    // getPartitions(), class special
    returnedPartitions = clusterManager.getAllPartitionIds(SPECIAL_PARTITION_CLASS);
    checkReturnedPartitions(returnedPartitions, Arrays.asList(specialRw, specialRo, specialPrw));
    // getWritablePartitions(), class special
    returnedPartitions = clusterManager.getWritablePartitionIds(SPECIAL_PARTITION_CLASS);
    checkReturnedPartitions(returnedPartitions, Arrays.asList(specialRw, specialPrw));
    // getFullyWritablePartitions(), class special
    returnedPartitions = clusterManager.getFullyWritablePartitionIds(SPECIAL_PARTITION_CLASS);
    checkReturnedPartitions(returnedPartitions, Arrays.asList(specialRw));
  }
Tests for {@link PartitionLayout#getPartitions(String)} and {@link PartitionLayout#getWritablePartitions(String)}.
@throws JSONException
ambry-clustermap/src/test/java/com/github/ambry/clustermap/HelixClusterManagerTest.java