protected void setUp() throws Exception {
    this.action = new X509CertificateCredentialsNonInteractiveAction();
    final CentralAuthenticationServiceImpl centralAuthenticationService =
        new CentralAuthenticationServiceImpl();
    centralAuthenticationService.setTicketRegistry(new DefaultTicketRegistry());
    final Map<String, UniqueTicketIdGenerator> idGenerators =
        new HashMap<String, UniqueTicketIdGenerator>();
    idGenerators.put(
        SimpleWebApplicationServiceImpl.class.getName(), new DefaultUniqueTicketIdGenerator());

    final AuthenticationManagerImpl authenticationManager = new AuthenticationManagerImpl();

    final X509CredentialsAuthenticationHandler a = new X509CredentialsAuthenticationHandler();
    a.setTrustedIssuerDnPattern("CN=\\w+,DC=jasig,DC=org");

    authenticationManager.setAuthenticationHandlers(Arrays.asList(new AuthenticationHandler[] {a}));
    authenticationManager.setCredentialsToPrincipalResolvers(
        Arrays.asList(
            new CredentialsToPrincipalResolver[] {
              new X509CertificateCredentialsToSerialNumberPrincipalResolver()
            }));

    centralAuthenticationService.setTicketGrantingTicketUniqueTicketIdGenerator(
        new DefaultUniqueTicketIdGenerator());
    centralAuthenticationService.setUniqueTicketIdGeneratorsForService(idGenerators);
    centralAuthenticationService.setServiceTicketExpirationPolicy(
        new NeverExpiresExpirationPolicy());
    centralAuthenticationService.setTicketGrantingTicketExpirationPolicy(
        new NeverExpiresExpirationPolicy());
    centralAuthenticationService.setAuthenticationManager(authenticationManager);

    this.action.setCentralAuthenticationService(centralAuthenticationService);
    this.action.afterPropertiesSet();
  }