From 2ece45a5814d1a893486a9c69a2c13e9cf3cc6b0 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Wed, 14 Aug 2024 11:29:52 -0700 Subject: [PATCH] [JENKINS-73316] Adapt SAML plugin for Jetty 12 (EE 9) --- pom.xml | 12 +++++++++++- .../jenkinsci/plugins/saml/OpenSamlWrapperTest.java | 8 ++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 5b102c5d..172b8a6e 100644 --- a/pom.xml +++ b/pom.xml @@ -46,9 +46,13 @@ under the License. 4 999999-SNAPSHOT - 2.401.3 + + 2.473-rc35228.0934d942a_85d jenkinsci/${project.artifactId}-plugin 3.343.vb_63a_6c3df23c + + 2254.vcff7a_d4969e5 + 17 @@ -300,6 +304,12 @@ under the License. pom import + + + jakarta.servlet + jakarta.servlet-api + 5.0.0 + org.apache.santuario xmlsec diff --git a/src/test/java/org/jenkinsci/plugins/saml/OpenSamlWrapperTest.java b/src/test/java/org/jenkinsci/plugins/saml/OpenSamlWrapperTest.java index d2c8b23c..7be1f565 100644 --- a/src/test/java/org/jenkinsci/plugins/saml/OpenSamlWrapperTest.java +++ b/src/test/java/org/jenkinsci/plugins/saml/OpenSamlWrapperTest.java @@ -23,10 +23,10 @@ import org.junit.Test; import org.jvnet.hudson.test.JenkinsRule; import org.kohsuke.stapler.HttpResponse; -import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.StaplerResponse2; import org.mockito.Mockito; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; @@ -60,7 +60,7 @@ public void metadataWrapper() throws IOException, ServletException { jenkinsRule.jenkins.setSecurityRealm(samlSecurity); SamlSPMetadataWrapper samlSPMetadataWrapper = new SamlSPMetadataWrapper(samlSecurity.getSamlPluginConfig(), null, null); HttpResponse process = samlSPMetadataWrapper.get(); - StaplerResponse mockResponse = Mockito.mock(StaplerResponse.class); + StaplerResponse2 mockResponse = Mockito.mock(StaplerResponse2.class); StringWriter stringWriter = new StringWriter(); when(mockResponse.getWriter()).thenReturn(new PrintWriter(stringWriter)); process.generateResponse(null, mockResponse, null); @@ -89,7 +89,7 @@ public void metadataWrapperWitEncrytionConfigured() throws IOException, ServletE jenkinsRule.jenkins.setSecurityRealm(samlSecurity); SamlSPMetadataWrapper samlSPMetadataWrapper = new SamlSPMetadataWrapper(samlSecurity.getSamlPluginConfig(), null, null); HttpResponse process = samlSPMetadataWrapper.get(); - StaplerResponse mockResponse = Mockito.mock(StaplerResponse.class); + StaplerResponse2 mockResponse = Mockito.mock(StaplerResponse2.class); StringWriter stringWriter = new StringWriter(); when(mockResponse.getWriter()).thenReturn(new PrintWriter(stringWriter)); process.generateResponse(null, mockResponse, null);