This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/master by this push:
new 65135b2e32 Fixing OIDC and OAuth2 WA SRA tests
65135b2e32 is described below
commit 65135b2e325cb91ae98cd44652c6895d0aa5e684
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Fri Jan 24 17:40:21 2025 +0100
Fixing OIDC and OAuth2 WA SRA tests
---
.../src/test/java/org/apache/syncope/fit/sra/OIDCSRAITCase.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git
a/fit/wa-reference/src/test/java/org/apache/syncope/fit/sra/OIDCSRAITCase.java
b/fit/wa-reference/src/test/java/org/apache/syncope/fit/sra/OIDCSRAITCase.java
index 3396b84c7e..0ef72a1366 100644
---
a/fit/wa-reference/src/test/java/org/apache/syncope/fit/sra/OIDCSRAITCase.java
+++
b/fit/wa-reference/src/test/java/org/apache/syncope/fit/sra/OIDCSRAITCase.java
@@ -43,8 +43,8 @@ import java.lang.invoke.MethodHandles;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Properties;
-import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.apache.cxf.jaxrs.client.WebClient;
@@ -258,6 +258,7 @@ public class OIDCSRAITCase extends AbstractSRAITCase {
checkLogout(response);
}
+ @SuppressWarnings("unchecked")
private void checkJWT(final String token, final boolean idToken) throws
ParseException {
assertNotNull(token);
SignedJWT jwt = SignedJWT.parse(token);
@@ -271,7 +272,11 @@ public class OIDCSRAITCase extends AbstractSRAITCase {
assertEquals("Verdi", idTokenClaimsSet.getStringClaim("family_name"));
assertEquals("Giuseppe",
idTokenClaimsSet.getStringClaim("given_name"));
assertEquals("Giuseppe Verdi",
idTokenClaimsSet.getStringClaim("name"));
- assertEquals(Set.of("root", "child", "citizen"),
Set.of(idTokenClaimsSet.getStringArrayClaim("groups")));
+ List<Object> groups = idTokenClaimsSet.getListClaim("groups");
+ assertEquals(3, groups.size());
+ groups.stream().anyMatch(g -> ((Map<String, String>)
g).equals(Map.of("groupName", "root")));
+ groups.stream().anyMatch(g -> ((Map<String, String>)
g).equals(Map.of("groupName", "child")));
+ groups.stream().anyMatch(g -> ((Map<String, String>)
g).equals(Map.of("groupName", "citizen")));
}
protected boolean checkIdToken() {