10
10
import hudson .Util ;
11
11
import hudson .model .UnprotectedRootAction ;
12
12
import hudson .security .csrf .CrumbExclusion ;
13
+ import jakarta .servlet .FilterChain ;
14
+ import jakarta .servlet .ServletException ;
15
+ import jakarta .servlet .http .HttpServletRequest ;
16
+ import jakarta .servlet .http .HttpServletResponse ;
13
17
import java .io .IOException ;
14
18
import java .net .URL ;
15
19
import java .util .Arrays ;
16
- import javax .servlet .FilterChain ;
17
- import javax .servlet .ServletException ;
18
- import javax .servlet .http .HttpServletRequest ;
19
- import javax .servlet .http .HttpServletResponse ;
20
20
import jenkins .model .Jenkins ;
21
21
import org .htmlunit .FailingHttpStatusCodeException ;
22
22
import org .htmlunit .HttpMethod ;
31
31
import org .jvnet .hudson .test .JenkinsRule ;
32
32
import org .jvnet .hudson .test .MockAuthorizationStrategy ;
33
33
import org .jvnet .hudson .test .TestExtension ;
34
- import org .kohsuke .stapler .StaplerRequest ;
35
- import org .kohsuke .stapler .StaplerResponse ;
34
+ import org .kohsuke .stapler .StaplerRequest2 ;
35
+ import org .kohsuke .stapler .StaplerResponse2 ;
36
36
import org .xml .sax .SAXException ;
37
37
38
38
public class EndpointTest {
@@ -103,7 +103,7 @@ private String appendCrumb(String url) {
103
103
}
104
104
105
105
private String getCrumb () {
106
- return Functions .getCrumbRequestField () + "=" + Functions .getCrumb (null );
106
+ return Functions .getCrumbRequestField () + "=" + Functions .getCrumb (( StaplerRequest2 ) null );
107
107
}
108
108
109
109
private Page post (String relative , String userName ) throws Exception {
@@ -116,8 +116,8 @@ private Page post(String relative, String userName) throws Exception {
116
116
117
117
final WebRequest request = new WebRequest (new URL (client .getContextPath () + relative ), HttpMethod .POST );
118
118
request .setAdditionalHeader ("Accept" , client .getBrowserVersion ().getHtmlAcceptHeader ());
119
- request .setRequestParameters (
120
- Arrays . asList ( new NameValuePair (Functions .getCrumbRequestField (), Functions .getCrumb (null ))));
119
+ request .setRequestParameters (Arrays . asList (
120
+ new NameValuePair (Functions .getCrumbRequestField (), Functions .getCrumb (( StaplerRequest2 ) null ))));
121
121
return client .getPage (request );
122
122
}
123
123
@@ -141,7 +141,7 @@ public String getUrlName() {
141
141
return "testroot" ;
142
142
}
143
143
144
- public void doIndex (StaplerRequest request , StaplerResponse response ) throws IOException {
144
+ public void doIndex (StaplerRequest2 request , StaplerResponse2 response ) throws IOException {
145
145
visited = true ;
146
146
response .getWriter ().println ("OK" );
147
147
}
0 commit comments