diff --git a/aws/sqs/integration/src/test/scala/com/commercetools/queue/sqs/SqsClientSuite.scala b/aws/sqs/integration/src/test/scala/com/commercetools/queue/sqs/SqsClientSuite.scala index d90a9c1..4509140 100644 --- a/aws/sqs/integration/src/test/scala/com/commercetools/queue/sqs/SqsClientSuite.scala +++ b/aws/sqs/integration/src/test/scala/com/commercetools/queue/sqs/SqsClientSuite.scala @@ -21,7 +21,7 @@ import cats.syntax.all._ import com.commercetools.queue.QueueClient import com.commercetools.queue.aws.sqs.SQSClient import com.commercetools.queue.testkit.QueueClientSuite -import software.amazon.awssdk.auth.credentials.{AnonymousCredentialsProvider, AwsBasicCredentials, StaticCredentialsProvider} +import software.amazon.awssdk.auth.credentials.{AnonymousCredentialsProvider, AwsSessionCredentials, StaticCredentialsProvider} import software.amazon.awssdk.regions.Region import java.net.URI @@ -40,9 +40,12 @@ class SqsClientSuite extends QueueClientSuite { .asScala .find(_.id == awsRegion) .liftTo[IO](new IllegalArgumentException(s"Cannot find any suitable AWS region from $awsRegion value!")) - credentials <- (string("AWS_SQS_ACCESS_KEY"), string("AWS_SQS_ACCESS_SECRET")).mapN((accessKey, accessSecret) => + accessKey <- string("AWS_SQS_ACCESS_KEY") + accessSecret <- string("AWS_SQS_ACCESS_SECRET") + sessionToken <- string("AWS_SQS_SESSION_TOKEN") + credentials <- IO.pure( StaticCredentialsProvider.create( - AwsBasicCredentials.create(accessKey, accessSecret) + AwsSessionCredentials.create(accessKey, accessSecret, sessionToken) )) } yield (region, credentials, None) ) diff --git a/testkit/src/main/scala/com/commercetools/queue/testkit/QueueClientSuite.scala b/testkit/src/main/scala/com/commercetools/queue/testkit/QueueClientSuite.scala index 01298c3..9be3629 100644 --- a/testkit/src/main/scala/com/commercetools/queue/testkit/QueueClientSuite.scala +++ b/testkit/src/main/scala/com/commercetools/queue/testkit/QueueClientSuite.scala @@ -34,7 +34,7 @@ abstract class QueueClientSuite val messagesStatsSupported: Boolean = true val inFlightMessagesStatsSupported: Boolean = true val delayedMessagesStatsSupported: Boolean = true - val waitingTime: FiniteDuration = 10.seconds + val waitingTime: FiniteDuration = 20.seconds final val originalMessageTTL: FiniteDuration = 10.minutes final val originalLockTTL: FiniteDuration = 2.minutes diff --git a/testkit/src/main/scala/com/commercetools/queue/testkit/QueueSubscriberSuite.scala b/testkit/src/main/scala/com/commercetools/queue/testkit/QueueSubscriberSuite.scala index 2a6a1ef..687e953 100644 --- a/testkit/src/main/scala/com/commercetools/queue/testkit/QueueSubscriberSuite.scala +++ b/testkit/src/main/scala/com/commercetools/queue/testkit/QueueSubscriberSuite.scala @@ -155,9 +155,11 @@ trait QueueSubscriberSuite extends CatsEffectSuite { self: QueueClientSuite => .through(client.publish(queueName).sink(batchSize = totalMessages)) .compile .drain + _ <- IO.sleep(3.seconds) msgBatch <- puller.pullMessageBatch(totalMessages, waitingTime) _ = assertEquals(msgBatch.messages.size, totalMessages) _ <- msgBatch.nackAll + _ <- IO.sleep(3.seconds) msgBatchNack <- puller.pullMessageBatch(totalMessages, waitingTime) _ = assertEquals(msgBatchNack.messages.size, totalMessages) _ <- msgBatchNack.ackAll