use of org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileAclDto in project pentaho-platform by pentaho.
the class FileResourceTest method usersOrRolesExist_OwnerIsRepositoryAdmin.
@Test
public void usersOrRolesExist_OwnerIsRepositoryAdmin() {
RepositoryFileAclDto acl = new RepositoryFileAclDto();
acl.setOwner(REPOSITORY_ADMIN_USERNAME);
assertTrue(fileResource.validateUsersAndRoles(acl));
}
use of org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileAclDto in project pentaho-platform by pentaho.
the class FileResourceTest method usersOrRolesExist_OwnerExists.
@Test
public void usersOrRolesExist_OwnerExists() {
RepositoryFileAclDto acl = new RepositoryFileAclDto();
acl.setOwner(ACL_OWNER);
assertTrue(fileResource.validateUsersAndRoles(acl));
}
use of org.pentaho.platform.api.repository2.unified.webservices.RepositoryFileAclDto in project pentaho-platform by pentaho.
the class FileResourceTest method testSetFileAclsErrorNoOwner.
/*
* [BISERVER-14294] Validating the ACL empty owner is tested against.
*/
@Test
public void testSetFileAclsErrorNoOwner() {
RepositoryFileAclDto repository = mock(RepositoryFileAclDto.class);
doReturn(mock(Messages.class)).when(fileResource).getMessagesInstance();
doCallRealMethod().when(fileResource).validateUsersAndRoles(any());
assertEquals(FORBIDDEN.getStatusCode(), fileResource.setFileAcls(PATH_ID, repository).getStatus());
}
Aggregations