Skip to content

Commit

Permalink
[JENKINS-73316] Adapt SAML plugin for Jetty 12 (EE 9)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Jun 21, 2024
1 parent aa99a80 commit 76d31b1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/jenkins-security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v2
with:
java-cache: '' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate.
java-version: 11 # What version of Java to set up for the build.
java-version: 17 # What version of Java to set up for the build.
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ under the License.
<properties>
<revision>4</revision>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.401.3</jenkins.version>
<!-- TODO JENKINS-73278 https://ci.jenkins.io/job/Core/job/jenkins/job/jakarta/ -->
<jenkins.version>2.464-rc35069.54d5e6a_108a_0</jenkins.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<hpi.compatibleSinceVersion>3.343.vb_63a_6c3df23c</hpi.compatibleSinceVersion>
<!-- TODO JENKINS-73339 until in parent POM -->
<jenkins-test-harness.version>2230.v4fa_477b_634f4</jenkins-test-harness.version>
<maven.compiler.release>17</maven.compiler.release>
</properties>

<licenses>
Expand Down Expand Up @@ -300,6 +304,12 @@ under the License.
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- TODO JENKINS-73339 until in parent POM, work around https://github.com/jenkinsci/plugin-pom/issues/936 -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 76d31b1

Please sign in to comment.