Skip to content

Commit

Permalink
Update SqsAckSpec.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Jan 27, 2024
1 parent 3ee4088 commit 47974a1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sqs/src/test/scala/docs/scaladsl/SqsAckSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ import pekko.stream.connectors.sqs.SqsAckResultEntry._
import pekko.stream.connectors.testkit.scaladsl.LogCapturing
import pekko.stream.scaladsl.{ Sink, Source }
import pekko.util.ccompat.JavaConverters._
import org.mockito.Answers
import org.mockito.{ Answers, Mockito }
import org.mockito.ArgumentMatchers.any
import org.mockito.Mockito.{ times, verify, when, withSettings }
import org.mockito.internal.MockitoCore
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.mockito.MockitoSugar.mock
Expand All @@ -43,9 +42,8 @@ class SqsAckSpec extends AnyFlatSpec with Matchers with DefaultTestContext with
implicit val awsSqsClient: SqsAsyncClient = spyInternal(sqsClient)

// spyInternal was created due to compile problems using Mockito 4.11 in Scala 2.12
private val mockitoCore = new MockitoCore
private def spyInternal[T](t: T): T =
mockitoCore.mock(t.getClass.asInstanceOf[Class[T]],
Mockito.mock(t.getClass.asInstanceOf[Class[T]],
withSettings.spiedInstance(t)
.defaultAnswer(Answers.CALLS_REAL_METHODS))

Expand Down

0 comments on commit 47974a1

Please sign in to comment.