You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2016/02/02 17:54:16 UTC
[2/4] cxf git commit: Finished removing the WebServiceContext from
the STS
http://git-wip-us.apache.org/repos/asf/cxf/blob/53a46205/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java
index d62071d..21c5114 100644
--- a/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java
+++ b/services/sts/sts-core/src/test/java/org/apache/cxf/sts/operation/ValidateX509TokenUnitTest.java
@@ -27,7 +27,6 @@ import java.util.Properties;
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
-import org.apache.cxf.jaxws.context.WebServiceContextImpl;
import org.apache.cxf.jaxws.context.WrappedMessageContext;
import org.apache.cxf.message.MessageImpl;
import org.apache.cxf.security.SecurityContext;
@@ -111,15 +110,15 @@ public class ValidateX509TokenUnitTest extends org.junit.Assert {
// Mock up message context
MessageImpl msg = new MessageImpl();
WrappedMessageContext msgCtx = new WrappedMessageContext(msg);
+ Principal principal = new CustomTokenPrincipal("alice");
msgCtx.put(
SecurityContext.class.getName(),
- createSecurityContext(new CustomTokenPrincipal("alice"))
+ createSecurityContext(principal)
);
- WebServiceContextImpl webServiceContext = new WebServiceContextImpl(msgCtx);
// Validate a token
RequestSecurityTokenResponseType response =
- validateOperation.validate(request, webServiceContext);
+ validateOperation.validate(request, principal, msgCtx);
assertTrue(validateResponse(response));
}
@@ -175,15 +174,15 @@ public class ValidateX509TokenUnitTest extends org.junit.Assert {
// Mock up message context
MessageImpl msg = new MessageImpl();
WrappedMessageContext msgCtx = new WrappedMessageContext(msg);
+ Principal principal = new CustomTokenPrincipal("alice");
msgCtx.put(
SecurityContext.class.getName(),
- createSecurityContext(new CustomTokenPrincipal("alice"))
+ createSecurityContext(principal)
);
- WebServiceContextImpl webServiceContext = new WebServiceContextImpl(msgCtx);
// Validate a token
RequestSecurityTokenResponseType response =
- validateOperation.validate(request, webServiceContext);
+ validateOperation.validate(request, principal, msgCtx);
assertFalse(validateResponse(response));
}