Skip to content

Commit 25f33cc

Browse files
committed
Fix CSRF configuration test assertions per review feedback
1 parent 8444d1c commit 25f33cc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ void csrfSectionShownWhenNonDefaultIssuerConfigured() throws Exception {
3333

3434
// With multiple CrumbIssuer descriptors available (from test extensions),
3535
// the CSRF Protection section should always be shown
36-
assertThat("CSRF Protection section should be shown when multiple issuers are available",
37-
pageContent, containsString("CSRF Protection"));
36+
assertThat(pageContent, containsString("Crumb Issuer"));
3837
}
3938

4039
@Test
@@ -47,14 +46,13 @@ void csrfSectionShownWhenCsrfProtectionDisabled() throws Exception {
4746
HtmlPage page = wc.goTo("configureSecurity");
4847
String pageContent = page.asNormalizedText();
4948

50-
assertThat("CSRF section should be shown when CSRF protection is disabled",
51-
pageContent, containsString("CSRF Protection"));
49+
assertThat(pageContent, containsString("This configuration is unavailable because the System property"));
5250
} finally {
5351
GlobalCrumbIssuerConfiguration.DISABLE_CSRF_PROTECTION = original;
5452
}
5553
}
5654

57-
@TestExtension
55+
@TestExtension("csrfSectionShownWhenNonDefaultIssuerConfigured")
5856
public static class DummyCrumbIssuer extends CrumbIssuer {
5957

6058
@Override
@@ -82,4 +80,4 @@ public String getDisplayName() {
8280
}
8381
}
8482
}
85-
}
83+
}

0 commit comments

Comments
 (0)