File tree 2 files changed +18
-1
lines changed
main/scala/com/softwaremill/session
test/scala/com/softwaremill/session
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -210,4 +210,4 @@ trait RefreshableSessionDirectives { this: OneOffSessionDirectives =>
210
210
}
211
211
}
212
212
}
213
- }
213
+ }
Original file line number Diff line number Diff line change @@ -106,6 +106,23 @@ class RefreshableTest extends FlatSpec with ScalatestRouteTest with Matchers wit
106
106
}
107
107
}
108
108
109
+ p should " set a new session after the session is re-created" in {
110
+ Get (" /set" ) ~> routes ~> check {
111
+ val Some (token1) = using.getRefreshToken
112
+ val session1 = using.getSession
113
+ session1 should be(' defined )
114
+
115
+ Get (" /getOpt" ) ~>
116
+ addHeader(using.setRefreshTokenHeader(token1)) ~>
117
+ routes ~>
118
+ check {
119
+ val session2 = using.getSession
120
+ session2 should be(' defined )
121
+ session2 should not be (session1)
122
+ }
123
+ }
124
+ }
125
+
109
126
p should " read an optional session when none is set" in {
110
127
Get (" /getOpt" ) ~> routes ~> check {
111
128
responseAs[String ] should be(" None" )
You can’t perform that action at this time.
0 commit comments