@Test
public void testZeroSubClustersWithPositiveWeight() throws Exception {

  Map<SubClusterIdInfo, Float> routerWeights = new HashMap<>();
  Map<SubClusterIdInfo, Float> amrmWeights = new HashMap<>();
  // Set negative value to all subclusters
  for (int i = 0; i < 5; i++) {
    SubClusterIdInfo sc = new SubClusterIdInfo("sc" + i);
    SubClusterInfo sci = mock(SubClusterInfo.class);
    when(sci.getState()).thenReturn(SubClusterState.SC_RUNNING);
    when(sci.getSubClusterId()).thenReturn(sc.toId());
    getActiveSubclusters().put(sc.toId(), sci);
    routerWeights.put(sc, 0.0f);
    amrmWeights.put(sc, -1.0f);
  }
  getPolicyInfo().setRouterPolicyWeights(routerWeights);
  getPolicyInfo().setAMRMPolicyWeights(amrmWeights);
  FederationPoliciesTestUtil.initializePolicyContext(getPolicy(),
      getPolicyInfo(), getActiveSubclusters());
  intercept(FederationPolicyException.class,
      "No Active Subcluster with weight vector greater than zero",
      () -> ((FederationRouterPolicy) getPolicy())
          .getHomeSubcluster(getApplicationSubmissionContext(), null));
}