Skip to content

Commit

Permalink
Reformat with scalafmt 3.7.15
Browse files Browse the repository at this point in the history
Executed command: scalafmt --non-interactive
  • Loading branch information
scala-steward committed Oct 25, 2023
1 parent 41aaa17 commit 23f5d3f
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import java.time.{Instant, OffsetDateTime, ZoneOffset}

object OffsetDateTimeUtil {

def ofEpochMilli(millis: Long): OffsetDateTime = OffsetDateTime.ofInstant(Instant.ofEpochMilli(millis), ZoneOffset.UTC)
def ofEpochMilli(millis: Long): OffsetDateTime =
OffsetDateTime.ofInstant(Instant.ofEpochMilli(millis), ZoneOffset.UTC)
}
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,12 @@ class QueueActorMsgOpsTest extends ActorTest with QueueManagerForEachTest with D
} yield {
// Then
lookupResult.statistics should be(MessageStatistics.empty)
receiveResult1.statistics should be(MessageStatistics(OnDateTimeReceived(OffsetDateTimeUtil.ofEpochMilli(100L)), 1))
receiveResult2.statistics should be(MessageStatistics(OnDateTimeReceived(OffsetDateTimeUtil.ofEpochMilli(100L)), 2))
receiveResult1.statistics should be(
MessageStatistics(OnDateTimeReceived(OffsetDateTimeUtil.ofEpochMilli(100L)), 1)
)
receiveResult2.statistics should be(
MessageStatistics(OnDateTimeReceived(OffsetDateTimeUtil.ofEpochMilli(100L)), 2)
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import akka.actor.{ActorRef, ActorSystem, Props}
import akka.util.Timeout
import com.amazonaws.auth.{AWSStaticCredentialsProvider, BasicAWSCredentials}
import com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration
import com.amazonaws.services.sqs.model.{CreateQueueRequest, DeleteMessageRequest, ReceiveMessageRequest, SendMessageRequest}
import com.amazonaws.services.sqs.model.{
CreateQueueRequest,
DeleteMessageRequest,
ReceiveMessageRequest,
SendMessageRequest
}
import com.amazonaws.services.sqs.{AmazonSQS, AmazonSQSClientBuilder}
import org.elasticmq._
import org.elasticmq.actor.QueueManagerActor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ case class DBMessage(

val serializedDeliveryReceipts = new String(deliveryReceipts).parseJson.convertTo[List[String]]

val firstReceive = received.map(time => OnDateTimeReceived(OffsetDateTimeUtil.ofEpochMilli(time))).getOrElse(NeverReceived)
val firstReceive =
received.map(time => OnDateTimeReceived(OffsetDateTimeUtil.ofEpochMilli(time))).getOrElse(NeverReceived)

InternalMessage(
messageId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ trait QueueAttributesOps extends AttributesModule {
() => stats.map(_.approximateNumberOfMessagesDelayed.toString)
),
AttributeValuesCalculator
.Rule(CreatedTimestampAttribute, () => Future.successful((queueData.created.toInstant.toEpochMilli / 1000L).toString)),
.Rule(
CreatedTimestampAttribute,
() => Future.successful((queueData.created.toInstant.toEpochMilli / 1000L).toString)
),
AttributeValuesCalculator.Rule(
LastModifiedTimestampAttribute,
() => Future.successful((queueData.lastModified.toInstant.toEpochMilli / 1000L).toString)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ class QueueDirectivesTest
"queueActorFromUrl" should "return correct queue name based on QueueName" in {
val future = queueManagerActor ? CreateQueue(
CreateQueueData.from(
QueueData("lol", MillisVisibilityTimeout(1L), Duration.ZERO, Duration.ZERO, OffsetDateTime.now(), OffsetDateTime.now())
QueueData(
"lol",
MillisVisibilityTimeout(1L),
Duration.ZERO,
Duration.ZERO,
OffsetDateTime.now(),
OffsetDateTime.now()
)
)
)
future.value
Expand All @@ -61,7 +68,14 @@ class QueueDirectivesTest
"queueActorAndNameFromUrl" should "return correct queue name based on QueueUrl" in {
val future = queueManagerActor ? CreateQueue(
CreateQueueData.from(
QueueData("lol", MillisVisibilityTimeout(1L), Duration.ZERO, Duration.ZERO, OffsetDateTime.now(), OffsetDateTime.now())
QueueData(
"lol",
MillisVisibilityTimeout(1L),
Duration.ZERO,
Duration.ZERO,
OffsetDateTime.now(),
OffsetDateTime.now()
)
)
)
future.value
Expand All @@ -79,7 +93,14 @@ class QueueDirectivesTest
"queueActorAndNameFromUrl" should "return error when invalid QueueUrl" in {
val future = queueManagerActor ? CreateQueue(
CreateQueueData.from(
QueueData("lol", MillisVisibilityTimeout(1L), Duration.ZERO, Duration.ZERO, OffsetDateTime.now(), OffsetDateTime.now())
QueueData(
"lol",
MillisVisibilityTimeout(1L),
Duration.ZERO,
Duration.ZERO,
OffsetDateTime.now(),
OffsetDateTime.now()
)
)
)
future.value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ class QueueDirectivesWithContextPathTest
"queueActorAndNameFromUrl" should "return correct queue name based on QueueName" in {
val future = queueManagerActor ? CreateQueue(
CreateQueueData.from(
QueueData("lol", MillisVisibilityTimeout(1L), Duration.ZERO, Duration.ZERO, OffsetDateTime.now(), OffsetDateTime.now())
QueueData(
"lol",
MillisVisibilityTimeout(1L),
Duration.ZERO,
Duration.ZERO,
OffsetDateTime.now(),
OffsetDateTime.now()
)
)
)
Await.result(future, maxDuration)
Expand All @@ -60,7 +67,14 @@ class QueueDirectivesWithContextPathTest
"queueActorAndNameFromUrl" should "return correct queue name based on QueueUrl" in {
val future = queueManagerActor ? CreateQueue(
CreateQueueData.from(
QueueData("lol", MillisVisibilityTimeout(1L), Duration.ZERO, Duration.ZERO, OffsetDateTime.now(), OffsetDateTime.now())
QueueData(
"lol",
MillisVisibilityTimeout(1L),
Duration.ZERO,
Duration.ZERO,
OffsetDateTime.now(),
OffsetDateTime.now()
)
)
)
Await.result(future, maxDuration)
Expand Down

0 comments on commit 23f5d3f

Please sign in to comment.