Skip to content

Commit

Permalink
Merge pull request #409 from guardian/update/non_aws
Browse files Browse the repository at this point in the history
chore(deps): Non-AWS dependency updates
  • Loading branch information
fredex42 authored Jun 11, 2024
2 parents 69778e0 + 13ad4da commit 0d09825
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import org.scalatest.exceptions.TestFailedException
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import scala.concurrent.{ExecutionContext, Future, Promise}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

object FakeGuardianContentClient {
private final val ApiKeyProperty = "CAPI_TEST_KEY"
Expand Down Expand Up @@ -65,7 +67,7 @@ class FakeGuardianContentClient(retries: Int, failCode: Option[Int], alwaysFail:

}

class GuardianContentClientBackoffTest extends FlatSpec with Matchers with ScalaFutures with OptionValues with BeforeAndAfterAll with Inside with IntegrationPatience {
class GuardianContentClientBackoffTest extends AnyFlatSpec with Matchers with ScalaFutures with OptionValues with BeforeAndAfterAll with Inside with IntegrationPatience {

private val TestItemPath = "commentisfree/2012/aug/01/cyclists-like-pedestrians-must-get-angry"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import org.scalatest.time.{Seconds, Span}

import java.time.Instant
import scala.concurrent.ExecutionContext.Implicits.global
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

object GuardianContentClientTest {
private final val ApiKeyProperty = "CAPI_TEST_KEY"
Expand All @@ -18,7 +20,7 @@ object GuardianContentClientTest {
}.orNull ensuring(_ != null, s"Please supply a $ApiKeyProperty as a system property or an environment variable e.g. sbt -D$ApiKeyProperty=some-api-key")
}

class GuardianContentClientTest extends FlatSpec with Matchers with ScalaFutures with OptionValues with BeforeAndAfterAll with Inside with IntegrationPatience {
class GuardianContentClientTest extends AnyFlatSpec with Matchers with ScalaFutures with OptionValues with BeforeAndAfterAll with Inside with IntegrationPatience {
import GuardianContentClientTest.apiKey

private val api = new GuardianContentClient(apiKey)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import org.scalatest.concurrent.ScalaFutures

import scala.concurrent.duration.Duration
import scala.concurrent.{ExecutionContext, Future}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class BackoffTest extends FlatSpec with Matchers with ScalaFutures with OptionValues with BeforeAndAfterAll with Inside with Inspectors {
class BackoffTest extends AnyFlatSpec with Matchers with ScalaFutures with OptionValues with BeforeAndAfterAll with Inside with Inspectors {
private def NANOS = TimeUnit.NANOSECONDS
private def MILLIS = TimeUnit.MILLISECONDS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import java.util.concurrent.TimeUnit
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import scala.concurrent.{ExecutionContext, Future}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class ContentApiClientTest extends FlatSpec with Matchers with ScalaFutures with OptionValues with BeforeAndAfterAll with Inside with Inspectors {
class ContentApiClientTest extends AnyFlatSpec with Matchers with ScalaFutures with OptionValues with BeforeAndAfterAll with Inside with Inspectors {
private val api = new ContentApiClient {
val retryDuration = Duration(250L, TimeUnit.MILLISECONDS)
val maxRetries = 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package com.gu.contentapi.client

import com.gu.contentapi.client.BackoffStrategy.constantStrategy
import com.gu.contentapi.client.model.HttpResponse
import org.scalatest.{AsyncWordSpecLike, Matchers}

import scala.concurrent.Future
import scala.concurrent.duration._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpecLike

class HttpRetryTest extends AsyncWordSpecLike with Matchers {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.gu.contentapi.client

import com.gu.contentapi.client.BackoffStrategy.constantStrategy
import org.scalatest.{AsyncWordSpecLike, Matchers, RecoverMethods}
import org.scalatest.RecoverMethods

import scala.concurrent.Future
import scala.concurrent.duration._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpecLike

class RetryTest extends AsyncWordSpecLike with Matchers with RecoverMethods {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.gu.contentapi.client.model

import org.scalatest.{FlatSpec, Matchers}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class ContentApiErrorTest extends FlatSpec with Matchers {
class ContentApiErrorTest extends AnyFlatSpec with Matchers {
"ContentApiError" should "Handle error responses properly" in {
ContentApiError(HttpResponse(Array(), 500, "error")) should be (ContentApiError(500, "error"))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.gu.contentapi.client.model

import org.scalatest.{Matchers, FlatSpec}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class ContentApiQueryTest extends FlatSpec with Matchers {
class ContentApiQueryTest extends AnyFlatSpec with Matchers {
"ItemQuery" should "be excellent" in {
ItemQuery("profile/robert-berry").showFields("all").getUrl("") shouldEqual
"/profile/robert-berry?show-fields=all"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.gu.contentapi.client.model

import org.scalatest.{Matchers, FlatSpec}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class VideoStatsQueryTest extends FlatSpec with Matchers {
class VideoStatsQueryTest extends AnyFlatSpec with Matchers {

it should "request overall video stats" in {
VideoStatsQuery().pathSegment shouldEqual
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import com.gu.contentapi.client.utils.CapiModelEnrichment._
import com.gu.contentapi.client.utils._
import com.gu.contentapi.client.utils.format._
import org.mockito.Mockito._
import org.scalatest.{FlatSpec, Matchers}
import org.scalatest.mockito.MockitoSugar
import org.scalatestplus.mockito.MockitoSugar
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class CapiModelEnrichmentDesignTypeTest extends FlatSpec with MockitoSugar with Matchers {
class CapiModelEnrichmentDesignTypeTest extends AnyFlatSpec with MockitoSugar with Matchers {

def fixture = new {
val content: Content = mock[Content]
Expand Down Expand Up @@ -172,7 +173,7 @@ class CapiModelEnrichmentDesignTypeTest extends FlatSpec with MockitoSugar with
}
}

class CapiModelEnrichmentFormatTest extends FlatSpec with MockitoSugar with Matchers {
class CapiModelEnrichmentFormatTest extends AnyFlatSpec with MockitoSugar with Matchers {

def fixture = new {
val content: Content = mock[Content]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.gu.contentapi.client.utils

import org.scalatest.{FlatSpec, Matchers}
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

class QueryStringParamsTest extends FlatSpec with Matchers {
class QueryStringParamsTest extends AnyFlatSpec with Matchers {

"QueryStringParams" should "correctly encode GET query string parameters" in {

Expand Down
11 changes: 6 additions & 5 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ object Dependencies {
val capiModelsVersion = "24.0.0"
val thriftVersion = "0.19.0"
val commonsCodecVersion = "1.16.1"
val scalaTestVersion = "3.0.9"
val slf4jVersion = "1.7.36"
val mockitoVersion = "1.10.19"
val okhttpVersion = "3.14.9"
val scalaTestVersion = "3.2.18"
val slf4jVersion = "2.0.12"
val mockitoVersion = "4.11.0"
val okhttpVersion = "4.12.0"
val awsSdkVersion = "1.11.280"

// Note: keep libthrift at a version functionally compatible with that used in content-api-models
Expand All @@ -18,8 +18,9 @@ object Dependencies {
"org.apache.thrift" % "libthrift" % thriftVersion,
"commons-codec" % "commons-codec" % commonsCodecVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % "test" exclude("org.mockito", "mockito-core"),
"org.scalatestplus" %% "mockito-4-11" % "3.2.18.0" % "test",
"org.slf4j" % "slf4j-api" % slf4jVersion,
"org.mockito" % "mockito-all" % mockitoVersion % "test"
"org.mockito" % "mockito-core" % mockitoVersion
)

val defaultClientDeps = Seq(
Expand Down

0 comments on commit 0d09825

Please sign in to comment.