Author: anil.saldhana(a)jboss.com
Date: 2010-10-18 17:47:33 -0400 (Mon, 18 Oct 2010)
New Revision: 488
Modified:
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/wst/WSTrustIssuePublicCertificateTestCase.java
Log:
PLFED-109: parse the X509 cert as part of RST use key
Modified:
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/wst/WSTrustIssuePublicCertificateTestCase.java
===================================================================
---
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/wst/WSTrustIssuePublicCertificateTestCase.java 2010-10-18
21:46:06 UTC (rev 487)
+++
federation/trunk/picketlink-fed-core/src/test/java/org/picketlink/test/identity/federation/core/parser/wst/WSTrustIssuePublicCertificateTestCase.java 2010-10-18
21:47:33 UTC (rev 488)
@@ -25,11 +25,15 @@
import java.io.InputStream;
+import javax.xml.bind.JAXBElement;
+
import org.junit.Test;
import
org.picketlink.identity.federation.core.parsers.wst.WSTRequestSecurityTokenParser;
import org.picketlink.identity.federation.core.parsers.wst.WSTrustParser;
import org.picketlink.identity.federation.core.wstrust.WSTrustConstants;
import org.picketlink.identity.federation.core.wstrust.wrappers.RequestSecurityToken;
+import org.picketlink.identity.federation.ws.addressing.EndpointReferenceType;
+import org.picketlink.identity.federation.ws.policy.AppliesTo;
import org.picketlink.identity.federation.ws.trust.UseKeyType;
import org.w3c.dom.Element;
@@ -41,6 +45,7 @@
public class WSTrustIssuePublicCertificateTestCase
{
+ @SuppressWarnings("unchecked")
@Test
public void testPublicCert() throws Exception
{
@@ -53,6 +58,14 @@
assertEquals( "testcontext", requestToken.getContext() );
assertEquals( WSTrustConstants.ISSUE_REQUEST ,
requestToken.getRequestType().toASCIIString() );
+ AppliesTo appliesTo = requestToken.getAppliesTo();
+ JAXBElement<EndpointReferenceType> jaxb =
(JAXBElement<EndpointReferenceType>) appliesTo.getAny().get(0);
+ EndpointReferenceType endpoint = jaxb.getValue();
+ assertEquals( "http://services.testcorp.org/provider2",
endpoint.getAddress().getValue() );
+
+
+ assertEquals(
"http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey",
requestToken.getKeyType().toASCIIString() );
+
UseKeyType useKeyType = requestToken.getUseKey();
Element certEl = (Element) useKeyType.getAny();
Show replies by date