// 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;
                    testDirectives.invalidateSession(refreshable, sessionTransport, () -> complete("ok"))
                )

            );
    }

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

        // and
        TestRouteResult setRouteResult = testRoute(route)
            .run(HttpRequest.GET("/set"));
        HttpCookie sessionData = getSessionDataCookieValues(setRouteResult.response());

        // when
        TestRouteResult getOptRouteResult = testRoute(route)
            .run(HttpRequest.GET("/getOpt")
                .addHeader(Cookie.create(sessionDataCookieName, sessionData.value()))
            );

        // then
        getOptRouteResult.assertStatusCode(StatusCodes.OK);
        getOptRouteResult.assertEntity(EXPECTED_SESSION);
    }

    @Test
    public void shouldReadAnOptionalSessionWhenOnlyTheSessionIsSet_UsingHeaders() {
        // 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/OneOffSetRefreshableGetTest.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;

                    testDirectives.invalidateSession(refreshable, sessionTransport, () -> complete("ok"))
                )

            );
    }

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

        // and
        TestRouteResult setRouteResult = testRoute(route)
            .run(HttpRequest.GET("/set"));
        HttpCookie sessionData = getSessionDataCookieValues(setRouteResult.response());

        // when
        TestRouteResult getOptRouteResult = testRoute(route)
            .run(HttpRequest.GET("/getOpt")
                .addHeader(Cookie.create(sessionDataCookieName, sessionData.value()))
            );

        // then
        getOptRouteResult.assertStatusCode(StatusCodes.OK);
        getOptRouteResult.assertEntity(EXPECTED_SESSION);
    }

    @Test
    public void shouldReadAnOptionalSessionWhenOnlyTheSessionIsSet_UsingHeaders() {
        // given
        final Route route = createRoute(HeaderST);