Skip to content

Allow update of existing WebSession after max sessions limit is reached #35013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Test case for Allow session update for existing session ID even if ma…
…x sessions limit is reached

Signed-off-by: Mohammad Saeed Nouri <msnsaeed71@gmail.com>
  • Loading branch information
Mohammad Saeed Nouri committed Jun 9, 2025
commit 25e664271b1bb6fbef31b722819531e3cc8440cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
import reactor.test.StepVerifier;

/**
* Tests for {@link InMemoryWebSessionStore}.
Expand Down Expand Up @@ -159,6 +160,25 @@ void maxSessions() {
.withMessage("Max sessions limit reached: 10000");
}

@Test
void updateSession() {
WebSession oneWebSession = insertSession();

StepVerifier.create(oneWebSession.save())
.expectComplete()
.verify();
}

@Test
void updateSession_whenMaxSessionsReached() {
WebSession onceWebSession = insertSession();
IntStream.range(1, 10000).forEach(i -> insertSession());

StepVerifier.create(onceWebSession.save())
.expectComplete()
.verify();
}

private WebSession insertSession() {
WebSession session = this.store.createWebSession().block();
assertThat(session).isNotNull();
Expand Down