File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
main/java/org/springframework/session/web/http
test/java/org/springframework/session/web/http Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ public HttpSessionWrapper getSession(boolean create) {
312
312
}
313
313
if (SessionRepositoryFilter .this .httpSessionIdResolver instanceof CookieHttpSessionIdResolver
314
314
&& this .response .isCommitted ()) {
315
- throw new IllegalArgumentException ("Cannot create a session after the response has been committed" );
315
+ throw new IllegalStateException ("Cannot create a session after the response has been committed" );
316
316
}
317
317
if (SESSION_LOGGER .isDebugEnabled ()) {
318
318
SESSION_LOGGER .debug (
Original file line number Diff line number Diff line change 62
62
import static org .assertj .core .api .Assertions .assertThat ;
63
63
import static org .assertj .core .api .Assertions .assertThatExceptionOfType ;
64
64
import static org .assertj .core .api .Assertions .assertThatIllegalArgumentException ;
65
+ import static org .assertj .core .api .Assertions .assertThatIllegalStateException ;
65
66
import static org .assertj .core .api .Assertions .fail ;
66
67
import static org .mockito .ArgumentMatchers .any ;
67
68
import static org .mockito .ArgumentMatchers .anyString ;
@@ -425,7 +426,7 @@ public void doFilter(HttpServletRequest wrappedRequest) {
425
426
426
427
@ Test
427
428
void doFilterGetSessionNewWhenResponseCommittedThenException () {
428
- assertThatIllegalArgumentException ().isThrownBy (() -> doFilter (new DoInFilter () {
429
+ assertThatIllegalStateException ().isThrownBy (() -> doFilter (new DoInFilter () {
429
430
@ Override
430
431
public void doFilter (HttpServletRequest wrappedRequest , HttpServletResponse wrappedResponse )
431
432
throws IOException {
You can’t perform that action at this time.
0 commit comments