cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbernha...@apache.org
Subject git commit: Extending unit test for ClaimUtils
Date Tue, 07 Oct 2014 12:20:57 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 19fd73788 -> b54c3b340


Extending unit test for ClaimUtils


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/b54c3b34
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/b54c3b34
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/b54c3b34

Branch: refs/heads/3.0.x-fixes
Commit: b54c3b340037763679975e2d7673ac4350e65334
Parents: 19fd737
Author: Jan Bernhardt <jbernhardt@talend.com>
Authored: Tue Oct 7 14:11:21 2014 +0200
Committer: Jan Bernhardt <jbernhardt@talend.com>
Committed: Tue Oct 7 14:16:28 2014 +0200

----------------------------------------------------------------------
 .../test/resources/jexlClaimMappingsWithFunctions.script | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b54c3b34/services/sts/sts-core/src/test/resources/jexlClaimMappingsWithFunctions.script
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/test/resources/jexlClaimMappingsWithFunctions.script
b/services/sts/sts-core/src/test/resources/jexlClaimMappingsWithFunctions.script
index 4f25bd9..ccbd3e6 100644
--- a/services/sts/sts-core/src/test/resources/jexlClaimMappingsWithFunctions.script
+++ b/services/sts/sts-core/src/test/resources/jexlClaimMappingsWithFunctions.script
@@ -58,10 +58,19 @@
     var unfilterClaim = claims:create("http://my.schema.org/identity/claims/filter", "different",
"match", "second_match", "other");
     var filterClaim = claims:filterValues(unfilterClaim, ".*match");
 	
+	// Test with claims not available in sourceClaims -> should not result in an error
+    var nullClaim = claims:get(sourceClaims, 'resultShouldBeNull');
+    nullClaim = claims:mapValues(nullClaim, roleMappings, false);
+	nullClaim = claims:upperCaseValues(nullClaim);
+	nullClaim = claims:lowerCaseValues(nullClaim);
+	nullClaim = claims:singleToMultiValue(nullClaim, ",");
+	nullClaim = claims:multiToSingleValue(nullClaim, ",");
+	nullClaim = claims:filterValues(nullClaim, ".*match");
+	
     // Collect claims for new token
     targetClaims = claims:add(targetClaims, mappedRoles, mergedClaim, idpClaim);
     targetClaims = claims:add(targetClaims, uppercaseClaim, lowercaseClaim, wrappedUppercaseClaim,
emailClaim);
-	targetClaims = claims:add(targetClaims, singleValue, multiValue, filterClaim);
+	targetClaims = claims:add(targetClaims, singleValue, multiValue, filterClaim, nullClaim);
     
     // Set correct issuer
     targetClaims = claims:updateIssuer(targetClaims, claimsParameters.stsProperties.issuer);


Mime
View raw message