[java-shib-profile] branch main updated: Remove use of Deprecated AttributeContext setters from tests
Codeberg
noreply at shibboleth.net
Sun Oct 18 14:54:02 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-shib-profile.
View the commit online:
https://codeberg.org/Shibboleth/java-shib-profile/commit/eeb4c47f1756ad15d9a078f00c66cb7cd5bf1ced
The following commit(s) were added to refs/heads/main by this push:
new eeb4c47 Remove use of Deprecated AttributeContext setters from tests
eeb4c47 is described below
commit eeb4c47f1756ad15d9a078f00c66cb7cd5bf1ced
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun Oct 18 15:54:18 2026 +0100
Remove use of Deprecated AttributeContext setters from tests
---
.../profile/context/logic/DateAttributePredicateTest.java | 14 ++++++++------
.../context/logic/DynamicAttributePredicateTest.java | 4 ++--
.../context/logic/SimpleAttributePredicateTest.java | 4 ++--
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/DateAttributePredicateTest.java b/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/DateAttributePredicateTest.java
index 2394405..281ae45 100644
--- a/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/DateAttributePredicateTest.java
+++ b/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/DateAttributePredicateTest.java
@@ -14,13 +14,19 @@
package net.shibboleth.profile.context.logic;
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
import java.time.Instant;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;
+import org.opensaml.profile.context.ProfileRequestContext;
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
import net.shibboleth.idp.attribute.DateTimeAttributeValue;
import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.IdPAttributeValue;
@@ -29,10 +35,6 @@ import net.shibboleth.idp.attribute.context.AttributeContext;
import net.shibboleth.profile.context.RelyingPartyContext;
import net.shibboleth.shared.collection.CollectionSupport;
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
/**
* Unit test for {@link DateAttributePredicate}.
@@ -127,7 +129,7 @@ public class DateAttributePredicateTest {
attribute.setValues(attributeValues);
final AttributeContext ac = new AttributeContext();
ac.setIdPAttributes(CollectionSupport.singletonList(attribute));
- ac.setUnfilteredIdPAttributes(CollectionSupport.singletonList(attribute));
+ ac.setUnfilteredIdPAttributes(CollectionSupport.singletonMap(attribute.getId(), attribute));
rpc.addSubcontext(ac);
prc.addSubcontext(rpc);
return prc;
diff --git a/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/DynamicAttributePredicateTest.java b/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/DynamicAttributePredicateTest.java
index 2b63a66..df11f22 100644
--- a/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/DynamicAttributePredicateTest.java
+++ b/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/DynamicAttributePredicateTest.java
@@ -87,8 +87,8 @@ public class DynamicAttributePredicateTest {
}
attribute.setValues(attributeValues);
final AttributeContext ac = new AttributeContext();
- ac.setIdPAttributes(CollectionSupport.singletonList(attribute));
- ac.setUnfilteredIdPAttributes(CollectionSupport.singletonList(attribute));
+ ac.setIdPAttributes(CollectionSupport.singletonMap(attribute.getId(), attribute));
+ ac.setUnfilteredIdPAttributes(CollectionSupport.singletonMap(attribute.getId(), attribute));
rpc.addSubcontext(ac);
prc.addSubcontext(rpc);
return prc;
diff --git a/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/SimpleAttributePredicateTest.java b/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/SimpleAttributePredicateTest.java
index 6f4963e..27b9862 100644
--- a/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/SimpleAttributePredicateTest.java
+++ b/shib-profile-api/src/test/java/net/shibboleth/profile/context/logic/SimpleAttributePredicateTest.java
@@ -105,8 +105,8 @@ public class SimpleAttributePredicateTest {
}
attribute.setValues(attributeValues);
final AttributeContext ac = new AttributeContext();
- ac.setIdPAttributes(CollectionSupport.singletonList(attribute));
- ac.setUnfilteredIdPAttributes(CollectionSupport.singletonList(attribute));
+ ac.setIdPAttributes(CollectionSupport.singletonMap(attribute.getId(), attribute));
+ ac.setUnfilteredIdPAttributes(CollectionSupport.singletonMap(attribute.getId(), attribute));
rpc.addSubcontext(ac);
prc.addSubcontext(rpc);
return prc;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list