Skip to content

Commit 1e48ce0

Browse files
committed
Fix unused import in CSRF configuration test
1 parent 25f33cc commit 1e48ce0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/src/test/java/hudson/security/csrf/GlobalCrumbIssuerConfigurationTest.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ void setUp(JenkinsRule rule) {
2121
j = rule;
2222
}
2323

24+
@Test
25+
void csrfSectionShownWhenOnlyDefaultIssuerAvailable() throws Exception {
26+
// No @TestExtension here, so only DefaultCrumbIssuer is registered
27+
j.jenkins.setCrumbIssuer(new DefaultCrumbIssuer(false));
28+
29+
JenkinsRule.WebClient wc = j.createWebClient();
30+
HtmlPage page = wc.goTo("configureSecurity");
31+
String pageContent = page.asNormalizedText();
32+
33+
// When only DefaultCrumbIssuer exists, the CSRF section should still be visible
34+
assertThat(pageContent, containsString("Default Crumb Issuer"));
35+
}
36+
2437
@Test
2538
void csrfSectionShownWhenNonDefaultIssuerConfigured() throws Exception {
2639
// DefaultCrumbIssuer is default, but other CrumbIssuer descriptors exist in test environment
@@ -33,7 +46,7 @@ void csrfSectionShownWhenNonDefaultIssuerConfigured() throws Exception {
3346

3447
// With multiple CrumbIssuer descriptors available (from test extensions),
3548
// the CSRF Protection section should always be shown
36-
assertThat(pageContent, containsString("Crumb Issuer"));
49+
assertThat(pageContent, containsString("Default Crumb Issuer"));
3750
}
3851

3952
@Test

0 commit comments

Comments
 (0)