0
votes

I am using spring security form based login mechanism,after sucessful login I am storing one object in session. Using that object stored in session to decide the fate on next requests.But now when I am testing that using spring mvc test with security support.I am not able to populate that session object after sucessful authentication. I tried providing session with object populated at time of login but I guess spring security clearing that session.

So How can I set that object into session after sucessful login in spring mvc test.

1
@NarekArzumanyan I am looking for something that spring security test provides - MasterCode

1 Answers

0
votes

If you want to check session content in MVC Unit Tests, you should fake the session. You can use Mock object for faking session.