@Test
  public void testPartitionClassStatsPublisher() throws Exception {
    // Before publishing partition class stats, we have to publish account stats since they use the same data
    StatsManager.AccountStatsPublisher accountStatsPublisher =
        statsManager.new AccountStatsPublisher(accountStatsMySqlStore);
    accountStatsPublisher.run();

    StatsManager.PartitionClassStatsPublisher publisher =
        statsManager.new PartitionClassStatsPublisher(accountStatsMySqlStore);
    publisher.run();

    Map<String, Set<Integer>> partitionNameAndIds = accountStatsMySqlStore.queryPartitionNameAndIds();
    HostPartitionClassStorageStatsWrapper statsWrapper =
        accountStatsMySqlStore.queryHostPartitionClassStorageStatsByHost(currentNode.getHostname(),
            currentNode.getPort(), partitionNameAndIds);
    assertEquals(hostPartitionClassStorageStats.getStorageStats(), statsWrapper.getStats().getStorageStats());
  }
Test partition class stats publisher
@throws Exception
ambry-server/src/integration-test/java/com/github/ambry/server/StatsManagerIntegrationTest.java