Package net.shibboleth.idp.ui.csrf
Class CSRFTokenManagerTest
java.lang.Object
net.shibboleth.idp.ui.csrf.CSRFTokenManagerTest
Tests for the
CSRFTokenManager.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetup()Test setup.voidTest token generation using a customised instantiation of the token manager.voidTest what happens if you add a custom validation predicate that always returns false.voidTest token generation using the default instantiation of the token manager.voidTest setting a valid csrf parameter name, which should not trigger an exception.voidTest setting an invalid csrf parameter name, which should trigger an exception.voidTest setting an invalid token generation strategy, which should trigger an exception.voidTest setting a valid token generation strategy, which should not trigger an exception.
-
Field Details
-
manager
private net.shibboleth.idp.ui.csrf.CSRFTokenManager managerTest token manager instance. -
nullObj
Something to spoof the null checker.
-
-
Constructor Details
-
CSRFTokenManagerTest
public CSRFTokenManagerTest()
-
-
Method Details
-
setup
Test setup.- Throws:
ComponentInitializationException
-
testSetNullCsrfParameterName
public void testSetNullCsrfParameterName()Test setting an invalid csrf parameter name, which should trigger an exception. -
testSetCsrfParameterName
public void testSetCsrfParameterName()Test setting a valid csrf parameter name, which should not trigger an exception. -
testSetNullTokenGenerationStrategy
public void testSetNullTokenGenerationStrategy()Test setting an invalid token generation strategy, which should trigger an exception. -
testSetTokenGenerationStrategy
public void testSetTokenGenerationStrategy()Test setting a valid token generation strategy, which should not trigger an exception. -
testCustomTokenValidationPredicate
Test what happens if you add a custom validation predicate that always returns false.- Throws:
ComponentInitializationException
-
testDefaultTokenGeneration
public void testDefaultTokenGeneration()Test token generation using the default instantiation of the token manager. -
testCustomisedTokenGeneration
Test token generation using a customised instantiation of the token manager.- Throws:
ComponentInitializationException
-