From 426c24fecf4ac0ff3461f925f8f5f1131fc71813 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 23 Aug 2023 10:11:35 +0100 Subject: [PATCH] change build again --- build.sbt | 13 ++----------- .../softwaremill/session/CsrfDirectivesTest.scala | 2 +- .../scala/com/softwaremill/session/OneOffTest.scala | 8 ++++---- .../com/softwaremill/session/RefreshableTest.scala | 10 +++++----- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/build.sbt b/build.sbt index 1935038f..07f5c129 100644 --- a/build.sbt +++ b/build.sbt @@ -20,19 +20,10 @@ val akkaStreamsTestkit = "com.typesafe.akka" %% "akka-stream-testkit" % akkaStre val scalaTest = "org.scalatest" %% "scalatest" % "3.2.16" % "test" -lazy val akkaRootProject = (project in file(".")) - .settings(commonSettings: _*) - .settings(publish / skip := true, name := "akka-http-session", scalaVersion := scala2_13) - .aggregate(core.projectRefs ++ jwt.projectRefs ++ example.projectRefs ++ javaTests.projectRefs: _*) - -lazy val pekkoRootProject = (project in file(".")) - .settings(pekkoCommonSettings: _*) - .settings(publish / skip := true, name := "pekko-http-session", scalaVersion := scala2_13) - .aggregate(pekkoCore.projectRefs ++ pekkoJwt.projectRefs ++ pekkoExample.projectRefs ++ pekkoJavaTests.projectRefs: _*) - lazy val rootProject = (project in file(".")) .settings(publish / skip := true, name := "akka-http-session-root", scalaVersion := scala2_13) - .aggregate(akkaRootProject, pekkoRootProject) + .aggregate(core.projectRefs ++ jwt.projectRefs ++ example.projectRefs ++ javaTests.projectRefs ++ + pekkoCore.projectRefs ++ pekkoJwt.projectRefs ++ pekkoExample.projectRefs ++ pekkoJavaTests.projectRefs: _*) lazy val core = (projectMatrix in file("core")) .settings(commonSettings: _*) diff --git a/core/src/test/scala/com/softwaremill/session/CsrfDirectivesTest.scala b/core/src/test/scala/com/softwaremill/session/CsrfDirectivesTest.scala index 748caef3..bf87dad1 100644 --- a/core/src/test/scala/com/softwaremill/session/CsrfDirectivesTest.scala +++ b/core/src/test/scala/com/softwaremill/session/CsrfDirectivesTest.scala @@ -43,7 +43,7 @@ class CsrfDirectivesTest extends AnyFlatSpec with ScalatestRouteTest with Matche responseAs[String] should be("ok") val csrfCookieOption = header[`Set-Cookie`] - csrfCookieOption should be('defined) + csrfCookieOption shouldBe defined val Some(csrfCookie) = csrfCookieOption csrfCookie.cookie.name should be(cookieName) diff --git a/core/src/test/scala/com/softwaremill/session/OneOffTest.scala b/core/src/test/scala/com/softwaremill/session/OneOffTest.scala index 8688a674..ece39dd2 100644 --- a/core/src/test/scala/com/softwaremill/session/OneOffTest.scala +++ b/core/src/test/scala/com/softwaremill/session/OneOffTest.scala @@ -55,7 +55,7 @@ class OneOffTest extends AnyFlatSpec with ScalatestRouteTest with Matchers with "Using cookies" should "set the correct session cookie name" in { Get("/set") ~> createRoutes(TestUsingCookies) ~> check { val sessionCookieOption = header[`Set-Cookie`] - sessionCookieOption should be('defined) + sessionCookieOption shouldBe defined val Some(sessionCookie) = sessionCookieOption sessionCookie.cookie.name should be(TestUsingCookies.sessionCookieName) @@ -71,7 +71,7 @@ class OneOffTest extends AnyFlatSpec with ScalatestRouteTest with Matchers with responseAs[String] should be("ok") val sessionOption = using.getSession - sessionOption should be('defined) + sessionOption shouldBe defined using.isSessionExpired should be(false) } @@ -188,7 +188,7 @@ class OneOffTest extends AnyFlatSpec with ScalatestRouteTest with Matchers with val legacySession = Legacy.encodeV0_5_1(data, now, sessionConfig) Get("/getReq") ~> addHeader(using.setSessionHeader(legacySession)) ~> routes(manager_tokenMigrationFromV0_5_1) ~> check { - using.getSession should be('defined) + using.getSession shouldBe defined responseAs[String] should be(data.toString) } } @@ -213,7 +213,7 @@ class OneOffTest extends AnyFlatSpec with ScalatestRouteTest with Matchers with val legacySession = Legacy.encodeV0_5_2(data, now, sessionConfig) Get("/getReq") ~> addHeader(using.setSessionHeader(legacySession)) ~> routes(manager_tokenMigrationFromV0_5_2) ~> check { - using.getSession should be('defined) + using.getSession shouldBe defined responseAs[String] should be(data.toString) } } diff --git a/core/src/test/scala/com/softwaremill/session/RefreshableTest.scala b/core/src/test/scala/com/softwaremill/session/RefreshableTest.scala index 053f8067..6bd114b0 100644 --- a/core/src/test/scala/com/softwaremill/session/RefreshableTest.scala +++ b/core/src/test/scala/com/softwaremill/session/RefreshableTest.scala @@ -64,9 +64,9 @@ class RefreshableTest extends AnyFlatSpec with ScalatestRouteTest with Matchers Get("/set") ~> routes ~> check { responseAs[String] should be("ok") - using.getSession should be('defined) + using.getSession shouldBe defined using.countSessionHeaders should be(1) - using.getRefreshToken should be('defined) + using.getRefreshToken shouldBe defined using.countRefreshTokenHeaders should be(1) } } @@ -120,7 +120,7 @@ class RefreshableTest extends AnyFlatSpec with ScalatestRouteTest with Matchers Get("/set") ~> routes ~> check { val Some(token1) = using.getRefreshToken val session1 = using.getSession - session1 should be('defined) + session1 shouldBe defined Get("/getOpt") ~> addHeader(using.setRefreshTokenHeader(token1)) ~> @@ -129,7 +129,7 @@ class RefreshableTest extends AnyFlatSpec with ScalatestRouteTest with Matchers using.countSessionHeaders should be(1) using.countRefreshTokenHeaders should be(1) val session2 = using.getSession - session2 should be('defined) + session2 shouldBe defined session2 should not be (session1) } } @@ -275,7 +275,7 @@ class RefreshableTest extends AnyFlatSpec with ScalatestRouteTest with Matchers // new token should be generated session1 should not be (session3) - token3Opt should be('defined) + token3Opt shouldBe defined } } }