### Question:
FolderApiService { @AclMask @PreAuthorize("hasRole('ADMIN') or @grantPermissionManager.ownerPermission(#id, {'FOLDER'})") public Folder unlockFolder(Long id) { return folderManager.unlockFolder(id); }  @PreAuthorize(AclExpressions.FOLDER_ID_CREATE) Folder create(final Folder folder); @PreAuthorize(AclExpressions.FOLDER_ID_CREATE) Folder createFromTemplate(final Folder folder, final String templateName); @PreAuthorize("hasRole('ADMIN') OR hasPermission(#folder, 'WRITE')") Folder update(final Folder folder); @PreAuthorize("hasRole('ADMIN') OR @grantPermissionManager.metadataPermission(#id, #aclClass, 'READ')") @AclTree FolderWithMetadata getProject(final Long id, final AclClass aclClass); @AclTree Folder loadTree(); @AclTree Folder loadProjects(); @AclTree Folder load(Long id); @PostAuthorize("hasRole('ADMIN') OR hasPermission(returnObject, 'READ')") @AclMask Folder loadByIdOrPath(String pathOrIdentifier); @PreAuthorize("hasRole('ADMIN') OR (hasRole('FOLDER_MANAGER') AND " + "hasPermission(#id, 'com.epam.pipeline.entity.pipeline.Folder', 'WRITE'))") Folder delete(final Long id); @PreAuthorize("hasRole('ADMIN') OR (hasRole('FOLDER_MANAGER') AND " +"@grantPermissionManager.childrenFolderPermission(#id, 'WRITE'))") Folder deleteForce(final Long id); @PreAuthorize("hasRole('ADMIN') OR (hasRole('FOLDER_MANAGER') AND " + "hasPermission(#id, 'com.epam.pipeline.entity.pipeline.Folder', 'READ') AND " + "hasPermission(#destinationFolderId, 'com.epam.pipeline.entity.pipeline.Folder', 'WRITE'))") Folder cloneFolder(final Long id, final Long destinationFolderId, String name); @AclMask @PreAuthorize("hasRole('ADMIN') or @grantPermissionManager.ownerPermission(#id, {'FOLDER'})") Folder lockFolder(Long id); @AclMask @PreAuthorize("hasRole('ADMIN') or @grantPermissionManager.ownerPermission(#id, {'FOLDER'})") Folder unlockFolder(Long id);  }### Answer:
@Test(expected = AccessDeniedException.class) @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) @WithMockUser(username = TEST_USER2) public void testUnlockByNotAdminOrOwner() { when(folderManager.unlockFolder(anyLong())).thenReturn(parent); folderApiService.unlockFolder(parent.getId()); }