File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
test/src/test/java/hudson/security/csrf Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments