You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jf...@apache.org on 2023/06/09 13:29:11 UTC
[tomee] branch main updated: Add SavedAuthenticationTest and SavedRequestTest to ensure referenced objects implement Serializable
This is an automated email from the ASF dual-hosted git repository.
jfisher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomee.git
The following commit(s) were added to refs/heads/main by this push:
new 4f033942ce Add SavedAuthenticationTest and SavedRequestTest to ensure referenced objects implement Serializable
4f033942ce is described below
commit 4f033942ce2c3417f31437c57b0f0ba29005618a
Author: Jonathan S. Fisher <ex...@gmail.com>
AuthorDate: Fri Jun 9 08:26:33 2023 -0500
Add SavedAuthenticationTest and SavedRequestTest to ensure referenced objects implement Serializable
(cherry picked from commit 788d394fda9c56c81454db8edc1ba29eadecfe3c)
(cherry picked from commit b587763a553df28ee7f98e9497c978491e838f79)
---
.../tomee/security/http/SavedAuthenticationTest.java | 18 ++++++++++++++++++
.../apache/tomee/security/http/SavedRequestTest.java | 16 ++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/tomee/tomee-security/src/test/java/org/apache/tomee/security/http/SavedAuthenticationTest.java b/tomee/tomee-security/src/test/java/org/apache/tomee/security/http/SavedAuthenticationTest.java
new file mode 100644
index 0000000000..fe667d0b61
--- /dev/null
+++ b/tomee/tomee-security/src/test/java/org/apache/tomee/security/http/SavedAuthenticationTest.java
@@ -0,0 +1,18 @@
+package org.apache.tomee.security.http;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.Serializable;
+import java.util.HashSet;
+
+import org.junit.Test;
+
+public class SavedAuthenticationTest {
+
+ @Test
+ public void testSerializable() {
+ final SavedAuthentication savedAuthentication = new SavedAuthentication(null, new HashSet<>());
+ assertTrue("SavedAuthentication must implement Serializable, since it will be set as a session attribute",
+ savedAuthentication instanceof Serializable);
+ }
+}
diff --git a/tomee/tomee-security/src/test/java/org/apache/tomee/security/http/SavedRequestTest.java b/tomee/tomee-security/src/test/java/org/apache/tomee/security/http/SavedRequestTest.java
new file mode 100644
index 0000000000..5583cd35f4
--- /dev/null
+++ b/tomee/tomee-security/src/test/java/org/apache/tomee/security/http/SavedRequestTest.java
@@ -0,0 +1,16 @@
+package org.apache.tomee.security.http;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.Serializable;
+
+import org.junit.Test;
+
+public class SavedRequestTest {
+ @Test
+ public void testSerializable() {
+ final SavedRequest savedRequest = new SavedRequest();
+ assertTrue("SavedRequest must implement Serializable, since it will be set as a session attribute",
+ savedRequest instanceof Serializable);
+ }
+}