Class PKCS11PrivateKeyFactoryBeanTest

java.lang.Object
net.shibboleth.shared.spring.security.factory.PKCS11PrivateKeyFactoryBeanTest

public class PKCS11PrivateKeyFactoryBeanTest extends Object
Test class for PKCS11PrivateKeyFactoryBean.

It's really hard to provide tests for this bean that will run anywhere, because by definition it requires access to a PKCS#11 token, which is not something you'll find on any street corner.

The approach taken here is to have one test for known prerequisites which should be true in all environments, and a number of (by default disabled tests exercising specific scenarios with specific tokens.

  • Constructor Details

    • PKCS11PrivateKeyFactoryBeanTest

      public PKCS11PrivateKeyFactoryBeanTest()
  • Method Details

    • testPrerequisites

      public void testPrerequisites() throws Exception
      Test universal prerequisites.
      Throws:
      Exception - if something bad happens
    • testSoftHSM

      public void testSoftHSM() throws Exception
      Test a specific SoftHSM deployment on Ian's desktop Mac.

      Disabled by default because our normal test environment doesn't include this setup.

      Throws:
      Exception - if something bad happens