[java-idp-integration-tests] branch main updated: Fix client-storage test by triggering cookie write

Tom Zeller tzeller at dragonacea.biz
Fri Aug 2 14:03:51 UTC 2024


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

tzeller pushed a commit to branch main
in repository java-idp-integration-tests.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-integration-tests.git;a=commit;h=124d58ac62c78968b975fc692fafca1fc62dbc28

The following commit(s) were added to refs/heads/main by this push:
     new 124d58a  Fix client-storage test by triggering cookie write
124d58a is described below

commit 124d58ac62c78968b975fc692fafca1fc62dbc28
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Fri Aug 2 09:03:40 2024 -0500

    Fix client-storage test by triggering cookie write
    
    Display output to make
    net.shiboleth.shared.spring.servlet.impl.CookieBufferingFilter actually
    write the cookie.
    
    https://shibboleth.atlassian.net/browse/JSSH-52
---
 .../tests/clientstorage/ClientStorageTest.java     | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/src/test/java/net/shibboleth/idp/integration/tests/clientstorage/ClientStorageTest.java b/src/test/java/net/shibboleth/idp/integration/tests/clientstorage/ClientStorageTest.java
index 1c7acb7..8c5f5c7 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/clientstorage/ClientStorageTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/clientstorage/ClientStorageTest.java
@@ -18,6 +18,7 @@
 package net.shibboleth.idp.integration.tests.clientstorage;
 
 import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.time.Duration;
 
 import javax.annotation.Nonnull;
@@ -115,6 +116,40 @@ public class ClientStorageTest extends BaseIntegrationTest {
         buildWAR();
     }
 
+    /**
+     * Fix client-storage test by triggering cookie write
+     * 
+     * Display output to make
+     * net.shiboleth.shared.spring.servlet.impl.CookieBufferingFilter actually write
+     * the cookie.
+     *
+     * https://shibboleth.atlassian.net/browse/JSSH-52
+     * 
+     * Only necessary for IdP 5.1.x.
+     * 
+     * @throws Exception
+     *             if an error occurs
+     */
+    @BeforeClass(dependsOnMethods = { "setUpIdPPaths" })
+    public void setUpTestFlow() throws Exception {
+        if (idpVersion.startsWith("5.1")) {
+            final Path pathToTestFlow = Paths.get("flows", "test", "client-storage", "write",
+                    "client-storage-write-test-flow.xml");
+
+            final String oldText = // 
+                    "    <end-state id=\"Done\" />";
+            
+            final String newText = //
+                    "    <end-state id=\"Done\" >" + //
+                    "        <on-entry>\n" + //
+                    "            <evaluate expression=\"flowRequestContext.getExternalContext().getNativeResponse().getWriter().println('OK')\" />\n" + //
+                    "        </on-entry>\n" + //                    
+                    "    </end-state>";
+
+            replaceIdPHomeFile(pathToTestFlow, oldText, newText);
+        }
+    }
+    
     /**
      * Initialize client storage by executing the test client-storage/read flow.
      */

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


More information about the commits mailing list