mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-25 11:43:29 +00:00
Polish XorServerCsrfTokenRequestAttributeHandlerTests
This commit is contained in:
parent
804f20045e
commit
8bd25f90e4
@ -68,20 +68,29 @@ public class XorServerCsrfTokenRequestAttributeHandlerTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void setSecureRandomWhenNullThenThrowsIllegalArgumentException() {
|
public void setSecureRandomWhenNullThenThrowsIllegalArgumentException() {
|
||||||
assertThatIllegalArgumentException().isThrownBy(() -> this.handler.setSecureRandom(null))
|
// @formatter:off
|
||||||
|
assertThatIllegalArgumentException()
|
||||||
|
.isThrownBy(() -> this.handler.setSecureRandom(null))
|
||||||
.withMessage("secureRandom cannot be null");
|
.withMessage("secureRandom cannot be null");
|
||||||
|
// @formatter:on
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void handleWhenExchangeIsNullThenThrowsIllegalArgumentException() {
|
public void handleWhenExchangeIsNullThenThrowsIllegalArgumentException() {
|
||||||
assertThatIllegalArgumentException().isThrownBy(() -> this.handler.handle(null, Mono.just(this.token)))
|
// @formatter:off
|
||||||
|
assertThatIllegalArgumentException()
|
||||||
|
.isThrownBy(() -> this.handler.handle(null, Mono.just(this.token)))
|
||||||
.withMessage("exchange cannot be null");
|
.withMessage("exchange cannot be null");
|
||||||
|
// @formatter:on
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void handleWhenCsrfTokenIsNullThenThrowsIllegalArgumentException() {
|
public void handleWhenCsrfTokenIsNullThenThrowsIllegalArgumentException() {
|
||||||
assertThatIllegalArgumentException().isThrownBy(() -> this.handler.handle(this.exchange, null))
|
// @formatter:off
|
||||||
|
assertThatIllegalArgumentException()
|
||||||
|
.isThrownBy(() -> this.handler.handle(this.exchange, null))
|
||||||
.withMessage("csrfToken cannot be null");
|
.withMessage("csrfToken cannot be null");
|
||||||
|
// @formatter:on
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -123,14 +132,20 @@ public class XorServerCsrfTokenRequestAttributeHandlerTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resolveCsrfTokenValueWhenExchangeIsNullThenThrowsIllegalArgumentException() {
|
public void resolveCsrfTokenValueWhenExchangeIsNullThenThrowsIllegalArgumentException() {
|
||||||
assertThatIllegalArgumentException().isThrownBy(() -> this.handler.resolveCsrfTokenValue(null, this.token))
|
// @formatter:off
|
||||||
|
assertThatIllegalArgumentException()
|
||||||
|
.isThrownBy(() -> this.handler.resolveCsrfTokenValue(null, this.token))
|
||||||
.withMessage("exchange cannot be null");
|
.withMessage("exchange cannot be null");
|
||||||
|
// @formatter:on
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resolveCsrfTokenValueWhenCsrfTokenIsNullThenThrowsIllegalArgumentException() {
|
public void resolveCsrfTokenValueWhenCsrfTokenIsNullThenThrowsIllegalArgumentException() {
|
||||||
assertThatIllegalArgumentException().isThrownBy(() -> this.handler.resolveCsrfTokenValue(this.exchange, null))
|
// @formatter:off
|
||||||
|
assertThatIllegalArgumentException()
|
||||||
|
.isThrownBy(() -> this.handler.resolveCsrfTokenValue(this.exchange, null))
|
||||||
.withMessage("csrfToken cannot be null");
|
.withMessage("csrfToken cannot be null");
|
||||||
|
// @formatter:on
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user