Program: 34569
Project: 34569
Buggy source:
@Override protected CertificateLoginModule createInitializedModule(Subject subject,Map<String,Object> sharedState) throws Exception {
  final X509Certificate[] certChain=new X509Certificate[]{cert};
  CallbackHandler callbackHandler=new CallbackHandlerDouble(certChain);
  final CertificateLoginModule module=new CertificateLoginModule();
  module.initialize(subject,callbackHandler,sharedState,null);
  mock.checking(new Expectations(){
{
      one(collectiveAuthenticationPlugin).isCollectiveCertificateChain(certChain);
      will(returnValue(false));
      one(collectiveAuthenticationPlugin).isCollectiveCACertificate(certChain);
      will(returnValue(false));
      allowing(cert).getSubjectX500Principal();
      will(returnValue(new X500Principal("String_Node_Str")));
      one(userRegistry).mapCertificate(cert);
      will(returnValue(USER_NAME));
      allowing(userRegistry).getRealm();
      will(returnValue(TEST_REALM));
      allowing(userRegistry).getType();
      will(returnValue("String_Node_Str"));
      allowing(userRegistry).getUniqueUserId(USER_NAME);
      will(returnValue(USER_NAME));
      allowing(userRegistry).getUserSecurityName(USER_NAME);
      will(returnValue(USER_NAME));
      allowing(credentialsService).setCredentials(with(any(Subject.class)));
      will(new Action(){
        @Override public Object invoke(        Invocation arg0) throws Throwable {
          module.temporarySubject.getPublicCredentials().add(wsCredential);
          module.temporarySubject.getPrivateCredentials().add(ssoToken);
          return null;
        }
        @Override public void describeTo(        Description arg0){
        }
      }
);
    }
  }
);
  return module;
}

Fixed version (ground truth):
@Override protected CertificateLoginModule createInitializedModule(Subject subject,Map<String,Object> sharedState) throws Exception {
  final X509Certificate[] certChain=new X509Certificate[]{cert};
  CallbackHandler callbackHandler=new CallbackHandlerDouble(certChain);
  final CertificateLoginModule module=new CertificateLoginModule();
  module.initialize(subject,callbackHandler,sharedState,null);
  mock.checking(new Expectations(){
{
      one(collectiveAuthenticationPlugin).isCollectiveCertificateChain(certChain);
      will(returnValue(false));
      one(collectiveAuthenticationPlugin).isCollectiveCACertificate(certChain);
      will(returnValue(false));
      allowing(cert).getSubjectX500Principal();
      will(returnValue(new X500Principal("String_Node_Str")));
      one(userRegistry).mapCertificate(certChain);
      will(returnValue(USER_NAME));
      allowing(userRegistry).getRealm();
      will(returnValue(TEST_REALM));
      allowing(userRegistry).getType();
      will(returnValue("String_Node_Str"));
      allowing(userRegistry).getUniqueUserId(USER_NAME);
      will(returnValue(USER_NAME));
      allowing(userRegistry).getUserSecurityName(USER_NAME);
      will(returnValue(USER_NAME));
      allowing(credentialsService).setCredentials(with(any(Subject.class)));
      will(new Action(){
        @Override public Object invoke(        Invocation arg0) throws Throwable {
          module.temporarySubject.getPublicCredentials().add(wsCredential);
          module.temporarySubject.getPrivateCredentials().add(ssoToken);
          return null;
        }
        @Override public void describeTo(        Description arg0){
        }
      }
);
    }
  }
);
  return module;
}