diff --git a/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/bson/derivation/DerivedCodecsSuite.scala b/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/bson/derivation/DerivedCodecsSuite.scala index 56464f33..d371a295 100644 --- a/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/bson/derivation/DerivedCodecsSuite.scala +++ b/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/bson/derivation/DerivedCodecsSuite.scala @@ -1,6 +1,5 @@ package ru.tinkoff.tcb.bson.derivation -import derevo.derive import org.mongodb.scala.bson.BsonDocument import org.scalacheck.Arbitrary import org.scalacheck.Gen @@ -10,17 +9,8 @@ import org.scalatest.matchers.should.Matchers import org.scalatestplus.scalacheck.Checkers import ru.tinkoff.tcb.bson.* -import ru.tinkoff.tcb.bson.annotation.BsonDiscriminator class DerivedCodecsSuite extends AnyFunSuite with Checkers with Matchers with TryValues { - - // Stolen from http://github.com/travisbrown/circe - @derive(bsonDecoder, bsonEncoder) @BsonDiscriminator("case", _.reverse) - sealed trait RecursiveAdtExample - final case class BaseAdtExample(a: String) extends RecursiveAdtExample - final case class NestedAdtExample(r: RecursiveAdtExample) extends RecursiveAdtExample - object RecursiveAdtExample - private def atDepth(depth: Int): Gen[RecursiveAdtExample] = if (depth < 3) Gen.oneOf( diff --git a/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/bson/derivation/TestDomain.scala b/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/bson/derivation/TestDomain.scala index 142ed767..6d71712a 100644 --- a/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/bson/derivation/TestDomain.scala +++ b/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/bson/derivation/TestDomain.scala @@ -5,6 +5,7 @@ import java.time.Year import derevo.derive +import ru.tinkoff.tcb.bson.annotation.BsonDiscriminator import ru.tinkoff.tcb.bson.annotation.BsonKey @derive(bsonDecoder, bsonEncoder) @@ -35,3 +36,10 @@ final case class TestEntityWithDefaults( linkId: Option[Int], checks: Seq[TestCheck] = Seq() ) + +// Stolen from http://github.com/travisbrown/circe +@derive(bsonDecoder, bsonEncoder) @BsonDiscriminator("case", _.reverse) +sealed trait RecursiveAdtExample +final case class BaseAdtExample(a: String) extends RecursiveAdtExample +final case class NestedAdtExample(r: RecursiveAdtExample) extends RecursiveAdtExample +object RecursiveAdtExample diff --git a/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/generic/FieldsSpec.scala b/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/generic/FieldsSpec.scala index 063152b8..8ab64239 100644 --- a/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/generic/FieldsSpec.scala +++ b/backend/dataAccess/src/test/scala/ru/tinkoff/tcb/generic/FieldsSpec.scala @@ -4,8 +4,6 @@ import org.scalatest.funsuite.AnyFunSuite import org.scalatest.matchers.should.Matchers class FieldsSpec extends AnyFunSuite with Matchers { - case class Evidence() - test("Fields of empty case class") { Fields[Evidence].fields shouldBe Nil } @@ -16,11 +14,13 @@ class FieldsSpec extends AnyFunSuite with Matchers { Fields[Projection].fields shouldBe List("ev", "label") } - sealed trait ST - final case class A(a: Int) extends ST - final case class B(b: Int) extends ST - test("Fields of sealed trait") { Fields[ST].fields shouldBe Nil } } + +final case class Evidence() + +sealed trait ST +final case class A(a: Int) extends ST +final case class B(b: Int) extends ST diff --git a/backend/mockingbird-api/src/main/scala/ru/tinkoff/tcb/mockingbird/TrustSomeHostsManager.scala b/backend/mockingbird-api/src/main/scala/ru/tinkoff/tcb/mockingbird/TrustSomeHostsManager.scala index 171b9974..15261a45 100644 --- a/backend/mockingbird-api/src/main/scala/ru/tinkoff/tcb/mockingbird/TrustSomeHostsManager.scala +++ b/backend/mockingbird-api/src/main/scala/ru/tinkoff/tcb/mockingbird/TrustSomeHostsManager.scala @@ -7,6 +7,7 @@ import java.security.cert.X509Certificate import javax.net.ssl.SSLEngine import javax.net.ssl.TrustManagerFactory import javax.net.ssl.X509ExtendedTrustManager +import scala.annotation.nowarn /* Rewritten from https://github.com/line/armeria/blob/main/core/src/main/java/com/linecorp/armeria/client/IgnoreHostsTrustManager.java @@ -47,8 +48,9 @@ class TrustSomeHostsManager(delegate: X509ExtendedTrustManager, insecureHosts: S } object TrustSomeHostsManager { + @nowarn("cat=lint-nonlocal-return") def of(insecureHosts: Set[String]): TrustSomeHostsManager = { - var trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm) + val trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm) trustManagerFactory.init(null.asInstanceOf[KeyStore]) val trustManagers = trustManagerFactory.getTrustManagers for (tm <- trustManagers)