Class CSRFTokenManagerTest

java.lang.Object
net.shibboleth.idp.ui.csrf.CSRFTokenManagerTest

public class CSRFTokenManagerTest extends Object
Tests for the CSRFTokenManager.
  • Field Details

    • manager

      private net.shibboleth.idp.ui.csrf.CSRFTokenManager manager
      Test token manager instance.
    • nullObj

      private Object nullObj
      Something to spoof the null checker.
  • Constructor Details

    • CSRFTokenManagerTest

      public CSRFTokenManagerTest()
  • Method Details

    • setup

      @BeforeMethod public void setup() throws ComponentInitializationException
      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

      public void testCustomTokenValidationPredicate() throws ComponentInitializationException
      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

      public void testCustomisedTokenGeneration() throws ComponentInitializationException
      Test token generation using a customised instantiation of the token manager.
      Throws:
      ComponentInitializationException