Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions gateway/src/test/scala/talos/gateway/BulkheadingSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.client.WireMock
import com.github.tomakehurst.wiremock.client.WireMock.{aResponse, get, urlEqualTo}
import com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig
import org.scalatest.{BeforeAndAfterAll, FlatSpec, Matchers}
import org.scalatest.BeforeAndAfterAll
import pureconfig.ConfigSource
import talos.gateway.config.GatewayConfig

import scala.concurrent.Await
import scala.concurrent.duration._
import pureconfig.generic.auto._
import config.pureconfigExt._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class BulkheadingSpec extends FlatSpec
class BulkheadingSpec extends AnyFlatSpec
with BeforeAndAfterAll
with Matchers {

Expand Down
5 changes: 3 additions & 2 deletions gateway/src/test/scala/talos/gateway/ConfigSpec.scala
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package talos.gateway

import akka.http.scaladsl.model.HttpMethods
import org.scalatest.{FlatSpec, Matchers}
import pureconfig._
import talos.gateway.config._

import scala.concurrent.duration._

import config.pureconfigExt._
import pureconfig.generic.auto._
class ConfigSpec extends FlatSpec with Matchers {
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
class ConfigSpec extends AnyFlatSpec with Matchers {

"basic configuration with multiple services" should "be deserialised" in {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package talos.gateway

import akka.http.scaladsl.model.Uri.{Host, Path}
import akka.http.scaladsl.model.{HttpMethods, HttpRequest, StatusCodes, Uri}
import org.scalatest.{Matchers, WordSpec}
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import akka.http.scaladsl.testkit.ScalatestRouteTest
import talos.gateway.EndpointResolver.HitEndpoint
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

class EndpointResolverSpec extends WordSpec with Matchers with ScalatestRouteTest{
class EndpointResolverSpec extends AnyWordSpec with Matchers with ScalatestRouteTest{

"endpoint resolver" can {

Expand Down
6 changes: 4 additions & 2 deletions gateway/src/test/scala/talos/gateway/ExecutionApiSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package talos.gateway
import akka.actor.testkit.typed.scaladsl.ActorTestKit
import akka.http.scaladsl.model.{HttpEntity, HttpRequest, HttpResponse, StatusCodes, Uri}
import cats.effect.IO
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpec}
import org.scalatest.BeforeAndAfterAll
import talos.gateway.EndpointResolver.HitEndpoint
import talos.gateway.Gateway.ServiceCall
import talos.gateway.config.GatewayConfig

import scala.concurrent.ExecutionContext
class ExecutionApiSpec extends WordSpec with BeforeAndAfterAll with Matchers{
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class ExecutionApiSpec extends AnyWordSpec with BeforeAndAfterAll with Matchers{

val testKit = ActorTestKit()
implicit val system = testKit.system
Expand Down
4 changes: 3 additions & 1 deletion gateway/src/test/scala/talos/gateway/GatewayServerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import com.github.tomakehurst.wiremock.WireMockServer
import com.github.tomakehurst.wiremock.client.WireMock
import com.github.tomakehurst.wiremock.client.WireMock._
import com.github.tomakehurst.wiremock.core.WireMockConfiguration._
import org.scalatest.{AsyncFlatSpec, BeforeAndAfterAll, Matchers}
import org.scalatest.BeforeAndAfterAll
import org.scalatest.flatspec.AsyncFlatSpec
import org.scalatest.matchers.should.Matchers

class GatewayServerSpec extends AsyncFlatSpec with Matchers with BeforeAndAfterAll {

Expand Down
5 changes: 3 additions & 2 deletions gateway/src/test/scala/talos/gateway/GatewaySpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package talos.gateway

import akka.http.scaladsl.model._
import akka.http.scaladsl.testkit.ScalatestRouteTest
import org.scalatest.{Matchers, WordSpec}
import talos.gateway.Gateway.ServiceCall

import scala.concurrent.Future
class GatewaySpec extends WordSpec with Matchers with ScalatestRouteTest{
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
class GatewaySpec extends AnyWordSpec with Matchers with ScalatestRouteTest{


"talos gateway" can {
Expand Down
2 changes: 1 addition & 1 deletion laws/src/main/scala/talos/laws/EventBusLaws.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package talos.laws

import org.scalacheck._
import org.scalatest.Matchers
import talos.circuitbreakers.EventBus
import talos.events.TalosEvents.model.CircuitBreakerEvent
import org.scalacheck.ScalacheckShapeless._
import org.scalatest.matchers.should.Matchers

trait EventBusLaws[S] extends Matchers{
def acceptMsg: CircuitBreakerEvent
Expand Down
2 changes: 1 addition & 1 deletion laws/src/main/scala/talos/laws/FallbackLaws.scala
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package talos.laws

import cats.effect.{Effect, IO}
import org.scalatest.Matchers
import talos.events.TalosEvents.model._
import org.scalacheck.Gen

import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
import scala.util.Try
import org.scalatest.matchers.should.Matchers

trait FallbackLaws[C, S, F[_]] extends EventBusLaws[S] with CircuitBreakerSpec[C, S, F] with Matchers {

Expand Down
2 changes: 1 addition & 1 deletion laws/src/main/scala/talos/laws/StateLaws.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package talos.laws

import cats.effect.{Effect, IO}
import org.scalatest.Matchers
import talos.events.TalosEvents.model._

import scala.concurrent.TimeoutException
import scala.util.Try
import talos.internal.crosscompat.streams._
import org.scalatest.matchers.should.Matchers
trait StateLaws[C, S, F[_]] extends CircuitBreakerSpec[C, S, F] with EventBusLaws[S] with Matchers {

def callsAreShortCircuitedFromNowOn(implicit F: Effect[F]) = {
Expand Down
4 changes: 2 additions & 2 deletions laws/src/main/scala/talos/laws/TalosCircuitBreakerLaws.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package talos.laws

import cats.effect.Effect
import org.scalatest.WordSpecLike
import org.scalatest.wordspec.AnyWordSpecLike

abstract class TalosCircuitBreakerLaws[C, S, F[_]](implicit F: Effect[F]) extends
WordSpecLike with MeasurementLaws[C, S, F] with StateLaws[C, S, F] with FallbackLaws[C, S, F] {
AnyWordSpecLike with MeasurementLaws[C, S, F] with StateLaws[C, S, F] with FallbackLaws[C, S, F] {

"a talos circuit breaker" must {
"send events to the subscribers" in {
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object Dependencies {
val akka = "2.6.8"
val circe = "0.13.0"
val kamon = "2.1.4"
val scalatest = "3.0.8"
val scalatest = "3.2.0"
val akkaHttp = "10.1.12"
val monix = "3.2.2"
val gatling = "3.1.0"
Expand Down