@Test(expected = AuthorizationException.class)
  public void testStackDefinedPropertyProviderAsViewUser() throws Exception {
    // Setup user with 'ViewUser'
    // ViewUser doesn't have the 'CLUSTER_VIEW_METRICS', 'HOST_VIEW_METRICS' and 'SERVICE_VIEW_METRICS', thus
    // can't retrieve the Metrics.
    SecurityContextHolder.getContext().setAuthentication(TestAuthenticationFactory.createViewUser("ViewUser", 2L));

    testPopulateHostComponentResources();
    testCustomProviders();
    testPopulateResources_HDP2();
    testPopulateResources_HDP2_params();
    testPopulateResources_HDP2_params_singleProperty();
    testPopulateResources_HDP2_params_category();
    testPopulateResources_HDP2_params_category2();
    testPopulateResources_jmx_JournalNode();
    testPopulateResources_jmx_Storm();
    testPopulateResources_NoRegionServer();
    testPopulateResources_HBaseMaster2();
    testPopulateResources_params_category5();
    testPopulateResources_ganglia_JournalNode();
    testPopulateResources_resourcemanager_clustermetrics();
    testPopulateResourcesWithAggregateFunctionMetrics();
  }
Tests the stack defined property provider.
ambari-server/src/test/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProviderTest.java