[java-plugin-shibd] branch main updated: Add missing mock.
Codeberg
noreply at shibboleth.net
Tue Apr 21 21:21:36 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-plugin-shibd.
View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd/commit/9daf0dafed4ba9be9bc6711dd18c3f078ae50c69
The following commit(s) were added to refs/heads/main by this push:
new 9daf0da Add missing mock.
9daf0da is described below
commit 9daf0dafed4ba9be9bc6711dd18c3f078ae50c69
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Tue Apr 21 17:21:23 2026 -0400
Add missing mock.
---
.../authn/impl/InitializeAgentRequestContextTest.java | 17 +++++++++++++++++
.../sp/profile/impl/BaseAgentRequestTest.java | 16 ++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/sp-server-impl/src/test/java/net/shibboleth/sp/authn/impl/InitializeAgentRequestContextTest.java b/sp-server-impl/src/test/java/net/shibboleth/sp/authn/impl/InitializeAgentRequestContextTest.java
index 45101b4..ea93a8a 100644
--- a/sp-server-impl/src/test/java/net/shibboleth/sp/authn/impl/InitializeAgentRequestContextTest.java
+++ b/sp-server-impl/src/test/java/net/shibboleth/sp/authn/impl/InitializeAgentRequestContextTest.java
@@ -15,12 +15,15 @@
package net.shibboleth.sp.authn.impl;
import org.opensaml.profile.context.ProfileRequestContext;
+import org.opensaml.storage.impl.MemoryStorageService;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+import com.fasterxml.jackson.databind.json.JsonMapper;
+
import net.shibboleth.idp.authn.AuthnEventIds;
import net.shibboleth.idp.authn.context.AuthenticationContext;
import net.shibboleth.idp.authn.context.UsernamePasswordContext;
@@ -33,6 +36,7 @@ import net.shibboleth.sp.context.AgentRequestContext;
import net.shibboleth.sp.impl.BasicAgent;
import net.shibboleth.sp.impl.PassthroughStateTokenManager;
import net.shibboleth.sp.impl.ProtocolSupportServiceManager;
+import net.shibboleth.sp.state.impl.StorageServiceStateManager;
import net.shibboleth.sp.testing.MockAgentResolver;
/**
@@ -62,8 +66,21 @@ public class InitializeAgentRequestContextTest {
manager.setId("test");
manager.initialize();
agent.setStateTokenManager(manager);
+
+ final MemoryStorageService storage = new MemoryStorageService();
+ storage.setId("test");
+ storage.initialize();
+
+ final StorageServiceStateManager manager2 = new StorageServiceStateManager();
+ manager2.setId("test");
+ manager2.setObjectMapper(new JsonMapper());
+ manager2.setStorageService(storage);
+ manager2.initialize();
+ agent.setStateManager(manager2);
+
agent.initialize();
+
action = new InitializeAgentRequestContext();
action.setAgentResolver(MockAgentResolver.getMockResolverService(agent));
action.initialize();
diff --git a/sp-server-impl/src/test/java/net/shibboleth/sp/profile/impl/BaseAgentRequestTest.java b/sp-server-impl/src/test/java/net/shibboleth/sp/profile/impl/BaseAgentRequestTest.java
index 92ae364..91bdae5 100644
--- a/sp-server-impl/src/test/java/net/shibboleth/sp/profile/impl/BaseAgentRequestTest.java
+++ b/sp-server-impl/src/test/java/net/shibboleth/sp/profile/impl/BaseAgentRequestTest.java
@@ -16,8 +16,11 @@ package net.shibboleth.sp.profile.impl;
import org.opensaml.core.testing.OpenSAMLInitBaseTestCase;
import org.opensaml.profile.context.ProfileRequestContext;
+import org.opensaml.storage.impl.MemoryStorageService;
import org.springframework.webflow.execution.RequestContext;
+import com.fasterxml.jackson.databind.json.JsonMapper;
+
import net.shibboleth.idp.profile.context.navigate.WebflowRequestContextProfileRequestContextLookup;
import net.shibboleth.idp.profile.testing.RequestContextBuilder;
import net.shibboleth.shared.component.ComponentInitializationException;
@@ -26,6 +29,7 @@ import net.shibboleth.sp.context.AgentRequestContext;
import net.shibboleth.sp.impl.BasicAgent;
import net.shibboleth.sp.impl.PassthroughStateTokenManager;
import net.shibboleth.sp.impl.ProtocolSupportServiceManager;
+import net.shibboleth.sp.state.impl.StorageServiceStateManager;
/**
* Base class for unit tests that rely on set up of an agent request.
@@ -58,6 +62,18 @@ public abstract class BaseAgentRequestTest extends OpenSAMLInitBaseTestCase {
manager.initialize();
agent.setStateTokenManager(manager);
+ final MemoryStorageService storage = new MemoryStorageService();
+ storage.setId("test");
+ storage.initialize();
+
+ final StorageServiceStateManager manager2 = new StorageServiceStateManager();
+ manager2.setId("test");
+ manager2.setObjectMapper(new JsonMapper());
+ manager2.setStorageService(storage);
+ manager2.initialize();
+
+ agent.setStateManager(manager2);
+
//agent.initialize();
arc.setAgent(agent);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list