Skip to content

Refactor DefaultWebSessionManager #1507

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
wants to merge 16 commits into from

Conversation

rwinch
Copy link
Member

@rwinch rwinch commented Aug 24, 2017

No description provided.

@rwinch rwinch requested a review from rstoyanchev August 24, 2017 18:30
- Use constant for default header name
- make getHeaderName private

Issue: SPR-15917
Switch to unit tests rather than testing with
DefaultWebSessionManager

Issue: SPR-15917
Previously session.save() was invoked, but we did not ensure it
was completed.

This commit blocks on session.save()
This test is actually broken and is testing a new session is created because
the session id returned by the idResolver does not match the existing WebSession.

This commit ensures that the id of the WebSession found by idResolver matches
the existing WebSession.
To ensure we test with independence from InMemoryWebSessionStore we use
Mockito for the DefaultWebessionManager collaborators.
We want to ensure that when the response is completed, it saves the
WebSession and writes it to the response using idResolver
This allows updating the WebSession lastAccessTime without exposing a
method on WebSession in an implementation independent way.
DefaultWebSessionManager no longer requires the WebSessionStore
to use DefaultWebSession.
This method is not necessary since the WebSession that is
returned allows saving the WebSession. Additionally, it is
error prone since the wrong type might be passed into it.
This seems to be implementation specific to change the state of
DefaultWebSession. Instead handle it copy constructor
Removing ExchangeWebSession based on Feedback from Rossen. There
is no need to invoke setSessionId immediately when
WebSession.save is invoked because nothing can be communicated
to the client until the response is committed.
Fix constructor Javadoc based on feedback from Rossen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants