|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.elca.el4j.tests.services.security.AuthorizationLocalTest
public class AuthorizationLocalTest
Tests various logins and authorization in a local environment.
| Field Summary | |
|---|---|
private ApplicationContext |
m_ac
Application context. |
private String[] |
m_configLocations
Config locations. |
private static String |
METHOD_ACCESS_ROLE
Method access role. |
private static org.slf4j.Logger |
s_logger
The static logger. |
| Constructor Summary | |
|---|---|
AuthorizationLocalTest()
|
|
| Method Summary | |
|---|---|
private void |
createSecureContext(String principal,
String credential,
String role)
Create a secure context, i.e. login, with a TestingAuthenticationToken, i.e. a token where the user can define which roles it possesses. |
private void |
destroySecureContext()
Delete the secure context, i.e. logging out the user. |
private ExtendedTestingAuthenticationProvider |
getAuthenticationProvider()
Returns the local authentication provider. |
private SampleService |
getSampleService()
|
void |
testCorrectAuthorization()
Test does a correct authorization. |
void |
testCorrectAuthorizationAfterLogoutNoAccess()
Test does a correct authorization. |
void |
testFailedAuthentication()
Test tries to authenticate with a wrong username/password combination. |
void |
testFailedAuthorization()
Test does a correct login with the wrong role. |
void |
testMethodCallWithoutLogin()
Test tries to execute the target method without authentication. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static org.slf4j.Logger s_logger
private static final String METHOD_ACCESS_ROLE
private String[] m_configLocations
private ApplicationContext m_ac
| Constructor Detail |
|---|
public AuthorizationLocalTest()
| Method Detail |
|---|
public void testMethodCallWithoutLogin()
throws Exception
Exception - If something.
public void testCorrectAuthorization()
throws Exception
Exception - If something.
public void testCorrectAuthorizationAfterLogoutNoAccess()
throws Exception
Exception - If something.
public void testFailedAuthorization()
throws Exception
Exception - If something.
public void testFailedAuthentication()
throws Exception
Exception - If something.private ExtendedTestingAuthenticationProvider getAuthenticationProvider()
private SampleService getSampleService()
private void createSecureContext(String principal,
String credential,
String role)
principal - The usernamecredential - The passwordrole - The roleprivate void destroySecureContext()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||