Author: coheigea
Date: Fri Feb  9 11:08:44 2018
New Revision: 1823638

URL: http://svn.apache.org/viewvc?rev=1823638&view=rev
Log:
Adding a test for WSS-623. This closes #10.

Modified:
    
webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/NameIDBean.java
    
webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenTest.java

Modified: 
webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/NameIDBean.java
URL: 
http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/NameIDBean.java?rev=1823638&r1=1823637&r2=1823638&view=diff
==============================================================================
--- 
webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/NameIDBean.java
 (original)
+++ 
webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/bean/NameIDBean.java
 Fri Feb  9 11:08:44 2018
@@ -126,6 +126,12 @@ public class NameIDBean {
             return false;
         }
 
+        if (spNameQualifier == null && that.spNameQualifier != null) {
+            return false;
+        } else if (spNameQualifier != null && 
!spNameQualifier.equals(that.spNameQualifier)) {
+            return false;
+        }
+
         if (spProvidedID == null && that.spProvidedID != null) {
             return false;
         } else if (spProvidedID != null && 
!spProvidedID.equals(that.spProvidedID)) {
@@ -150,6 +156,9 @@ public class NameIDBean {
         if (nameQualifier != null) {
             result = 31 * result + nameQualifier.hashCode();
         }
+        if (spNameQualifier != null) {
+            result = 31 * result + spNameQualifier.hashCode();
+        }
         if (spProvidedID != null) {
             result = 31 * result + spProvidedID.hashCode();
         }

Modified: 
webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenTest.java
URL: 
http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenTest.java?rev=1823638&r1=1823637&r2=1823638&view=diff
==============================================================================
--- 
webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenTest.java
 (original)
+++ 
webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenTest.java
 Fri Feb  9 11:08:44 2018
@@ -725,6 +725,7 @@ public class SamlTokenTest extends org.j
         
nameID.setNameIDFormat("urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified");
         nameID.setNameQualifier("confirmationNameQualifier");
         nameID.setNameValue("confirmationNameQualifierValue");
+        nameID.setSPNameQualifier("spNameQualifier");
         callbackHandler.setSubjectConfirmationNameID(nameID);
 
         SAMLCallback samlCallback = new SAMLCallback();


Reply via email to