Merge branch '6.2.x'
This commit is contained in:
@@ -22,6 +22,7 @@ import org.assertj.core.api.AbstractByteArrayAssert;
|
||||
import org.assertj.core.api.AbstractStringAssert;
|
||||
import org.assertj.core.api.Assertions;
|
||||
import org.assertj.core.api.ByteArrayAssert;
|
||||
import org.assertj.core.api.StringAssert;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.mock.web.MockHttpServletResponse;
|
||||
@@ -163,4 +164,16 @@ public abstract class AbstractMockHttpServletResponseAssert<SELF extends Abstrac
|
||||
return this.myself;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify that the {@link jakarta.servlet.http.HttpServletResponse#sendError(int, String)} Servlet error message}
|
||||
* is equal to the given value.
|
||||
* @param errorMessage the expected Servlet error message (can be null)
|
||||
* @since 6.2.1
|
||||
*/
|
||||
public SELF hasErrorMessage(@Nullable String errorMessage) {
|
||||
new StringAssert(getResponse().getErrorMessage())
|
||||
.as("Servlet error message").isEqualTo(errorMessage);
|
||||
return this.myself;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user