Browse Source

Include correct keyword in CookieAssertions failure messages

Closes gh-27550
pull/27555/head
Koen Punt 3 years ago committed by Sam Brannen
parent
commit
50b92118a9
  1. 4
      spring-test/src/main/java/org/springframework/test/web/reactive/server/CookieAssertions.java

4
spring-test/src/main/java/org/springframework/test/web/reactive/server/CookieAssertions.java

@ -188,7 +188,7 @@ public class CookieAssertions {
public WebTestClient.ResponseSpec httpOnly(String name, boolean expected) { public WebTestClient.ResponseSpec httpOnly(String name, boolean expected) {
boolean isHttpOnly = getCookie(name).isHttpOnly(); boolean isHttpOnly = getCookie(name).isHttpOnly();
this.exchangeResult.assertWithDiagnostics(() -> { this.exchangeResult.assertWithDiagnostics(() -> {
String message = getMessage(name) + " secure"; String message = getMessage(name) + " httpOnly";
AssertionErrors.assertEquals(message, expected, isHttpOnly); AssertionErrors.assertEquals(message, expected, isHttpOnly);
}); });
return this.responseSpec; return this.responseSpec;
@ -200,7 +200,7 @@ public class CookieAssertions {
public WebTestClient.ResponseSpec sameSite(String name, String expected) { public WebTestClient.ResponseSpec sameSite(String name, String expected) {
String sameSite = getCookie(name).getSameSite(); String sameSite = getCookie(name).getSameSite();
this.exchangeResult.assertWithDiagnostics(() -> { this.exchangeResult.assertWithDiagnostics(() -> {
String message = getMessage(name) + " secure"; String message = getMessage(name) + " sameSite";
AssertionErrors.assertEquals(message, expected, sameSite); AssertionErrors.assertEquals(message, expected, sameSite);
}); });
return this.responseSpec; return this.responseSpec;

Loading…
Cancel
Save