@Test public void testGetPrefix() throws Exception { NamespaceRegistry delegate = mock(NamespaceRegistry.class); NamespaceRegistryFacade facade = getFacade(delegate); final String prefix = NamespaceRegistry.PREFIX_JCR; final String uri = NamespaceRegistry.NAMESPACE_JCR; when(delegate.getPrefix(anyString())).thenReturn(null); when(delegate.getPrefix(uri)).thenReturn(prefix); assertNull("should be null", facade.getPrefix("")); assertSame("should be same", prefix, facade.getPrefix(uri)); }
@Override public String getPrefix(String uri) throws RepositoryException { return delegate.getPrefix(uri); }
NamespaceRegistryFacade implements NamespaceRegistry { @Override public String getPrefix(String uri) throws RepositoryException { return delegate.getPrefix(uri); } }
NamespaceRegistryFacade implements NamespaceRegistry { @Override public String getPrefix(String uri) throws RepositoryException { return delegate.getPrefix(uri); } @SuppressWarnings("WeakerAccess")  NamespaceRegistryFacade(@NotNull NamespaceRegistry delegate); }
NamespaceRegistryFacade implements NamespaceRegistry { @Override public String getPrefix(String uri) throws RepositoryException { return delegate.getPrefix(uri); } @SuppressWarnings("WeakerAccess")  NamespaceRegistryFacade(@NotNull NamespaceRegistry delegate); @Override String[] getPrefixes(); @Override String[] getURIs(); @Override String getURI(String prefix); @Override String getPrefix(String uri); @Override void registerNamespace(String prefix, String uri); @Override void unregisterNamespace(String prefix); }
NamespaceRegistryFacade implements NamespaceRegistry { @Override public String getPrefix(String uri) throws RepositoryException { return delegate.getPrefix(uri); } @SuppressWarnings("WeakerAccess")  NamespaceRegistryFacade(@NotNull NamespaceRegistry delegate); @Override String[] getPrefixes(); @Override String[] getURIs(); @Override String getURI(String prefix); @Override String getPrefix(String uri); @Override void registerNamespace(String prefix, String uri); @Override void unregisterNamespace(String prefix);  }