Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bearer auth not set on readResolve() #633

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading