diff --git a/src/main/java/hudson/plugins/jira/JiraSite.java b/src/main/java/hudson/plugins/jira/JiraSite.java index 3f4cfa30..7cda4a48 100644 --- a/src/main/java/hudson/plugins/jira/JiraSite.java +++ b/src/main/java/hudson/plugins/jira/JiraSite.java @@ -128,11 +128,6 @@ public class JiraSite extends AbstractDescribableImpl { */ public URL alternativeUrl; - /** - * Jira requires HTTP Authentication for login - */ - public boolean useHTTPAuth; - /** * The id of the credentials to use. Optional. */ @@ -252,7 +247,7 @@ public class JiraSite extends AbstractDescribableImpl { private static ExecutorService executorService; // Deprecate the previous constructor but leave it in place for Java-level compatibility. - @Deprecated + // Contruct Test succeeded in JiraSiteTest.java, removal attempt for the first time. public JiraSite( URL url, @CheckForNull URL alternativeUrl, @@ -263,7 +258,7 @@ public JiraSite( boolean updateJiraIssueForAllStatus, @CheckForNull String groupVisibility, @CheckForNull String roleVisibility, - boolean useHTTPAuth) { + boolean useBearerAuth) { this( url, alternativeUrl, @@ -274,14 +269,14 @@ public JiraSite( updateJiraIssueForAllStatus, groupVisibility, roleVisibility, - useHTTPAuth, + useBearerAuth, DEFAULT_TIMEOUT, DEFAULT_READ_TIMEOUT, DEFAULT_THREAD_EXECUTOR_NUMBER); } // Deprecate the previous constructor but leave it in place for Java-level compatibility. - @Deprecated + // Contruct Test succeeded in JiraSiteTest.java, removal attempt for the first time. public JiraSite( URL url, @CheckForNull URL alternativeUrl, @@ -293,7 +288,7 @@ public JiraSite( boolean updateJiraIssueForAllStatus, @CheckForNull String groupVisibility, @CheckForNull String roleVisibility, - boolean useHTTPAuth) { + boolean useBearerAuth) { this( url, alternativeUrl, @@ -304,11 +299,11 @@ public JiraSite( updateJiraIssueForAllStatus, groupVisibility, roleVisibility, - useHTTPAuth); + useBearerAuth); } // Deprecate the previous constructor but leave it in place for Java-level compatibility. - @Deprecated + // Contruct Test succeeded in JiraSiteTest.java, removal attempt for the first time. public JiraSite( URL url, URL alternativeUrl, @@ -319,7 +314,7 @@ public JiraSite( boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, - boolean useHTTPAuth) { + boolean useBearerAuth) { this( url, alternativeUrl, @@ -330,7 +325,7 @@ public JiraSite( updateJiraIssueForAllStatus, groupVisibility, roleVisibility, - useHTTPAuth, + useBearerAuth, DEFAULT_TIMEOUT, DEFAULT_READ_TIMEOUT, DEFAULT_THREAD_EXECUTOR_NUMBER); @@ -347,7 +342,7 @@ public JiraSite( } // Deprecate the previous constructor but leave it in place for Java-level compatibility. - @Deprecated + // Contruct Test succeeded in JiraSiteTest.java, removal attempt for the first time. public JiraSite( URL url, URL alternativeUrl, @@ -358,7 +353,7 @@ public JiraSite( boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, - boolean useHTTPAuth, + boolean useBearerAuth, int timeout, int readTimeout, int threadExecutorNumber) { @@ -382,7 +377,7 @@ public JiraSite( this.updateJiraIssueForAllStatus = updateJiraIssueForAllStatus; setGroupVisibility(groupVisibility); setRoleVisibility(roleVisibility); - this.useHTTPAuth = useHTTPAuth; + this.useBearerAuth = useBearerAuth; this.jiraSession = null; } @@ -396,7 +391,7 @@ public JiraSite(String url) { } // Deprecate the previous constructor but leave it in place for Java-level compatibility. - @Deprecated + // Contruct Test succeeded in JiraSiteTest.java, removal attempt for the first time. public JiraSite( URL url, URL alternativeUrl, @@ -407,7 +402,7 @@ public JiraSite( boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, - boolean useHTTPAuth, + boolean useBearerAuth, int timeout, int readTimeout, int threadExecutorNumber) { @@ -421,44 +416,10 @@ public JiraSite( updateJiraIssueForAllStatus, groupVisibility, roleVisibility, - useHTTPAuth, - timeout, - readTimeout, - threadExecutorNumber); - } - - // Deprecate the previous constructor but leave it in place for Java-level compatibility. - @Deprecated - public JiraSite( - URL url, - URL alternativeUrl, - StandardUsernamePasswordCredentials credentials, - boolean supportsWikiStyleComment, - boolean recordScmChanges, - String userPattern, - boolean updateJiraIssueForAllStatus, - String groupVisibility, - String roleVisibility, - boolean useHTTPAuth, - int timeout, - int readTimeout, - int threadExecutorNumber, - boolean useBearerAuth) { - this( - url, - alternativeUrl, - credentials == null ? null : credentials.getId(), - supportsWikiStyleComment, - recordScmChanges, - userPattern, - updateJiraIssueForAllStatus, - groupVisibility, - roleVisibility, - useHTTPAuth, + useBearerAuth, timeout, readTimeout, threadExecutorNumber); - this.useBearerAuth = useBearerAuth; } static URL toURL(String url) { @@ -553,10 +514,6 @@ public URL getAlternativeUrl() { return alternativeUrl; } - public boolean isUseHTTPAuth() { - return useHTTPAuth; - } - public boolean isUseBearerAuth() { return useBearerAuth; } @@ -586,11 +543,6 @@ public void setAlternativeUrl(String alternativeUrl) { this.alternativeUrl = toURL(alternativeUrl); } - @DataBoundSetter - public void setUseHTTPAuth(boolean useHTTPAuth) { - this.useHTTPAuth = useHTTPAuth; - } - @DataBoundSetter public void setUseBearerAuth(boolean useBearerAuth) { this.useBearerAuth = useBearerAuth; @@ -647,7 +599,7 @@ protected Object readResolve() { updateJiraIssueForAllStatus, groupVisibility, roleVisibility, - useHTTPAuth); + useBearerAuth); } else { jiraSite = new JiraSite( url, @@ -659,7 +611,7 @@ protected Object readResolve() { updateJiraIssueForAllStatus, groupVisibility, roleVisibility, - useHTTPAuth, + useBearerAuth, timeout, readTimeout, threadExecutorNumber); @@ -1312,7 +1264,6 @@ public FormValidation doValidate( @QueryParameter String credentialsId, @QueryParameter String groupVisibility, @QueryParameter String roleVisibility, - @QueryParameter boolean useHTTPAuth, @QueryParameter String alternativeUrl, @QueryParameter int timeout, @QueryParameter int readTimeout, @@ -1354,7 +1305,7 @@ public FormValidation doValidate( .withCredentialsId(credentialsId) .withGroupVisibility(groupVisibility) .withRoleVisibility(roleVisibility) - .withUseHTTPAuth(useHTTPAuth) + .withUseBearerAuth(useBearerAuth) .build(); if (threadExecutorNumber < 1) { @@ -1416,7 +1367,7 @@ static class Builder { private boolean updateJiraIssueForAllStatus; private String groupVisibility; private String roleVisibility; - private boolean useHTTPAuth; + private boolean useBearerAuth; public Builder withMainURL(URL mainURL) { this.mainURL = mainURL; @@ -1463,8 +1414,8 @@ public Builder withRoleVisibility(String roleVisibility) { return this; } - public Builder withUseHTTPAuth(boolean useHTTPAuth) { - this.useHTTPAuth = useHTTPAuth; + public Builder withUseBearerAuth(boolean useBearerAuth) { + this.useBearerAuth = useBearerAuth; return this; } @@ -1479,7 +1430,7 @@ public JiraSite build() { updateJiraIssueForAllStatus, groupVisibility, roleVisibility, - useHTTPAuth); + useBearerAuth); } } diff --git a/src/main/resources/hudson/plugins/jira/JiraSite/config.jelly b/src/main/resources/hudson/plugins/jira/JiraSite/config.jelly index 7e939f4e..d733f01a 100644 --- a/src/main/resources/hudson/plugins/jira/JiraSite/config.jelly +++ b/src/main/resources/hudson/plugins/jira/JiraSite/config.jelly @@ -6,9 +6,6 @@ - - - @@ -53,7 +50,7 @@ + method="validate" with="url,credentialsId,groupVisibility,roleVisibility,alternativeUrl,timeout,readTimeout,threadExecutorNumber,useBearerAuth" />
diff --git a/src/test/java/hudson/plugins/jira/DescriptorImplTest.java b/src/test/java/hudson/plugins/jira/DescriptorImplTest.java index 5c9c0afa..47e78adc 100644 --- a/src/test/java/hudson/plugins/jira/DescriptorImplTest.java +++ b/src/test/java/hudson/plugins/jira/DescriptorImplTest.java @@ -133,7 +133,6 @@ public void validateFormConnectionErrors() throws Exception { null, null, null, - false, null, JiraSite.DEFAULT_TIMEOUT, JiraSite.DEFAULT_READ_TIMEOUT, @@ -149,7 +148,6 @@ public void validateFormConnectionErrors() throws Exception { null, null, null, - false, null, -1, JiraSite.DEFAULT_READ_TIMEOUT, @@ -165,7 +163,6 @@ public void validateFormConnectionErrors() throws Exception { null, null, null, - false, null, JiraSite.DEFAULT_TIMEOUT, -1, @@ -182,7 +179,6 @@ public void validateFormConnectionErrors() throws Exception { null, null, null, - false, null, JiraSite.DEFAULT_TIMEOUT, JiraSite.DEFAULT_READ_TIMEOUT, @@ -208,7 +204,6 @@ public void validateFormConnectionOK() throws Exception { null, null, null, - false, null, JiraSite.DEFAULT_TIMEOUT, JiraSite.DEFAULT_READ_TIMEOUT, diff --git a/src/test/java/hudson/plugins/jira/JiraSiteTest.java b/src/test/java/hudson/plugins/jira/JiraSiteTest.java index cb63c2bb..b326de34 100644 --- a/src/test/java/hudson/plugins/jira/JiraSiteTest.java +++ b/src/test/java/hudson/plugins/jira/JiraSiteTest.java @@ -207,7 +207,7 @@ private static class JiraSiteOld extends JiraSite { boolean updateJiraIssueForAllStatus, String groupVisibility, String roleVisibility, - boolean useHTTPAuth) { + boolean useBearerAuth) { super( url, alternativeUrl, @@ -218,7 +218,7 @@ private static class JiraSiteOld extends JiraSite { updateJiraIssueForAllStatus, groupVisibility, roleVisibility, - useHTTPAuth); + useBearerAuth); this.userName = userName; this.password = Secret.fromString(password); }