[java-plugin-shibd-saml] branch main updated: Unit test for format mismatch.
Scott Cantor
cantor.2 at osu.edu
Tue Mar 25 15:34:20 UTC 2025
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-plugin-shibd-saml.
View the commit online:
http://git.shibboleth.net/view/?p=java-plugin-shibd-saml.git;a=commit;h=492bbc1014c3806d007023742ac6319911bb21d2
The following commit(s) were added to refs/heads/main by this push:
new 492bbc1 Unit test for format mismatch.
492bbc1 is described below
commit 492bbc1014c3806d007023742ac6319911bb21d2
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Mar 25 11:34:17 2025 -0400
Unit test for format mismatch.
---
.../impl/SAML2StringNameIDTranscoderTest.java | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/sp-saml-impl/src/test/java/net/shibboleth/sp/saml/saml2/nameid/transcoding/impl/SAML2StringNameIDTranscoderTest.java b/sp-saml-impl/src/test/java/net/shibboleth/sp/saml/saml2/nameid/transcoding/impl/SAML2StringNameIDTranscoderTest.java
index 5f0c784..458d72c 100644
--- a/sp-saml-impl/src/test/java/net/shibboleth/sp/saml/saml2/nameid/transcoding/impl/SAML2StringNameIDTranscoderTest.java
+++ b/sp-saml-impl/src/test/java/net/shibboleth/sp/saml/saml2/nameid/transcoding/impl/SAML2StringNameIDTranscoderTest.java
@@ -99,7 +99,7 @@ public class SAML2StringNameIDTranscoderTest extends OpenSAMLInitBaseTestCase {
TranscoderSupport.<NameID>getTranscoder(ruleset).encode(null, inputAttribute, NameID.class, ruleset);
}
- @Test public void emptyDecode() throws Exception {
+ @Test public void noValue() throws Exception {
final NameID nameID = nameIDBuilder.buildObject();
Collection<TranscodingRule> rulesets = registry.getTranscodingRules(nameID);
@@ -117,6 +117,20 @@ public class SAML2StringNameIDTranscoderTest extends OpenSAMLInitBaseTestCase {
Assert.assertEquals(attr.getId(), ID);
Assert.assertTrue(attr.getValues().isEmpty());
}
+
+ @Test public void wrongFormat() throws Exception {
+
+ final NameID nameID = nameIDBuilder.buildObject();
+ Collection<TranscodingRule> rulesets = registry.getTranscodingRules(nameID);
+ Assert.assertEquals(rulesets.size(), 0);
+
+ nameID.setFormat("Wrong");
+ nameID.setNameQualifier(STRING_2);
+ nameID.setValue(STRING_1);
+
+ rulesets = registry.getTranscodingRules(nameID);
+ Assert.assertTrue(rulesets.isEmpty());
+ }
@Test public void decode() throws Exception {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list