mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 14:05:44 +01:00
mark security context as deprecated and use shiro apis instead
This commit is contained in:
@@ -35,6 +35,9 @@ package sonia.scm.user;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import sonia.scm.Manager;
|
||||
@@ -56,7 +59,7 @@ import java.util.UUID;
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
public abstract class UserManagerTestBase
|
||||
extends ManagerTestBase<User, UserException>
|
||||
extends ManagerTestBase<User, UserException>
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
@@ -265,7 +268,7 @@ public abstract class UserManagerTestBase
|
||||
*/
|
||||
@Test
|
||||
public void testMultiThreaded()
|
||||
throws UserException, IOException, InterruptedException
|
||||
throws UserException, IOException, InterruptedException
|
||||
{
|
||||
int initialSize = manager.getAll().size();
|
||||
List<MultiThreadTester> testers = new ArrayList<MultiThreadTester>();
|
||||
@@ -275,8 +278,11 @@ public abstract class UserManagerTestBase
|
||||
testers.add(new MultiThreadTester(manager));
|
||||
}
|
||||
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
|
||||
for (MultiThreadTester tester : testers)
|
||||
{
|
||||
subject.associateWith(tester);
|
||||
new Thread(tester).start();
|
||||
}
|
||||
|
||||
@@ -393,7 +399,7 @@ public abstract class UserManagerTestBase
|
||||
{
|
||||
String id = UUID.randomUUID().toString();
|
||||
User user = new User(id, id.concat(" displayName"),
|
||||
id.concat("@mail.com"));
|
||||
id.concat("@mail.com"));
|
||||
|
||||
manager.create(user);
|
||||
|
||||
@@ -410,7 +416,7 @@ public abstract class UserManagerTestBase
|
||||
* @throws UserException
|
||||
*/
|
||||
private void modifyAndDeleteUser(User user)
|
||||
throws UserException, IOException
|
||||
throws UserException, IOException
|
||||
{
|
||||
String name = user.getName();
|
||||
String nd = name.concat(" new displayname");
|
||||
|
||||
Reference in New Issue
Block a user