SessionFacade implements Session { @Override public final String[] getAttributeNames() { return delegate.getAttributeNames(); } SessionFacade(final @NotNull S delegate, final boolean notProtected); static @Nullable Session findBestWrapper(final @Nullable Session session, final boolean notProtected); @Override final Repository getRepository(); @Override final AccessControlManager getAccessControlManager(); @Override final RetentionManager getRetentionManager(); @Override final Workspace getWorkspace(); @Override final String getUserID(); @Override final String[] getAttributeNames(); @Override final Object getAttribute(final String name); @Override final Node getRootNode(); @Override final Session impersonate(Credentials credentials); @SuppressWarnings("deprecation") @Override final Node getNodeByUUID(String uuid); @Override final Node getNodeByIdentifier(String id); @Override final Item getItem(String absPath); @Override final Node getNode(String absPath); @Override final Property getProperty(String absPath); @Override final boolean itemExists(String absPath); @Override final boolean nodeExists(String absPath); @Override final boolean propertyExists(String absPath); @Override final void refresh(boolean keepChanges); @Override final void logout(); @Override final boolean isLive(); @Override final boolean hasPendingChanges(); @Override final ValueFactory getValueFactory(); @Override final boolean hasPermission(String absPath, String actions); @Override final void checkPermission(String absPath, String actions); @Override final boolean hasCapability(String methodName, Object target, Object[] arguments); @Override final void exportSystemView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse); @Override final void exportSystemView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse); @Override final void exportDocumentView(String absPath, ContentHandler contentHandler, boolean skipBinary, boolean noRecurse); @Override final void exportDocumentView(String absPath, OutputStream out, boolean skipBinary, boolean noRecurse); @Override final String[] getNamespacePrefixes(); @Override final String getNamespaceURI(String prefix); @Override final String getNamespacePrefix(String uri); @Override final void addLockToken(String lt); @SuppressWarnings("deprecation") @Override final String[] getLockTokens(); @Override final void removeLockToken(String lt); @Override final void move(String srcAbsPath, String destAbsPath); @Override final void removeItem(String absPath); @Override final void save(); @Override final ContentHandler getImportContentHandler(String parentAbsPath, int uuidBehavior); @Override final void importXML(String parentAbsPath, InputStream in, int uuidBehavior); @Override final void setNamespacePrefix(String prefix, String uri);  }
@Test public void testGetAttributeNames() { final String[] names = new String[]{"test"}; final Session session = mock(Session.class); when(session.getAttributeNames()).thenReturn(names); assertArrayEquals(names, new JcrSessionFacade(session, false).getAttributeNames()); }