Skip to content

Commit 38ff143

Browse files
mcc-1326235 compile fixes
1 parent 3152e15 commit 38ff143

File tree

6 files changed

+29
-13
lines changed

6 files changed

+29
-13
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ lazy val `mauth-signer-http4s-022` = scalaModuleProject("mauth-signer-http4s-022
128128
libraryDependencies ++=
129129
Dependencies.provided(http4sClient022) ++
130130
Dependencies.compile(enumeratum) ++
131-
Dependencies.test(munitCatsEffect2, http4sDsl022)
131+
Dependencies.test(munitCatsEffect, http4sDsl022)
132132
)
133133

134134
// A separate module to sign and send sttp request using akka-http backend

modules/mauth-authenticator-scala/src/test/scala/com/mdsol/mauth/MauthProtocolSuiteSpec.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class MauthProtocolSuiteSpec extends AnyFlatSpec with BeforeAndAfterAll with Mat
2424

2525
behavior of "MauthProtocolSuiteSpec"
2626

27-
val signingConfig = ProtocolTestSuiteHelper.SIGNING_CONFIG
27+
lazy val signingConfig: SigningConfig = ProtocolTestSuiteHelper.SIGNING_CONFIG
2828
if (signingConfig == null) {
2929
fail("Signing Configuration is not available.")
3030
}
@@ -33,13 +33,13 @@ class MauthProtocolSuiteSpec extends AnyFlatSpec with BeforeAndAfterAll with Mat
3333
fail("Public Key is not available.")
3434
}
3535

36-
val publicKey = MAuthKeysHelper.getPublicKeyFromString(ProtocolTestSuiteHelper.PUBLIC_KEY)
37-
val uuid = UUID.fromString(signingConfig.getAppUuid)
38-
val privateKey = getPrivateKeyFromString(signingConfig.getPrivateKey)
36+
private val publicKey = MAuthKeysHelper.getPublicKeyFromString(ProtocolTestSuiteHelper.PUBLIC_KEY)
37+
private val uuid = UUID.fromString(signingConfig.getAppUuid)
38+
private val privateKey = getPrivateKeyFromString(signingConfig.getPrivateKey)
3939
val mAuthSigner = new DefaultSigner(uuid, privateKey, mockEpochTimeProvider, java.util.Arrays.asList(MAuthVersion.MWSV2))
4040

4141
// run the tests
42-
val testSpecifications = ProtocolTestSuiteHelper.TEST_SPECIFICATIONS
42+
private val testSpecifications = ProtocolTestSuiteHelper.TEST_SPECIFICATIONS
4343
testSpecifications.foreach { testSpec =>
4444
testSpec.getType match {
4545
case CaseType.AUTHENTICATION_ONLY =>

modules/mauth-signer-akka-http/src/test/scala/com/mdsol/mauth/MAuthRequestAkkaSignerSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import com.mdsol.mauth.http.Implicits._
1414
import com.mdsol.mauth.models.{UnsignedRequest => NewUnsignedRequest}
1515
import com.mdsol.mauth.test.utils.TestFixtures._
1616
import com.mdsol.mauth.util.EpochTimeProvider
17-
import org.apache.http.HttpStatus
17+
import org.apache.hc.core5.http.HttpStatus
1818
import org.bouncycastle.jce.provider.BouncyCastleProvider
1919
import org.scalatest.BeforeAndAfterAll
2020
import org.scalatest.concurrent.PatienceConfiguration.Timeout

modules/mauth-signer-http4s-022/src/main/scala/com/mdsol/mauth/http4s022/client/MAuthSigner.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import com.mdsol.mauth.RequestSigner
66
import com.mdsol.mauth.models.UnsignedRequest
77
import org.http4s.Request
88
import org.http4s.client.Client
9-
9+
import org.http4s.EntityDecoder.byteArrayDecoder
1010
import java.net.URI
1111

1212
object MAuthSigner {
13-
def apply[F[_]: Sync](signer: RequestSigner)(client: Client[F]): Client[F] =
13+
def apply[F[_]: Concurrent](signer: RequestSigner)(client: Client[F]): Client[F] =
1414
Client { req =>
1515
for {
1616
req <- Resource.eval(req.as[Array[Byte]].flatMap { byteArray =>

project/BuildSettings.scala

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ object BuildSettings {
2626
"-Wconf:msg=.*(Uns|S)ignedRequest|signRequest|(decrypt|encrypt)Signature|" +
2727
"generateRequestHeaders|extract(MwsTime|MAuth)Header|" +
2828
"generateDigestedMessageV1|generateUnencryptedSignature:s",
29-
"-Wnonunit-statement",
3029
"-Wconf:msg=type Seq in package scala has changed semantics:s",
3130
"-Wconf:msg=type IndexedSeq in package scala has changed semantics:s",
3231
"-Wconf:msg=constructor modifiers are assumed by synthetic:s",
@@ -35,8 +34,26 @@ object BuildSettings {
3534
"-Wconf:msg=which is not part of the implicit scope in Scala 3:s",
3635
"-Wconf:msg=Synthetic case companion used as a function.:s",
3736
"-Wconf:cat=deprecation:s"
38-
), // Stop these being errors, they are fine.
39-
Test / scalacOptions -= "-Wnonunit-statement",
37+
) ++ (CrossVersion.partialVersion(scalaVersion.value) match {
38+
case Some((2, n)) if n >= 13 =>
39+
List(
40+
"-Wnonunit-statement",
41+
// other scalac options for 2.13+
42+
)
43+
case _ =>
44+
List(
45+
)
46+
}), // Stop these being errors, they are fine.
47+
Test / scalacOptions --= (CrossVersion.partialVersion(scalaVersion.value) match {
48+
case Some((2, n)) if n >= 13 =>
49+
List(
50+
"-Wnonunit-statement",
51+
// other scalac options for 2.13+
52+
)
53+
case _ =>
54+
List(
55+
)
56+
}),
4057
scalacOptions --= {
4158
if (sys.env.contains("CI"))
4259
Seq.empty

project/Dependencies.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ object Dependencies extends DependencyUtils {
6464
val scalaTest: ModuleID = "org.scalatest" %% "scalatest" % "3.2.19"
6565
val wiremock: ModuleID = "com.github.tomakehurst" % "wiremock" % "3.0.1"
6666
val munitCatsEffect: ModuleID = "org.typelevel" %% "munit-cats-effect-3" % "1.0.7"
67-
val munitCatsEffect2: ModuleID = "org.typelevel" %% "munit-cats-effect-2" % "1.0.7"
6867
val log4catsNoop: ModuleID = "org.typelevel" %% "log4cats-noop" % Version.log4cats
6968
val scalaCacheCaffeine: ModuleID = "com.github.cb372" %% "scalacache-caffeine" % "1.0.0-M6"
7069

0 commit comments

Comments
 (0)