public class GoogleAccountsServiceTests extends TestCase {
private GoogleAccountsService googleAccountsService;
public static GoogleAccountsService getGoogleAccountsService() throws Exception {
final PublicKeyFactoryBean pubKeyFactoryBean = new PublicKeyFactoryBean();
pubKeyFactoryBean.setAlgorithm("DSA");
final PrivateKeyFactoryBean privKeyFactoryBean = new PrivateKeyFactoryBean();
privKeyFactoryBean.setAlgorithm("DSA");
final ClassPathResource pubKeyResource = new ClassPathResource("DSAPublicKey01.key");
final ClassPathResource privKeyResource = new ClassPathResource("DSAPrivateKey01.key");
pubKeyFactoryBean.setLocation(pubKeyResource);
privKeyFactoryBean.setLocation(privKeyResource);
pubKeyFactoryBean.afterPropertiesSet();
privKeyFactoryBean.afterPropertiesSet();
final DSAPrivateKey privateKey = (DSAPrivateKey) privKeyFactoryBean.getObject();
final DSAPublicKey publicKey = (DSAPublicKey) pubKeyFactoryBean.getObject();
final MockHttpServletRequest request = new MockHttpServletRequest();
final String SAMLRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><samlp:AuthnRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" ID=\"5545454455\" Version=\"2.0\" IssueInstant=\"Value\" ProtocolBinding=\"urn:oasis:names.tc:SAML:2.0:bindings:HTTP-Redirect\" ProviderName=\"https://localhost:8443/myRutgers\" AssertionConsumerServiceURL=\"https://localhost:8443/myRutgers\"/>";
request.setParameter("SAMLRequest", encodeMessage(SAMLRequest));