Skip to content

Commit

Permalink
ALFREDAPI-562: Move permissions tests to 'nonadmin' package
Browse files Browse the repository at this point in the history
  • Loading branch information
WimCrols committed Dec 10, 2024
1 parent 775e876 commit f4eb2c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 165 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.service.namespace.QName;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -90,6 +88,7 @@ public void setup() {
FileInfo documentForbidden = createTestNode(folderForbidden.getNodeRef(), "ForbiddenDocument");
nodeForbidden = documentForbidden.getNodeRef();
alfNodeService.setProperty(nodeForbidden, PROP_QNAME_VERSION_LABEL, PROPERTY_VALUE);

} catch (FileExistsException e) {
logger.warn("Test folder already created. Skipping (" + e.getMessage() + ")");
}
Expand All @@ -102,6 +101,7 @@ public void setup() {
FileInfo documentAllowed = createTestNode(folderAllowed.getNodeRef(), "AllowedDocument");
nodeAllowed = documentAllowed.getNodeRef();
alfNodeService.setProperty(nodeAllowed, PROP_QNAME_VERSION_LABEL, PROPERTY_VALUE);

} catch (FileExistsException e) {
logger.warn("Test folder already created. Skipping (" + e.getMessage() + ")");
}
Expand All @@ -110,6 +110,7 @@ public void setup() {
@After
public void teardown() {
AuthenticationUtil.setAdminUserAsFullyAuthenticatedUser();
alfPersonService.deletePerson(USERNAME_NORIGHTS_JOS);
cleanUp();
}

Expand Down Expand Up @@ -167,8 +168,7 @@ public void testGetNodeMetadata() {
try {
apixNodeService.getMetadata(new eu.xenit.alfred.api.data.NodeRef(nodeForbidden.toString()));
Assert.fail("Expected AccessDeniedException");
}
catch (AccessDeniedException e) {
} catch (AccessDeniedException e) {
}
}

Expand Down

This file was deleted.

0 comments on commit f4eb2c9

Please sign in to comment.