Browse Source

Polish XorCsrfTokenRequestAttributeHandlerTests

pull/12044/head
Steve Riesenberg 3 years ago
parent
commit
804f20045e
No known key found for this signature in database
GPG Key ID: 5F311AB48A55D521
  1. 10
      web/src/test/java/org/springframework/security/web/csrf/XorCsrfTokenRequestAttributeHandlerTests.java

10
web/src/test/java/org/springframework/security/web/csrf/XorCsrfTokenRequestAttributeHandlerTests.java

@ -159,14 +159,20 @@ public class XorCsrfTokenRequestAttributeHandlerTests { @@ -159,14 +159,20 @@ public class XorCsrfTokenRequestAttributeHandlerTests {
@Test
public void resolveCsrfTokenValueWhenRequestIsNullThenThrowsIllegalArgumentException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.handler.resolveCsrfTokenValue(null, this.token))
// @formatter:off
assertThatIllegalArgumentException()
.isThrownBy(() -> this.handler.resolveCsrfTokenValue(null, this.token))
.withMessage("request cannot be null");
// @formatter:on
}
@Test
public void resolveCsrfTokenValueWhenCsrfTokenIsNullThenThrowsIllegalArgumentException() {
assertThatIllegalArgumentException().isThrownBy(() -> this.handler.resolveCsrfTokenValue(this.request, null))
// @formatter:off
assertThatIllegalArgumentException()
.isThrownBy(() -> this.handler.resolveCsrfTokenValue(this.request, null))
.withMessage("csrfToken cannot be null");
// @formatter:on
}
@Test

Loading…
Cancel
Save