[java-oidfed-common] branch main updated: Fix logging and default mock function result

Codeberg noreply at shibboleth.net
Fri Sep 18 07:46:42 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-oidfed-common.

View the commit online:
https://codeberg.org/Shibboleth/java-oidfed-common/commit/c81c3833b995baf6afceb7077bcae167b7c2275c

The following commit(s) were added to refs/heads/main by this push:
     new c81c383  Fix logging and default mock function result
c81c383 is described below

commit c81c3833b995baf6afceb7077bcae167b7c2275c
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Sep 18 10:46:02 2026 +0300

    Fix logging and default mock function result
---
 .../DefaultTrustChainFetchingStrategy.java         |  3 ++-
 .../DefaultTrustChainFetchingStrategyTest.java     | 26 +++++++++++-----------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/metadata/cache/trustchain/DefaultTrustChainFetchingStrategy.java b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/metadata/cache/trustchain/DefaultTrustChainFetchingStrategy.java
index 5d19f09..088c627 100644
--- a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/metadata/cache/trustchain/DefaultTrustChainFetchingStrategy.java
+++ b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/metadata/cache/trustchain/DefaultTrustChainFetchingStrategy.java
@@ -253,7 +253,8 @@ public class DefaultTrustChainFetchingStrategy extends AbstractIdentifiableIniti
         }
         final Integer maximumAuthorityHints = criteriaToMaximumAuthorityHintsStrategy.apply(criteria);
         if (maximumAuthorityHints == null || maximumLength.intValue() < 1) {
-            log.warn("Could not fetch valid maximum authority hints, it must be greater than 0: {}", maximumLength);
+            log.warn("Could not fetch valid maximum authority hints, it must be greater than 0: {}",
+                    maximumAuthorityHints);
             return null;
         }
 
diff --git a/oidfed-common-impl/src/test/java/net/shibboleth/oidfed/metadata/cache/trustchain/DefaultTrustChainFetchingStrategyTest.java b/oidfed-common-impl/src/test/java/net/shibboleth/oidfed/metadata/cache/trustchain/DefaultTrustChainFetchingStrategyTest.java
index c4fe387..b69c37d 100644
--- a/oidfed-common-impl/src/test/java/net/shibboleth/oidfed/metadata/cache/trustchain/DefaultTrustChainFetchingStrategyTest.java
+++ b/oidfed-common-impl/src/test/java/net/shibboleth/oidfed/metadata/cache/trustchain/DefaultTrustChainFetchingStrategyTest.java
@@ -102,7 +102,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(null);
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         Assert.assertEquals(function.apply(new CriteriaSet()), null);
     }
 
@@ -111,7 +111,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(null);
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         Assert.assertEquals(function.apply(new CriteriaSet()), null);
     }
 
@@ -121,7 +121,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
         when(entityConfigurationCache.get(any())).thenReturn(CollectionSupport.emptyList());
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         Assert.assertEquals(function.apply(new CriteriaSet()), null);
     }
 
@@ -131,7 +131,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
         when(entityConfigurationCache.get(any())).thenThrow(MetadataCacheException.class);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         Assert.assertEquals(function.apply(new CriteriaSet()), null);
     }
 
@@ -140,7 +140,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         final EntityConfigurationContainer ecContainer =
                 ecContainer("mockEntityId", CollectionSupport.emptyList());
         when(entityConfigurationCache.get(any())).thenReturn(CollectionSupport.listOf(ecContainer));
@@ -152,7 +152,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         final EntityConfigurationContainer ecContainer =
                 ecContainer("mockEntityId", CollectionSupport.listOf("https://federation.local/immediate"));
         when(entityConfigurationCache.get(any())).thenReturn(CollectionSupport.listOf(ecContainer));
@@ -167,7 +167,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         final EntityConfigurationContainer ecContainer =
                 ecContainer(leaf, CollectionSupport.listOf(anchor, "https://federation.local/other"));
         final EntityConfigurationContainer authorityContainer =
@@ -196,7 +196,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         final EntityConfigurationContainer ecContainer =
                 ecContainer(leaf, CollectionSupport.listOf(immediate, "https://federation.local/other"));
         final EntityConfigurationContainer immediateContainer =
@@ -227,7 +227,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         final EntityConfigurationContainer ecContainer =
                 ecContainer(leaf, CollectionSupport.listOf(immediate));
         final EntityConfigurationContainer immediateContainer =
@@ -264,7 +264,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(3);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         final EntityConfigurationContainer ecContainer =
                 ecContainer(leaf, CollectionSupport.listOf(immediate));
         final EntityConfigurationContainer immediateContainer =
@@ -300,7 +300,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         final EntityConfigurationContainer ecContainer =
                 ecContainer(leaf, CollectionSupport.listOf(anchor, "https://federation.local/other"));
         final EntityConfigurationContainer authorityContainer =
@@ -330,7 +330,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         final EntityConfigurationContainer ecContainer =
                 ecContainer(leaf, CollectionSupport.listOf(anchor, "https://federation.local/other"));
         final EntityConfigurationContainer authorityContainer =
@@ -413,7 +413,7 @@ public class DefaultTrustChainFetchingStrategyTest {
         when(criteriaToValidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToInvalidContainerLifetimeStrategy.apply(any())).thenReturn(Duration.ofMinutes(5));
         when(criteriaToMaximumChainLengthStrategy.apply(any())).thenReturn(4);
-        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(1);
+        when(criteriaToMaximumAuthorityHintsStrategy.apply(any())).thenReturn(2);
         final EntityConfigurationContainer ecContainer =
                 ecContainer(leaf, CollectionSupport.listOf(anchor1));
         final EntityConfigurationContainer authorityContainer1 =

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list