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:23:53 GMT
Repository: cxf
Updated Branches:
  refs/heads/master aa237f26f -> 7a28ae166


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/7a28ae16
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7a28ae16
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7a28ae16

Branch: refs/heads/master
Commit: 7a28ae1667bf3a6581f30c801f2a911b14c436ae
Parents: aa237f2
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:21:48 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/7a28ae16/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