[java-identity-provider] branch main updated: Port tests to Jetty 12.
Scott Cantor
cantor.2 at osu.edu
Tue Apr 8 13:09:11 UTC 2025
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=89d1f6b591bd451f83c8a32d30010381a425e217
The following commit(s) were added to refs/heads/main by this push:
new 89d1f6b59 Port tests to Jetty 12.
89d1f6b59 is described below
commit 89d1f6b591bd451f83c8a32d30010381a425e217
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Apr 8 09:09:07 2025 -0400
Port tests to Jetty 12.
---
idp-cas-impl/pom.xml | 2 +-
.../proxy/impl/HttpClientProxyValidatorTest.java | 27 +++++++++-------------
2 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/idp-cas-impl/pom.xml b/idp-cas-impl/pom.xml
index 9c3ec79ec..ad7abffcd 100644
--- a/idp-cas-impl/pom.xml
+++ b/idp-cas-impl/pom.xml
@@ -16,7 +16,7 @@
<packaging>jar</packaging>
<properties>
- <jetty.version>11.0.9</jetty.version>
+ <jetty.version>12.0.19</jetty.version>
<automatic.module.name>net.shibboleth.idp.cas.impl</automatic.module.name>
</properties>
diff --git a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidatorTest.java b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidatorTest.java
index 38f06b2b0..dd6a7a7dc 100644
--- a/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidatorTest.java
+++ b/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidatorTest.java
@@ -17,7 +17,6 @@ package net.shibboleth.idp.cas.proxy.impl;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
-import java.io.IOException;
import java.net.InetAddress;
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
@@ -33,17 +32,15 @@ import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.security.auth.login.FailedLoginException;
-import jakarta.servlet.ServletException;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
import org.apache.hc.client5.http.SystemDefaultDnsResolver;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
+import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.server.handler.AbstractHandler;
+import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.opensaml.profile.context.ProfileRequestContext;
import org.springframework.beans.factory.annotation.Autowired;
@@ -52,6 +49,8 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
+import com.google.common.net.HttpHeaders;
+
import net.shibboleth.idp.cas.flow.impl.AbstractFlowActionTest;
import net.shibboleth.idp.cas.protocol.ProtocolContext;
import net.shibboleth.idp.cas.service.Service;
@@ -206,7 +205,7 @@ public class HttpClientProxyValidatorTest extends AbstractFlowActionTest {
return server;
}
- private static class ConfigurableStatusHandler extends AbstractHandler {
+ private static class ConfigurableStatusHandler extends Handler.Abstract {
final int status;
@@ -214,17 +213,13 @@ public class HttpClientProxyValidatorTest extends AbstractFlowActionTest {
status = s;
}
+ /** {@inheritDoc} */
@Override
- public void handle(
- final String target,
- final Request request,
- final HttpServletRequest servletRequest,
- final HttpServletResponse servletResponse) throws IOException, ServletException {
-
- servletResponse.setContentType("text/plain;charset=utf-8");
- servletResponse.setStatus(status);
- request.setHandled(true);
- servletResponse.getWriter().println("OK");
+ public boolean handle(Request request, Response response, Callback callback) throws Exception {
+ response.getHeaders().add(HttpHeaders.CONTENT_TYPE, "text/plain;charset=utf-8");
+ response.setStatus(status);
+ response.write(true, ByteBuffer.wrap("OK\n".getBytes()), callback);
+ return true;
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list