99import akka .http .javadsl .server .Route ;
1010import akka .http .javadsl .testkit .TestRouteResult ;
1111import akka .http .scaladsl .model .HttpResponse ;
12- import com .softwaremill .session .CookieST$ ;
1312import com .softwaremill .session .CsrfCheckMode ;
14- import com .softwaremill .session .HeaderST$ ;
1513import com .softwaremill .session .SessionContinuity ;
1614import com .softwaremill .session .SetSessionTransport ;
1715import org .junit .Assert ;
1816import org .junit .Test ;
1917
18+ import static com .softwaremill .session .javadsl .SessionTransports .CookieST ;
19+ import static com .softwaremill .session .javadsl .SessionTransports .HeaderST ;
20+
2021public class OneOffTest extends HttpSessionAwareDirectivesTest {
2122
2223 protected Route buildRoute (HttpSessionAwareDirectives <String > testDirectives , SessionContinuity <String > oneOff , SessionContinuity <String > refreshable , SetSessionTransport sessionTransport , CsrfCheckMode <String > checkHeader ) {
@@ -44,7 +45,7 @@ protected Route buildRoute(HttpSessionAwareDirectives<String> testDirectives, Se
4445 @ Test
4546 public void shouldSetTheCorrectSessionCookieName_UsingCookies () {
4647 // given
47- final Route route = createRoute (CookieST$ . MODULE$ );
48+ final Route route = createRoute (CookieST );
4849
4950 // when
5051 TestRouteResult testRouteResult = testRoute (route )
@@ -65,7 +66,7 @@ public void shouldSetTheCorrectSessionCookieName_UsingCookies() {
6566 @ Test
6667 public void shouldSetTheSession_UsingCookies () {
6768 // given
68- final Route route = createRoute (CookieST$ . MODULE$ );
69+ final Route route = createRoute (CookieST );
6970
7071 // when
7172 TestRouteResult testRouteResult = testRoute (route )
@@ -88,7 +89,7 @@ public void shouldSetTheSession_UsingCookies() {
8889 @ Test
8990 public void shouldSetTheSession_UsingHeaders () {
9091 // given
91- final Route route = createRoute (HeaderST$ . MODULE$ );
92+ final Route route = createRoute (HeaderST );
9293
9394 // when
9495 TestRouteResult testRouteResult = testRoute (route )
@@ -111,7 +112,7 @@ public void shouldSetTheSession_UsingHeaders() {
111112 @ Test
112113 public void shouldReadAnOptionalSessionWhenTheSessionIsSet_UsingCookies () {
113114 // given
114- final Route route = createRoute (CookieST$ . MODULE$ );
115+ final Route route = createRoute (CookieST );
115116
116117 // when
117118 TestRouteResult setRouteResult = testRoute (route )
@@ -134,7 +135,7 @@ public void shouldReadAnOptionalSessionWhenTheSessionIsSet_UsingCookies() {
134135 @ Test
135136 public void shouldReadAnOptionalSessionWhenTheSessionIsSet_UsingHeaders () {
136137 // given
137- final Route route = createRoute (HeaderST$ . MODULE$ );
138+ final Route route = createRoute (HeaderST );
138139
139140 // when
140141 TestRouteResult setRouteResult = testRoute (route )
@@ -156,7 +157,7 @@ public void shouldReadAnOptionalSessionWhenTheSessionIsSet_UsingHeaders() {
156157 @ Test
157158 public void shouldReadAnOptionalSessionWhenTheSessionIsNotSet_UsingCookies () {
158159 // given
159- final Route route = createRoute (CookieST$ . MODULE$ );
160+ final Route route = createRoute (CookieST );
160161
161162 // when
162163 TestRouteResult getOptRouteResult = testRoute (route )
@@ -171,7 +172,7 @@ public void shouldReadAnOptionalSessionWhenTheSessionIsNotSet_UsingCookies() {
171172 @ Test
172173 public void shouldReadAnOptionalSessionWhenTheSessionIsNotSet_UsingHeaders () {
173174 // given
174- final Route route = createRoute (HeaderST$ . MODULE$ );
175+ final Route route = createRoute (HeaderST );
175176
176177 // when
177178 TestRouteResult getOptRouteResult = testRoute (route )
@@ -186,7 +187,7 @@ public void shouldReadAnOptionalSessionWhenTheSessionIsNotSet_UsingHeaders() {
186187 @ Test
187188 public void shouldReadARequiredSessionWhenTheSessionIsSet_UsingCookies () {
188189 // given
189- final Route route = createRoute (CookieST$ . MODULE$ );
190+ final Route route = createRoute (CookieST );
190191
191192 // when
192193 TestRouteResult setRouteResult = testRoute (route )
@@ -209,7 +210,7 @@ public void shouldReadARequiredSessionWhenTheSessionIsSet_UsingCookies() {
209210 @ Test
210211 public void shouldReadARequiredSessionWhenTheSessionIsSet_UsingHeaders () {
211212 // given
212- final Route route = createRoute (HeaderST$ . MODULE$ );
213+ final Route route = createRoute (HeaderST );
213214
214215 // when
215216 TestRouteResult setRouteResult = testRoute (route )
@@ -232,7 +233,7 @@ public void shouldReadARequiredSessionWhenTheSessionIsSet_UsingHeaders() {
232233 @ Test
233234 public void shouldInvalidateASession_UsingCookies () {
234235 // given
235- final Route route = createRoute (CookieST$ . MODULE$ );
236+ final Route route = createRoute (CookieST );
236237
237238 // when
238239 TestRouteResult setRouteResult = testRoute (route )
@@ -258,7 +259,7 @@ public void shouldInvalidateASession_UsingCookies() {
258259 @ Test
259260 public void shouldInvalidateASession_UsingHeaders () {
260261 // given
261- final Route route = createRoute (HeaderST$ . MODULE$ );
262+ final Route route = createRoute (HeaderST );
262263
263264 // when
264265 TestRouteResult setRouteResult = testRoute (route )
@@ -284,7 +285,7 @@ public void shouldInvalidateASession_UsingHeaders() {
284285 @ Test
285286 public void shouldRejectTheRequestIfTheSessionIsNotSet_UsingCookies () {
286287 // given
287- final Route route = createRoute (CookieST$ . MODULE$ );
288+ final Route route = createRoute (CookieST );
288289
289290 // when
290291 TestRouteResult getOptRouteResult = testRoute (route )
@@ -298,7 +299,7 @@ public void shouldRejectTheRequestIfTheSessionIsNotSet_UsingCookies() {
298299 @ Test
299300 public void shouldRejectTheRequestIfTheSessionIsNotSet_UsingHeaders () {
300301 // given
301- final Route route = createRoute (HeaderST$ . MODULE$ );
302+ final Route route = createRoute (HeaderST );
302303
303304 // when
304305 TestRouteResult getReqRouteResult = testRoute (route )
@@ -313,7 +314,7 @@ public void shouldRejectTheRequestIfTheSessionIsNotSet_UsingHeaders() {
313314 @ Test
314315 public void shouldRejectTheRequestIfTheSessionIsInvalid_UsingCookies () {
315316 // given
316- final Route route = createRoute (CookieST$ . MODULE$ );
317+ final Route route = createRoute (CookieST );
317318
318319 // when
319320 TestRouteResult getOptRouteResult = testRoute (route )
@@ -329,7 +330,7 @@ public void shouldRejectTheRequestIfTheSessionIsInvalid_UsingCookies() {
329330 @ Test
330331 public void shouldRejectTheRequestIfTheSessionIsInvalid_UsingHeaders () {
331332 // given
332- final Route route = createRoute (HeaderST$ . MODULE$ );
333+ final Route route = createRoute (HeaderST );
333334
334335 // when
335336 TestRouteResult getOptRouteResult = testRoute (route )
@@ -344,9 +345,9 @@ public void shouldRejectTheRequestIfTheSessionIsInvalid_UsingHeaders() {
344345
345346 @ Test
346347 public void shouldTouchTheSession_UsingCookies () {
347- final Route route_fixed = createRoute (CookieST$ . MODULE$ , getExpiring60SessionManagerWithFixedTime ());
348- final Route route_fixed_plus30s = createRoute (CookieST$ . MODULE$ , getExpiring60Plus30SessionManagerWithFixedTime ());
349- final Route route_fixed_plus70s = createRoute (CookieST$ . MODULE$ , getExpiring60Plus70SessionManagerWithFixedTime ());
348+ final Route route_fixed = createRoute (CookieST , getExpiring60SessionManagerWithFixedTime ());
349+ final Route route_fixed_plus30s = createRoute (CookieST , getExpiring60Plus30SessionManagerWithFixedTime ());
350+ final Route route_fixed_plus70s = createRoute (CookieST , getExpiring60Plus70SessionManagerWithFixedTime ());
350351
351352 TestRouteResult setRouteResult = testRoute (route_fixed )
352353 .run (HttpRequest .GET ("/set" ));
@@ -385,9 +386,9 @@ public void shouldTouchTheSession_UsingCookies() {
385386
386387 @ Test
387388 public void shouldTouchTheSession_KeepingTheRefreshTokenIntact_UsingHeaders () {
388- final Route route_fixed = createRoute (HeaderST$ . MODULE$ , getExpiring60SessionManagerWithFixedTime ());
389- final Route route_fixed_plus30s = createRoute (HeaderST$ . MODULE$ , getExpiring60Plus30SessionManagerWithFixedTime ());
390- final Route route_fixed_plus70s = createRoute (HeaderST$ . MODULE$ , getExpiring60Plus70SessionManagerWithFixedTime ());
389+ final Route route_fixed = createRoute (HeaderST , getExpiring60SessionManagerWithFixedTime ());
390+ final Route route_fixed_plus30s = createRoute (HeaderST , getExpiring60Plus30SessionManagerWithFixedTime ());
391+ final Route route_fixed_plus70s = createRoute (HeaderST , getExpiring60Plus70SessionManagerWithFixedTime ());
391392
392393 TestRouteResult setRouteResult = testRoute (route_fixed )
393394 .run (HttpRequest .GET ("/set" ));
0 commit comments