NodeTypeManagerFacade implements NodeTypeManager { @Override public NodeTypeTemplate createNodeTypeTemplate() throws RepositoryException { return delegate.createNodeTypeTemplate(); } NodeTypeManagerFacade(final @NotNull NodeTypeManager delegate); @Override NodeType getNodeType(String nodeTypeName); @Override boolean hasNodeType(String name); @Override NodeTypeIterator getAllNodeTypes(); @Override NodeTypeIterator getPrimaryNodeTypes(); @Override NodeTypeIterator getMixinNodeTypes(); @Override NodeTypeTemplate createNodeTypeTemplate(); @Override NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd); @Override NodeDefinitionTemplate createNodeDefinitionTemplate(); @Override PropertyDefinitionTemplate createPropertyDefinitionTemplate(); @Override NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate); @Override NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate); @Override void unregisterNodeType(String name); @Override void unregisterNodeTypes(String[] names);  }
@Test public void testCreateNodeTypeTemplate() throws Exception { NodeTypeManager delegate = mock(NodeTypeManager.class); NodeTypeManagerFacade facade = getFacade(delegate); final NodeTypeTemplate value = mock(NodeTypeTemplate.class); when(delegate.createNodeTypeTemplate()).thenReturn(value); assertSame("same value", value, facade.createNodeTypeTemplate()); }
@Test public void testCreateNodeTypeTemplateDefinition() throws Exception { NodeTypeManager delegate = mock(NodeTypeManager.class); NodeTypeManagerFacade facade = getFacade(delegate); final NodeTypeTemplate value = mock(NodeTypeTemplate.class); final NodeTypeDefinition def = mock(NodeTypeDefinition.class); when(delegate.createNodeTypeTemplate(def)).thenReturn(value); assertSame("same value", value, facade.createNodeTypeTemplate(def)); }