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 2014/07/25 12:10:58 UTC
git commit: Fixing failing unit test
Repository: cxf-fediz
Updated Branches:
refs/heads/master 4a0b86496 -> 0f3a5b4f7
Fixing failing unit test
Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/0f3a5b4f
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/0f3a5b4f
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/0f3a5b4f
Branch: refs/heads/master
Commit: 0f3a5b4f743cdaecef0b9591e9691e63076d8e23
Parents: 4a0b864
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Fri Jul 25 11:10:42 2014 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Fri Jul 25 11:10:42 2014 +0100
----------------------------------------------------------------------
.../cxf/fediz/core/federation/FederationResponseTest.java | 5 ++---
.../org/apache/cxf/fediz/core/samlsso/SAMLResponseTest.java | 7 +++----
2 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/0f3a5b4f/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationResponseTest.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationResponseTest.java b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationResponseTest.java
index f194e11..48063ce 100644
--- a/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationResponseTest.java
+++ b/plugins/core/src/test/java/org/apache/cxf/fediz/core/federation/FederationResponseTest.java
@@ -44,7 +44,6 @@ import org.apache.cxf.fediz.core.KeystoreCallbackHandler;
import org.apache.cxf.fediz.core.SAML1CallbackHandler;
import org.apache.cxf.fediz.core.SAML2CallbackHandler;
import org.apache.cxf.fediz.core.TokenValidator;
-import org.apache.cxf.fediz.core.config.FederationProtocol;
import org.apache.cxf.fediz.core.config.FedizConfigurator;
import org.apache.cxf.fediz.core.config.FedizContext;
import org.apache.cxf.fediz.core.config.Protocol;
@@ -611,8 +610,8 @@ public class FederationResponseTest {
configurator = null;
FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
- FederationProtocol fp = (FederationProtocol)config.getProtocol();
- fp.setRoleDelimiter(",");
+ Protocol protocol = config.getProtocol();
+ protocol.setRoleDelimiter(",");
FedizProcessor wfProc = new FederationProcessorImpl();
FedizResponse wfRes = wfProc.processRequest(wfReq, config);
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/0f3a5b4f/plugins/core/src/test/java/org/apache/cxf/fediz/core/samlsso/SAMLResponseTest.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/test/java/org/apache/cxf/fediz/core/samlsso/SAMLResponseTest.java b/plugins/core/src/test/java/org/apache/cxf/fediz/core/samlsso/SAMLResponseTest.java
index 4a8fa6a..7a1f474 100644
--- a/plugins/core/src/test/java/org/apache/cxf/fediz/core/samlsso/SAMLResponseTest.java
+++ b/plugins/core/src/test/java/org/apache/cxf/fediz/core/samlsso/SAMLResponseTest.java
@@ -586,14 +586,13 @@ public class SAMLResponseTest {
/**
* Validate SAML 2 token which includes the role attribute with 2 values
* Roles are encoded as a single saml attribute with encoded value
- *
- * TODO
*/
@org.junit.Test
- @org.junit.Ignore
public void validateSAML2TokenRoleEncodedValue() throws Exception {
// Mock up a Request
FedizContext config = getFederationConfigurator().getFedizContext("ROOT");
+ Protocol protocol = config.getProtocol();
+ protocol.setRoleDelimiter(",");
String requestId = URLEncoder.encode(UUID.randomUUID().toString(), "UTF-8");
@@ -616,7 +615,6 @@ public class SAMLResponseTest {
callbackHandler.setIssuer(TEST_IDP_ISSUER);
callbackHandler.setSubjectName(TEST_USER);
callbackHandler.setMultiValueType(MultiValue.ENC_VALUE);
-
String responseStr = createSamlResponseStr(callbackHandler, requestId);
HttpServletRequest req = EasyMock.createMock(HttpServletRequest.class);
@@ -635,6 +633,7 @@ public class SAMLResponseTest {
Assert.assertEquals("Principal name wrong", TEST_USER,
wfRes.getUsername());
Assert.assertEquals("Issuer wrong", TEST_IDP_ISSUER, wfRes.getIssuer());
+ System.out.println("ROLE: " + wfRes.getRoles().get(0));
Assert.assertEquals("Two roles must be found", 2, wfRes.getRoles().size());
Assert.assertEquals("Audience wrong", TEST_REQUEST_URL, wfRes.getAudience());
assertClaims(wfRes.getClaims(), callbackHandler.getRoleAttributeName());