@Test public void testFinalizeResult_kerberos() throws Exception{ setupMocksForKerberosEnabledCluster(); Result result = new ResultImpl(true); createClusterResultTree(result.getResultTree()); ClusterBlueprintRenderer renderer = new TestBlueprintRenderer(topology); Result blueprintResult = renderer.finalizeResult(result); TreeNode<Resource> blueprintTree = blueprintResult.getResultTree(); assertNull(blueprintTree.getStringProperty("isCollection")); assertEquals(1, blueprintTree.getChildren().size()); TreeNode<Resource> blueprintNode = blueprintTree.getChildren().iterator().next(); assertEquals(0, blueprintNode.getChildren().size()); Resource blueprintResource = blueprintNode.getObject(); Map<String, Map<String, Object>> properties = blueprintResource.getPropertiesMap(); assertEquals("HDP", properties.get("Blueprints").get("stack_name")); assertEquals("1.3.3", properties.get("Blueprints").get("stack_version")); Map<String, Object> securityProperties = (Map<String, Object>) properties.get("Blueprints").get("security"); assertEquals("KERBEROS", securityProperties.get("type")); assertNotNull(((Map<String, Object>) securityProperties.get("kerberos_descriptor")).get("properties")); }
@Override public Result finalizeResult(Result queryResult) { TreeNode<Resource> resultTree = queryResult.getResultTree(); Result result = new ResultImpl(true); TreeNode<Resource> blueprintResultTree = result.getResultTree(); if (isCollection(resultTree)) { blueprintResultTree.setProperty("isCollection", "true"); } for (TreeNode<Resource> node : resultTree.getChildren()) { Resource blueprintResource = createBlueprintResource(node); blueprintResultTree.addChild(new TreeNodeImpl<Resource>( blueprintResultTree, blueprintResource, node.getName())); } return result; }
ClusterBlueprintRenderer extends BaseRenderer implements Renderer { @Override public Result finalizeResult(Result queryResult) { TreeNode<Resource> resultTree = queryResult.getResultTree(); Result result = new ResultImpl(true); TreeNode<Resource> blueprintResultTree = result.getResultTree(); if (isCollection(resultTree)) { blueprintResultTree.setProperty("isCollection", "true"); } for (TreeNode<Resource> node : resultTree.getChildren()) { Resource blueprintResource = createBlueprintResource(node); blueprintResultTree.addChild(new TreeNodeImpl<Resource>( blueprintResultTree, blueprintResource, node.getName())); } return result; } }
ClusterBlueprintRenderer extends BaseRenderer implements Renderer { @Override public Result finalizeResult(Result queryResult) { TreeNode<Resource> resultTree = queryResult.getResultTree(); Result result = new ResultImpl(true); TreeNode<Resource> blueprintResultTree = result.getResultTree(); if (isCollection(resultTree)) { blueprintResultTree.setProperty("isCollection", "true"); } for (TreeNode<Resource> node : resultTree.getChildren()) { Resource blueprintResource = createBlueprintResource(node); blueprintResultTree.addChild(new TreeNodeImpl<Resource>( blueprintResultTree, blueprintResource, node.getName())); } return result; }  }
ClusterBlueprintRenderer extends BaseRenderer implements Renderer { @Override public Result finalizeResult(Result queryResult) { TreeNode<Resource> resultTree = queryResult.getResultTree(); Result result = new ResultImpl(true); TreeNode<Resource> blueprintResultTree = result.getResultTree(); if (isCollection(resultTree)) { blueprintResultTree.setProperty("isCollection", "true"); } for (TreeNode<Resource> node : resultTree.getChildren()) { Resource blueprintResource = createBlueprintResource(node); blueprintResultTree.addChild(new TreeNodeImpl<Resource>( blueprintResultTree, blueprintResource, node.getName())); } return result; }  @Override TreeNode<Set<String>> finalizeProperties(
      TreeNode<QueryInfo> queryProperties, boolean isCollection); @Override Result finalizeResult(Result queryResult); @Override ResultPostProcessor getResultPostProcessor(Request request); @Override boolean requiresPropertyProviderInput(); }
ClusterBlueprintRenderer extends BaseRenderer implements Renderer { @Override public Result finalizeResult(Result queryResult) { TreeNode<Resource> resultTree = queryResult.getResultTree(); Result result = new ResultImpl(true); TreeNode<Resource> blueprintResultTree = result.getResultTree(); if (isCollection(resultTree)) { blueprintResultTree.setProperty("isCollection", "true"); } for (TreeNode<Resource> node : resultTree.getChildren()) { Resource blueprintResource = createBlueprintResource(node); blueprintResultTree.addChild(new TreeNodeImpl<Resource>( blueprintResultTree, blueprintResource, node.getName())); } return result; }  @Override TreeNode<Set<String>> finalizeProperties(
      TreeNode<QueryInfo> queryProperties, boolean isCollection); @Override Result finalizeResult(Result queryResult); @Override ResultPostProcessor getResultPostProcessor(Request request); @Override boolean requiresPropertyProviderInput();  }