@Test
public void testTierSlaComputationCorrectness() throws Exception {

    updater.tieredQueueSlaUpdates().subscribe(testSubscriber);
    testScheduler.triggerActions();
    MyTieredQueueSlas slas = (MyTieredQueueSlas) testSubscriber.takeNext();
    // Verify critical tier
    ResAllocs criticalTierCapacity = slas.getTierCapacities().get(Tier.Critical.ordinal());
    assertThat(fromResAllocs(criticalTierCapacity)).isEqualTo(CRITICAL_CAPACITY);
    // Verify critical capacity group
    ResAllocs criticalGrCapActual = slas.getGroupCapacities().get(Tier.Critical.ordinal()).get(CRITICAL_CAPACITY_GROUP.getAppName());
    assertThat(fromResAllocs(criticalGrCapActual)).isEqualTo(toResourceDimension(CRITICAL_CAPACITY_GROUP));
    // Verify flex tier
    ResAllocs flexTierCapacity = slas.getTierCapacities().get(Tier.Flex.ordinal());
    assertThat(fromResAllocs(flexTierCapacity)).isEqualTo(FLEX_CAPACITY);
    // Verify flex capacity group
    ResAllocs flexGrCapActual = slas.getGroupCapacities().get(Tier.Flex.ordinal()).get(FLEX_CAPACITY_GROUP.getAppName());
    assertThat(fromResAllocs(flexGrCapActual)).isEqualTo(toResourceDimension(FLEX_CAPACITY_GROUP));
}