From bae458a3702144c9e867d12f5f67e385f7ab6147 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Mon, 20 Jan 2025 01:20:17 -0800 Subject: [PATCH] Migrate from EE 8 to EE 9 (#345) --- pom.xml | 8 ++++---- .../plugins/configfiles/ConfigFilesAction.java | 8 ++++---- .../configfiles/ConfigFilesManagement.java | 18 +++++++++--------- .../configfiles/ConfigFilesUIContract.java | 14 +++++++------- .../configfiles/buildwrapper/ManagedFile.java | 2 +- .../folder/FolderConfigFileAction.java | 18 +++++++++--------- .../folder/FolderConfigFileProperty.java | 4 ++-- .../utils/ConfigFileDetailLinkDescription.java | 6 +++--- .../configfiles/utils/DescriptionResponse.java | 8 ++++---- .../plugins/configfiles/Security2203Test.java | 4 ++-- .../folder/FolderConfigFileActionTest.java | 3 ++- .../maven/MavenSettingsConfigTest.java | 5 +++-- .../configfiles/sec/Security2254Test.java | 3 +-- 13 files changed, 51 insertions(+), 50 deletions(-) diff --git a/pom.xml b/pom.xml index 40b1590b..3a299936 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.jenkins-ci.plugins plugin - 4.87 + 5.5 @@ -31,8 +31,8 @@ 999999-SNAPSHOT jenkinsci/${project.artifactId}-plugin - 2.414 - ${jenkins.baseline}.3 + 2.479 + ${jenkins.baseline}.1 2.15 true @@ -60,7 +60,7 @@ io.jenkins.tools.bom bom-${jenkins.baseline}.x - 2982.vdce2153031a_0 + 3850.vb_c5319efa_e29 import pom diff --git a/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesAction.java b/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesAction.java index 30677cbf..15faeda8 100644 --- a/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesAction.java +++ b/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesAction.java @@ -9,10 +9,10 @@ import org.kohsuke.stapler.HttpResponses; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerProxy; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerResponse2; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import java.io.IOException; /** @@ -47,7 +47,7 @@ public Object getTarget() { return this; } - public void doShow(StaplerRequest req, StaplerResponse rsp, @QueryParameter("id") String fileId, @AncestorInPath ItemGroup group) throws IOException, ServletException { + public void doShow(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter("id") String fileId, @AncestorInPath ItemGroup group) throws IOException, ServletException { Config config = ConfigFiles.getByIdOrNull(group, fileId); if (config != null) { req.setAttribute("contentType", config.getProvider().getContentType()); diff --git a/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesManagement.java b/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesManagement.java index caec376f..67dd1d02 100644 --- a/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesManagement.java +++ b/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesManagement.java @@ -26,7 +26,7 @@ of this software and associated documentation files (the "Software"), to deal import java.io.IOException; import java.util.*; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import edu.umd.cs.findbugs.annotations.NonNull; import hudson.Extension; @@ -46,8 +46,8 @@ of this software and associated documentation files (the "Software"), to deal import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerProxy; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerResponse2; import org.kohsuke.stapler.interceptor.RequirePOST; import org.kohsuke.stapler.verb.POST; @@ -155,7 +155,7 @@ public Collection getConfigs() { * @return */ @POST - public HttpResponse doSaveConfig(StaplerRequest req) { + public HttpResponse doSaveConfig(StaplerRequest2 req) { // permission handled in getTarget try { JSONObject json = req.getSubmittedForm().getJSONObject("config"); @@ -174,7 +174,7 @@ public HttpResponse doSaveConfig(StaplerRequest req) { return new HttpRedirect("index"); } - public void doShow(StaplerRequest req, StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException, ServletException { + public void doShow(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException, ServletException { // permission handled in getTarget Config config = store.getById(configId); @@ -192,7 +192,7 @@ public void doShow(StaplerRequest req, StaplerResponse rsp, @QueryParameter("id" * @throws IOException * @throws ServletException */ - public void doEditConfig(StaplerRequest req, StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException, ServletException { + public void doEditConfig(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException, ServletException { // permission handled in getTarget Config config = store.getById(configId); @@ -212,7 +212,7 @@ public void doEditConfig(StaplerRequest req, StaplerResponse rsp, @QueryParamete * @throws ServletException */ @POST - public void doAddConfig(StaplerRequest req, StaplerResponse rsp, @QueryParameter("providerId") String providerId, @QueryParameter("configId") String configId) throws IOException, ServletException { + public void doAddConfig(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter("providerId") String providerId, @QueryParameter("configId") String configId) throws IOException, ServletException { // permission handled in getTarget FormValidation error = null; @@ -254,7 +254,7 @@ public void doAddConfig(StaplerRequest req, StaplerResponse rsp, @QueryParameter req.getView(this, JELLY_RESOURCES_PATH + "edit.jelly").forward(req, rsp); } - public void doSelectProvider(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { + public void doSelectProvider(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException, ServletException { // permission handled in getTarget req.setAttribute("providers", ConfigProvider.all()); req.setAttribute("configId", UUID.randomUUID().toString()); @@ -275,7 +275,7 @@ private void checkPermission(Permission permission) { * @throws IOException */ @RequirePOST - public HttpResponse doRemoveConfig(StaplerRequest res, StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException { + public HttpResponse doRemoveConfig(StaplerRequest2 res, StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException { // permission handled in getTarget store.remove(configId); diff --git a/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesUIContract.java b/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesUIContract.java index 0fd0bd99..1f2bc76a 100644 --- a/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesUIContract.java +++ b/src/main/java/org/jenkinsci/plugins/configfiles/ConfigFilesUIContract.java @@ -29,7 +29,7 @@ of this software and associated documentation files (the "Software"), to deal import org.jenkinsci.lib.configprovider.model.ContentType; import org.kohsuke.stapler.*; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import java.io.IOException; import java.util.*; import java.util.regex.Pattern; @@ -60,9 +60,9 @@ public interface ConfigFilesUIContract { * @param req request * @return */ - public HttpResponse doSaveConfig(StaplerRequest req) throws IOException, ServletException ; + public HttpResponse doSaveConfig(StaplerRequest2 req) throws IOException, ServletException ; - public void doShow(StaplerRequest req, StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException, ServletException; + public void doShow(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException, ServletException; /** * Loads the config by its id and forwards the request to "edit.jelly". @@ -76,7 +76,7 @@ public interface ConfigFilesUIContract { * @throws IOException * @throws ServletException */ - public void doEditConfig(StaplerRequest req, StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException, ServletException; + public void doEditConfig(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException, ServletException; /** * Requests a new config object from provider (defined by the given id) and forwards the request to "edit.jelly". @@ -92,9 +92,9 @@ public interface ConfigFilesUIContract { * @throws IOException * @throws ServletException */ - public void doAddConfig(StaplerRequest req, StaplerResponse rsp, @QueryParameter("providerId") String providerId, @QueryParameter("configId") String configId) throws IOException, ServletException; + public void doAddConfig(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter("providerId") String providerId, @QueryParameter("configId") String configId) throws IOException, ServletException; - public void doSelectProvider(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException; + public void doSelectProvider(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException, ServletException; /** * Removes a script from the config and filesystem. @@ -108,7 +108,7 @@ public interface ConfigFilesUIContract { * @return forward to 'index' * @throws IOException */ - public HttpResponse doRemoveConfig(StaplerRequest res, StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException; + public HttpResponse doRemoveConfig(StaplerRequest2 res, StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException; public FormValidation doCheckConfigId(@QueryParameter("configId") String configId); } diff --git a/src/main/java/org/jenkinsci/plugins/configfiles/buildwrapper/ManagedFile.java b/src/main/java/org/jenkinsci/plugins/configfiles/buildwrapper/ManagedFile.java index d4aef707..d45f7fff 100644 --- a/src/main/java/org/jenkinsci/plugins/configfiles/buildwrapper/ManagedFile.java +++ b/src/main/java/org/jenkinsci/plugins/configfiles/buildwrapper/ManagedFile.java @@ -134,7 +134,7 @@ public ListBoxModel doFillFileIdItems(@AncestorInPath ItemGroup context, @Ancest * @param fileId the id of the config file * @return a validation result / description */ - public HttpResponse doCheckFileId(StaplerRequest req, @AncestorInPath Item context, @AncestorInPath AccessControlled ac, @QueryParameter String fileId) { + public HttpResponse doCheckFileId(StaplerRequest2 req, @AncestorInPath Item context, @AncestorInPath AccessControlled ac, @QueryParameter String fileId) { // You should have permission to configure your project in order to check whether the selected file id is // allowed to you if (context != null) { diff --git a/src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileAction.java b/src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileAction.java index 78911b08..54a24d82 100644 --- a/src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileAction.java +++ b/src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileAction.java @@ -8,7 +8,7 @@ import java.util.Map; import java.util.UUID; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import org.jenkinsci.lib.configprovider.ConfigProvider; import org.jenkinsci.lib.configprovider.model.Config; @@ -23,8 +23,8 @@ import org.kohsuke.stapler.HttpResponse; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerProxy; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerResponse2; import hudson.Extension; import hudson.Util; @@ -116,7 +116,7 @@ public List getProviders() { @Override @POST - public HttpResponse doSaveConfig(StaplerRequest req) throws IOException, ServletException { + public HttpResponse doSaveConfig(StaplerRequest2 req) throws IOException, ServletException { checkPermission(Item.CONFIGURE); try { JSONObject json = req.getSubmittedForm().getJSONObject("config"); @@ -155,7 +155,7 @@ ConfigFileStore getStore() { } @Override - public void doShow(StaplerRequest req, StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException, ServletException { + public void doShow(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException, ServletException { folder.checkPermission(Item.EXTENDED_READ); Config config = getStore().getById(configId); req.setAttribute("contentType", config.getProvider().getContentType()); @@ -164,7 +164,7 @@ public void doShow(StaplerRequest req, StaplerResponse rsp, @QueryParameter("id" } @Override - public void doEditConfig(StaplerRequest req, StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException, ServletException { + public void doEditConfig(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException, ServletException { checkPermission(Job.CONFIGURE); Config config = getStore().getById(configId); req.setAttribute("contentType", config.getProvider().getContentType()); @@ -176,7 +176,7 @@ public void doEditConfig(StaplerRequest req, StaplerResponse rsp, @QueryParamete @Override @POST - public void doAddConfig(StaplerRequest req, StaplerResponse rsp, @QueryParameter("providerId") String providerId, @QueryParameter("configId") String configId) throws IOException, ServletException { + public void doAddConfig(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter("providerId") String providerId, @QueryParameter("configId") String configId) throws IOException, ServletException { checkPermission(Item.CONFIGURE); FormValidation error = null; @@ -219,7 +219,7 @@ public void doAddConfig(StaplerRequest req, StaplerResponse rsp, @QueryParameter } @Override - public void doSelectProvider(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { + public void doSelectProvider(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException, ServletException { checkPermission(Job.CONFIGURE); req.setAttribute("providers", getProviders()); req.setAttribute("configId", UUID.randomUUID().toString()); @@ -228,7 +228,7 @@ public void doSelectProvider(StaplerRequest req, StaplerResponse rsp) throws IOE @RequirePOST @Override - public HttpResponse doRemoveConfig(StaplerRequest res, StaplerResponse rsp, @QueryParameter("id") String configId) throws IOException { + public HttpResponse doRemoveConfig(StaplerRequest2 res, StaplerResponse2 rsp, @QueryParameter("id") String configId) throws IOException { checkPermission(Job.CONFIGURE); getStore().remove(configId); diff --git a/src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileProperty.java b/src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileProperty.java index c90ae2a9..d869b99a 100644 --- a/src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileProperty.java +++ b/src/main/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileProperty.java @@ -14,7 +14,7 @@ import org.jenkinsci.plugins.configfiles.ConfigFileStore; import org.jenkinsci.plugins.configfiles.ConfigProviderComparator; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerRequest2; import java.io.IOException; import java.util.*; @@ -123,7 +123,7 @@ private Object readResolve() { return this; } - public FolderConfigFileProperty reconfigure(StaplerRequest req, JSONObject form) throws Descriptor.FormException { + public FolderConfigFileProperty reconfigure(StaplerRequest2 req, JSONObject form) throws Descriptor.FormException { return this; } diff --git a/src/main/java/org/jenkinsci/plugins/configfiles/utils/ConfigFileDetailLinkDescription.java b/src/main/java/org/jenkinsci/plugins/configfiles/utils/ConfigFileDetailLinkDescription.java index 2555a11a..56066273 100644 --- a/src/main/java/org/jenkinsci/plugins/configfiles/utils/ConfigFileDetailLinkDescription.java +++ b/src/main/java/org/jenkinsci/plugins/configfiles/utils/ConfigFileDetailLinkDescription.java @@ -3,18 +3,18 @@ import hudson.model.Item; import jenkins.model.Jenkins; import org.apache.commons.lang.StringUtils; -import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerRequest2; public class ConfigFileDetailLinkDescription extends DescriptionResponse { private ConfigFileDetailLinkDescription(String linkHtml) { super(linkHtml); } - public static ConfigFileDetailLinkDescription getDescription(StaplerRequest req, Item context, String fileId) { + public static ConfigFileDetailLinkDescription getDescription(StaplerRequest2 req, Item context, String fileId) { return new ConfigFileDetailLinkDescription(getDetailsLink(req, context, fileId)); } - private static String getDetailsLink(StaplerRequest req, Item context, String fileId) { + private static String getDetailsLink(StaplerRequest2 req, Item context, String fileId) { String link = req.getContextPath(); link = StringUtils.isNotBlank(context.getUrl()) ? link + "/" + context.getUrl() : link; link = link + "configfiles/show?id=" + fileId; diff --git a/src/main/java/org/jenkinsci/plugins/configfiles/utils/DescriptionResponse.java b/src/main/java/org/jenkinsci/plugins/configfiles/utils/DescriptionResponse.java index deb2a7dd..09356ed1 100644 --- a/src/main/java/org/jenkinsci/plugins/configfiles/utils/DescriptionResponse.java +++ b/src/main/java/org/jenkinsci/plugins/configfiles/utils/DescriptionResponse.java @@ -3,10 +3,10 @@ import hudson.util.FormValidation; import org.apache.commons.lang.StringUtils; import org.kohsuke.stapler.HttpResponse; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.StaplerRequest2; +import org.kohsuke.stapler.StaplerResponse2; -import javax.servlet.ServletException; +import jakarta.servlet.ServletException; import java.io.IOException; /** @@ -24,7 +24,7 @@ public DescriptionResponse(String html) { } @Override - public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { + public void generateResponse(StaplerRequest2 req, StaplerResponse2 rsp, Object node) throws IOException, ServletException { rsp.setContentType("text/html;charset=UTF-8"); rsp.getWriter().print(html); } diff --git a/src/test/java/org/jenkinsci/plugins/configfiles/Security2203Test.java b/src/test/java/org/jenkinsci/plugins/configfiles/Security2203Test.java index a98705d3..36f033e9 100644 --- a/src/test/java/org/jenkinsci/plugins/configfiles/Security2203Test.java +++ b/src/test/java/org/jenkinsci/plugins/configfiles/Security2203Test.java @@ -25,7 +25,7 @@ import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.MockAuthorizationStrategy; -import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerRequest2; import jakarta.inject.Inject; import java.io.IOException; @@ -85,7 +85,7 @@ public void managedFileDoFillFiledIdItemsProtected() { } /** - * The {@link ManagedFile.DescriptorImpl#doCheckFileId(StaplerRequest, Item, AccessControlled, String)} is only accessible by people + * The {@link ManagedFile.DescriptorImpl#doCheckFileId(StaplerRequest2, Item, AccessControlled, String)} is only accessible by people * able to configure the job. */ @Issue("SECURITY-2203") diff --git a/src/test/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileActionTest.java b/src/test/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileActionTest.java index eccb7bbd..a3792f1f 100644 --- a/src/test/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileActionTest.java +++ b/src/test/java/org/jenkinsci/plugins/configfiles/folder/FolderConfigFileActionTest.java @@ -5,6 +5,7 @@ import org.htmlunit.html.HtmlAnchor; import org.htmlunit.html.HtmlElement; import org.htmlunit.html.HtmlPage; +import hudson.model.Descriptor; import hudson.model.Item; import hudson.util.VersionNumber; import jenkins.model.Jenkins; @@ -298,7 +299,7 @@ public void folderCheckConfigIdProtected() throws Exception { MatcherAssert.assertThat(page, notNullValue()); } - private CpsFlowDefinition getNewJobDefinition() { + private CpsFlowDefinition getNewJobDefinition() throws Descriptor.FormException { return new CpsFlowDefinition("" + "node {\n" + " configFileProvider([configFile(fileId: 'my-file-id', variable: 'MY_FILE')]) {\n" + diff --git a/src/test/java/org/jenkinsci/plugins/configfiles/maven/MavenSettingsConfigTest.java b/src/test/java/org/jenkinsci/plugins/configfiles/maven/MavenSettingsConfigTest.java index 5d742f65..b4ede33a 100644 --- a/src/test/java/org/jenkinsci/plugins/configfiles/maven/MavenSettingsConfigTest.java +++ b/src/test/java/org/jenkinsci/plugins/configfiles/maven/MavenSettingsConfigTest.java @@ -37,6 +37,7 @@ import hudson.Launcher; import hudson.model.AbstractBuild; import hudson.model.BuildListener; +import hudson.model.Descriptor; import hudson.model.Computer; import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; @@ -79,14 +80,14 @@ public void assertNoSecretPatternOnControllerLog(Computer computer) throws IOExc assertThat(computer.getLog(), not(containsString("An agent attempted to look up secret patterns from the controller"))); } - private UsernamePasswordCredentialsImpl createCredential(String id, String username, String password) { + private UsernamePasswordCredentialsImpl createCredential(String id, String username, String password) throws Descriptor.FormException { UsernamePasswordCredentialsImpl credentials = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, id, "", username, password); credentials.setUsernameSecret(true); SystemCredentialsProvider.getInstance().getCredentials().add(credentials); return credentials; } @Before - public void before() { + public void before() throws Exception { GlobalConfigFiles.get().save(new MavenSettingsConfig("m2settings", "m2settings", "", "", true, Collections.singletonList(new ServerCredentialMapping("myserver", createCredential("creds", "bot-user-name", "bot-user-s3cr3t").getId())))); GlobalConfigFiles.get().save(new GlobalMavenSettingsConfig("m2GlobalSettings", "m2GlobalSettings", "", "", true, diff --git a/src/test/java/org/jenkinsci/plugins/configfiles/sec/Security2254Test.java b/src/test/java/org/jenkinsci/plugins/configfiles/sec/Security2254Test.java index aa34489e..a172dc2e 100644 --- a/src/test/java/org/jenkinsci/plugins/configfiles/sec/Security2254Test.java +++ b/src/test/java/org/jenkinsci/plugins/configfiles/sec/Security2254Test.java @@ -27,7 +27,6 @@ import org.jvnet.hudson.test.JenkinsRule; import org.jvnet.hudson.test.MockAuthorizationStrategy; -import java.io.IOException; import java.util.function.Supplier; import static org.hamcrest.MatcherAssert.assertThat; @@ -45,7 +44,7 @@ public class Security2254Test { private Folder folder; @Before - public void setUpAuthorizationAndProject() throws IOException { + public void setUpAuthorizationAndProject() throws Exception { // A folder and a project inside folder = r.jenkins.createProject(Folder.class, "f"); project = folder.createProject(WorkflowJob.class, "p");