Skip to content

Commit 46ad06a

Browse files
added more test cases
1 parent 0f1bb70 commit 46ad06a

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/main/java/com/cloudbees/jenkins/support/SupportAction.java

+3-11
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,7 @@ public HttpRedirect doGenerateBundleAsync(StaplerRequest2 req, StaplerResponse2
373373
try (FileOutputStream fileOutputStream = new FileOutputStream(new File(outputDir, SYNC_SUPPORT_BUNDLE))) {
374374
SupportPlugin.setRequesterAuthentication(Jenkins.getAuthentication2());
375375
try {
376-
try (ACLContext ignored = ACL.as2(ACL.SYSTEM2)) {
377-
SupportPlugin.writeBundle(fileOutputStream, syncComponent);
378-
} catch (IOException e) {
379-
logger.log(Level.WARNING, e.getMessage(), e);
380-
}
376+
SupportPlugin.writeBundle(fileOutputStream, syncComponent);
381377
} finally {
382378
SupportPlugin.clearRequesterAuthentication();
383379
}
@@ -554,12 +550,8 @@ protected void compute() throws Exception {
554550
try (FileOutputStream fileOutputStream = new FileOutputStream(new File(outputDir, supportBundleName))) {
555551
SupportPlugin.setRequesterAuthentication(Jenkins.getAuthentication2());
556552
try {
557-
try (ACLContext ignored = ACL.as2(ACL.SYSTEM2)) {
558-
SupportPlugin.writeBundle(
559-
fileOutputStream, components, this::progress, Path.of(outputDir.getAbsolutePath()));
560-
} catch (IOException e) {
561-
logger.log(Level.FINE, e.getMessage(), e);
562-
}
553+
SupportPlugin.writeBundle(
554+
fileOutputStream, components, this::progress, Path.of(outputDir.getAbsolutePath()));
563555
} finally {
564556
SupportPlugin.clearRequesterAuthentication();
565557
}

src/test/java/com/cloudbees/jenkins/support/SupportActionTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public void generateBundlesByUIButtonClick() throws IOException, SAXException, I
108108
ZipFile supportBundle = downloadSupportBundleByButtonClick();
109109
assertNotNull(supportBundle.getEntry("manifest.md"));
110110
assertNotNull(supportBundle.getEntry("browser.md"));
111+
assertNotNull(supportBundle.getEntry("user.md"));
111112
assertNotNull(supportBundle.getEntry("reverse-proxy.md"));
112113
assertNotNull(supportBundle.getEntry("nodes/master/logs/jenkins.log"));
113114
}

0 commit comments

Comments
 (0)