This is an automated email from the ASF dual-hosted git repository.
jungm pushed a commit to branch tomee-10.x
in repository https://gitbox.apache.org/repos/asf/tomee.git
The following commit(s) were added to refs/heads/tomee-10.x by this push:
new 5906fc0d76 Fix deployment errors in tests
5906fc0d76 is described below
commit 5906fc0d76a34b671242f7cda3395dff8b2af2e5
Author: Markus Jung <[email protected]>
AuthorDate: Sun Mar 22 09:47:48 2026 +0100
Fix deployment errors in tests
---
.../main/java/org/apache/tomee/security/http/SavedRequest.java | 9 ++++++---
.../tomee/security/cdi/OpenIdAuthenticationMechanismTest.java | 10 +---------
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git
a/tomee/tomee-security/src/main/java/org/apache/tomee/security/http/SavedRequest.java
b/tomee/tomee-security/src/main/java/org/apache/tomee/security/http/SavedRequest.java
index 9e6c95df00..f58e07b983 100644
---
a/tomee/tomee-security/src/main/java/org/apache/tomee/security/http/SavedRequest.java
+++
b/tomee/tomee-security/src/main/java/org/apache/tomee/security/http/SavedRequest.java
@@ -61,9 +61,12 @@ public class SavedRequest implements Serializable {
public static SavedRequest fromRequest(HttpServletRequest request) {
Map<String, List<String>> headers = new HashMap<>();
Enumeration<String> headerNames = request.getHeaderNames();
- while (headerNames.hasMoreElements()) {
- String name = headerNames.nextElement();
- headers.put(name, Collections.list(request.getHeaders(name)));
+
+ if (headerNames != null) {
+ while (headerNames.hasMoreElements()) {
+ String name = headerNames.nextElement();
+ headers.put(name, Collections.list(request.getHeaders(name)));
+ }
}
SavedRequest result = new SavedRequest();
diff --git
a/tomee/tomee-security/src/test/java/org/apache/tomee/security/cdi/OpenIdAuthenticationMechanismTest.java
b/tomee/tomee-security/src/test/java/org/apache/tomee/security/cdi/OpenIdAuthenticationMechanismTest.java
index 5f8b369aa5..c836bf5cf1 100644
---
a/tomee/tomee-security/src/test/java/org/apache/tomee/security/cdi/OpenIdAuthenticationMechanismTest.java
+++
b/tomee/tomee-security/src/test/java/org/apache/tomee/security/cdi/OpenIdAuthenticationMechanismTest.java
@@ -47,7 +47,7 @@ import static org.mockito.Mockito.when;
@Vetoed
@RunWith(ApplicationComposer.class)
-@Classes(cdi = true, value =
{OpenIdAuthenticationMechanismTest.TestOpenIdAuthenticationMechanism.class,
TomEEOpenIdContext.class,
OpenIdAuthenticationMechanismTest.SimpleStorageHandler.class})
+@Classes(cdi = true, value = {OpenIdAuthenticationMechanism.class,
TomEEOpenIdContext.class,
OpenIdAuthenticationMechanismTest.SimpleStorageHandler.class})
public class OpenIdAuthenticationMechanismTest {
@Inject
@@ -156,14 +156,6 @@ public class OpenIdAuthenticationMechanismTest {
authenticationMechanism.refreshTokens(request, response,
messageContext));
}
- @ApplicationScoped
- public static class TestOpenIdAuthenticationMechanism extends
OpenIdAuthenticationMechanism {
- @Override
- public void cleanSubject(HttpServletRequest request,
HttpServletResponse response, HttpMessageContext httpMessageContext) {
- // no-op for this focused failure-path test
- }
- }
-
@ApplicationScoped
protected static class SimpleStorageHandler extends OpenIdStorageHandler {