Skip to content
Snippets Groups Projects
Commit 098db3f7 authored by felmer's avatar felmer
Browse files

LMS-1222 Fix bug in test

SVN: 12938
parent fb9f15a7
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,17 @@ public final class PredicateExecutor
{
PredicateExecutor.authorizationDataProvider = new AuthorizationDataProvider(daoFactory);
}
static final IAuthorizationDataProvider getAuthorizationDataProvider()
{
return authorizationDataProvider;
}
static final void setAuthorizationDataProvider(IAuthorizationDataProvider authorizationDataProvider)
{
PredicateExecutor.authorizationDataProvider = authorizationDataProvider;
}
/**
* Creates, casts and ensures that the returned {@link IPredicate} is not <code>null</code>.
......
......@@ -57,6 +57,8 @@ public final class PredicateExecutorTest extends AuthorizationTestCase
private IPredicateFactory previousFactory;
private IAuthorizationDataProvider previousProvider;
private List<RoleWithIdentifier> createAllowedRoles()
{
return Collections.singletonList(createGroupRole(RoleCode.USER,
......@@ -86,6 +88,7 @@ public final class PredicateExecutorTest extends AuthorizationTestCase
will(returnValue(Collections.EMPTY_LIST));
}
});
previousProvider = PredicateExecutor.getAuthorizationDataProvider();
PredicateExecutor.setDAOFactory(daoFactory);
}
......@@ -93,6 +96,7 @@ public final class PredicateExecutorTest extends AuthorizationTestCase
@AfterMethod
public void tearDown()
{
PredicateExecutor.setAuthorizationDataProvider(previousProvider);
PredicateExecutor.setPredicateFactory(previousFactory);
super.tearDown();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment