// Path: core/src/main/java/com/softwaremill/session/javadsl/SessionTransports.java
// public static final SetSessionTransport CookieST = CookieST$.MODULE$;
// 
// Path: core/src/main/java/com/softwaremill/session/javadsl/SessionTransports.java
// public static final SetSessionTransport HeaderST = HeaderST$.MODULE$;


import akka.http.javadsl.model.HttpHeader;
import akka.http.javadsl.model.HttpRequest;
import akka.http.javadsl.model.StatusCodes;
import akka.http.javadsl.model.headers.Cookie;
import akka.http.javadsl.model.headers.HttpCookie;
import akka.http.javadsl.model.headers.RawHeader;
import akka.http.javadsl.server.Route;
import akka.http.javadsl.testkit.TestRouteResult;
import akka.http.scaladsl.model.HttpResponse;
import com.softwaremill.session.CsrfCheckMode;
import com.softwaremill.session.SessionContinuity;
import com.softwaremill.session.SetSessionTransport;
import org.junit.Assert;
import org.junit.Test;
import static com.softwaremill.session.javadsl.SessionTransports.CookieST;
import static com.softwaremill.session.javadsl.SessionTransports.HeaderST;
package com.softwaremill.session.javadsl;



public class OneOffTest extends HttpSessionAwareDirectivesTest {

    protected Route buildRoute(HttpSessionAwareDirectives<String> testDirectives, SessionContinuity<String> oneOff, SessionContinuity<String> refreshable, SetSessionTransport sessionTransport, CsrfCheckMode<String> checkHeader) {
        return
            route(
                path("set", () ->
                    testDirectives.setSession(oneOff, sessionTransport, SESSION, () -> complete("ok"))
                ),
                path("getOpt", () ->
                    testDirectives.optionalSession(oneOff, sessionTransport, session -> complete(session.toString()))
                ),
                path("getReq", () ->
                    testDirectives.requiredSession(oneOff, sessionTransport, session -> complete(session))
                ),
                path("touchReq", () ->
                    testDirectives.touchRequiredSession(oneOff, sessionTransport, session -> complete(session))
                ),
                path("invalidate", () ->
                    testDirectives.invalidateSession(oneOff, sessionTransport, () -> complete("ok"))
                ),
                path("full", () ->
                    testDirectives.session(oneOff, sessionTransport, sessionResult -> complete(sessionResult.toString()))
                )
            );
    }

    @Test
    public void shouldSetTheCorrectSessionCookieName_UsingCookies() {
        // given
// Path: core/src/main/java/com/softwaremill/session/javadsl/SessionTransports.java
// public static final SetSessionTransport CookieST = CookieST$.MODULE$;
// 
// Path: core/src/main/java/com/softwaremill/session/javadsl/SessionTransports.java
// public static final SetSessionTransport HeaderST = HeaderST$.MODULE$;


// Path: javaTests/src/test/java/com/softwaremill/session/javadsl/OneOffTest.java
import akka.http.javadsl.model.HttpHeader;
import akka.http.javadsl.model.HttpRequest;
import akka.http.javadsl.model.StatusCodes;
import akka.http.javadsl.model.headers.Cookie;
import akka.http.javadsl.model.headers.HttpCookie;
import akka.http.javadsl.model.headers.RawHeader;
import akka.http.javadsl.server.Route;
import akka.http.javadsl.testkit.TestRouteResult;
import akka.http.scaladsl.model.HttpResponse;
import com.softwaremill.session.CsrfCheckMode;
import com.softwaremill.session.SessionContinuity;
import com.softwaremill.session.SetSessionTransport;
import org.junit.Assert;
import org.junit.Test;
import static com.softwaremill.session.javadsl.SessionTransports.CookieST;
import static com.softwaremill.session.javadsl.SessionTransports.HeaderST;

package com.softwaremill.session.javadsl;



public class OneOffTest extends HttpSessionAwareDirectivesTest {

    protected Route buildRoute(HttpSessionAwareDirectives<String> testDirectives, SessionContinuity<String> oneOff, SessionContinuity<String> refreshable, SetSessionTransport sessionTransport, CsrfCheckMode<String> checkHeader) {
        return
            route(
                path("set", () ->
                    testDirectives.setSession(oneOff, sessionTransport, SESSION, () -> complete("ok"))
                ),
                path("getOpt", () ->
                    testDirectives.optionalSession(oneOff, sessionTransport, session -> complete(session.toString()))
                ),
                path("getReq", () ->
                    testDirectives.requiredSession(oneOff, sessionTransport, session -> complete(session))
                ),
                path("touchReq", () ->
                    testDirectives.touchRequiredSession(oneOff, sessionTransport, session -> complete(session))
                ),
                path("invalidate", () ->
                    testDirectives.invalidateSession(oneOff, sessionTransport, () -> complete("ok"))
                ),
                path("full", () ->
                    testDirectives.session(oneOff, sessionTransport, sessionResult -> complete(sessionResult.toString()))
                )
            );
    }

    @Test
    public void shouldSetTheCorrectSessionCookieName_UsingCookies() {
        // given
        final Route route = createRoute(CookieST);