Skip to content

Commit

Permalink
compile issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Oct 8, 2023
1 parent 1edee50 commit 92b72b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions sqs/src/test/scala/docs/scaladsl/SqsAckSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package docs.scaladsl

import java.util.concurrent.{ CompletableFuture, TimeUnit }
import java.util.function.Supplier

import org.apache.pekko
import pekko.Done
import pekko.stream.connectors.sqs.scaladsl._
Expand All @@ -25,8 +24,10 @@ 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.ArgumentMatchers.any
import org.mockito.Mockito.{ spy, times, verify, when }
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 @@ -39,7 +40,14 @@ class SqsAckSpec extends AnyFlatSpec with Matchers with DefaultTestContext with

trait IntegrationFixture {
val queueUrl: String = randomQueueUrl()
implicit val awsSqsClient: SqsAsyncClient = spy(sqsClient)
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]],
withSettings.spiedInstance(t)
.defaultAnswer(Answers.CALLS_REAL_METHODS))

def sendMessage(message: String): Unit = {
def request =
Expand Down
2 changes: 1 addition & 1 deletion sqs/src/test/scala/docs/scaladsl/SqsSourceSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SqsSourceSpec extends AnyFlatSpec with ScalaFutures with Matchers with Def

import SqsSourceSpec._

implicit override val patienceConfig = PatienceConfig(timeout = 10.seconds, interval = 100.millis)
implicit override val patienceConfig: PatienceConfig = PatienceConfig(timeout = 10.seconds, interval = 100.millis)

trait IntegrationFixture {
val queueUrl: String = randomQueueUrl()
Expand Down

0 comments on commit 92b72b8

Please sign in to comment.