|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.elca.el4j.tests.services.security.AuthorizationDistributedTest
public class AuthorizationDistributedTest
Tests various logins and authorization in a distributed environment.
| Field Summary | |
|---|---|
private ConfigurableApplicationContext |
m_ac
Application context. |
private String[] |
m_configLocationsClient
Client config locations. |
private String[] |
m_configLocationsServer
Server config locations. |
private static String |
METHOD_ACCESS_ROLE
Method access role. |
private static org.slf4j.Logger |
s_logger
Private logger. |
| Constructor Summary | |
|---|---|
AuthorizationDistributedTest()
|
|
| Method Summary | |
|---|---|
private void |
createSecureContext(String principal,
String credential,
String role)
Create a secure context with a TestingAuthenticationToken, i.e. a token where the user can define which roles it possesses. |
private void |
destroySecureContext(String principal,
String credential)
Delete the secure context, i.e. logging out the user. |
private ExtendedTestingAuthenticationProvider |
getAuthenticationProvider()
Returns the authentication provider of the authorization server. |
private AuthenticationService |
getAuthenticationService()
|
private SampleService |
getSampleService()
|
void |
setUp()
|
void |
tearDown()
|
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_configLocationsServer
private String[] m_configLocationsClient
private ConfigurableApplicationContext m_ac
| Constructor Detail |
|---|
public AuthorizationDistributedTest()
| Method Detail |
|---|
public void setUp()
public void tearDown()
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 AuthenticationService getAuthenticationService()
private ExtendedTestingAuthenticationProvider getAuthenticationProvider()
private SampleService getSampleService()
private void createSecureContext(String principal,
String credential,
String role)
principal - The usernamecredential - The passwordrole - The role
private void destroySecureContext(String principal,
String credential)
principal - Is the principal.credential - is the credential.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||