Skip to content

Commit

Permalink
Merge pull request #633 from jenkinsci/rantoniuk/bearer-auth-resolve
Browse files Browse the repository at this point in the history
Fix Bearer auth not set on readResolve()
  • Loading branch information
rantoniuk authored Jan 15, 2025
2 parents 97afc22 + 19b98ff commit fa470ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/hudson/plugins/jira/JiraSite.java
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,8 @@ protected Object readResolve() throws FormException {
jiraSite.setAppendChangeTimestamp(appendChangeTimestamp);
jiraSite.setDisableChangelogAnnotations(disableChangelogAnnotations);
jiraSite.setDateTimePattern(dateTimePattern);
jiraSite.setUseBearerAuth(useBearerAuth);

return jiraSite;
}

Expand Down
2 changes: 2 additions & 0 deletions src/test/java/hudson/plugins/jira/JiraSiteTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public void deserializeNormal() throws IOException, FormException {
CredentialsProvider.lookupStores(j.jenkins).iterator().next().addDomain(domain, c);

JiraSite site = new JiraSite(exampleOrg, null, c.getId(), false, false, null, false, null, null, true);
site.setUseBearerAuth(true);

XStream2 xStream2 = new XStream2();
String xml = xStream2.toXML(site);
Expand All @@ -174,6 +175,7 @@ public void deserializeNormal() throws IOException, FormException {

JiraSite site1 = (JiraSite) xStream2.fromXML(xml);
assertNotNull(site1.credentialsId);
assertTrue(site1.useBearerAuth);
}

@WithoutJenkins
Expand Down

0 comments on commit fa470ad

Please sign in to comment.