From 23f5d3fa4775a9cbe9eb30f3e316a10628d6516f Mon Sep 17 00:00:00 2001 From: scala-steward Date: Wed, 25 Oct 2023 00:21:05 +0000 Subject: [PATCH] Reformat with scalafmt 3.7.15 Executed command: scalafmt --non-interactive --- .../elasticmq/util/OffsetDateTimeUtil.scala | 3 ++- .../actor/QueueActorMsgOpsTest.scala | 8 ++++-- .../performance/LocalPerformanceTest.scala | 7 ++++- .../elasticmq/persistence/sql/DBMessage.scala | 3 ++- .../rest/sqs/QueueAttributesOps.scala | 5 +++- .../sqs/directives/QueueDirectivesTest.scala | 27 ++++++++++++++++--- .../QueueDirectivesWithContextPathTest.scala | 18 +++++++++++-- 7 files changed, 60 insertions(+), 11 deletions(-) diff --git a/core/src/main/scala/org/elasticmq/util/OffsetDateTimeUtil.scala b/core/src/main/scala/org/elasticmq/util/OffsetDateTimeUtil.scala index bc21db95..bed9f8c5 100644 --- a/core/src/main/scala/org/elasticmq/util/OffsetDateTimeUtil.scala +++ b/core/src/main/scala/org/elasticmq/util/OffsetDateTimeUtil.scala @@ -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) } diff --git a/core/src/test/scala/org/elasticmq/actor/QueueActorMsgOpsTest.scala b/core/src/test/scala/org/elasticmq/actor/QueueActorMsgOpsTest.scala index a8c94cc8..7ec2d375 100644 --- a/core/src/test/scala/org/elasticmq/actor/QueueActorMsgOpsTest.scala +++ b/core/src/test/scala/org/elasticmq/actor/QueueActorMsgOpsTest.scala @@ -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) + ) } } diff --git a/performance-tests/src/test/scala/org/elasticmq/performance/LocalPerformanceTest.scala b/performance-tests/src/test/scala/org/elasticmq/performance/LocalPerformanceTest.scala index c4296c20..623d4cf6 100644 --- a/performance-tests/src/test/scala/org/elasticmq/performance/LocalPerformanceTest.scala +++ b/performance-tests/src/test/scala/org/elasticmq/performance/LocalPerformanceTest.scala @@ -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 diff --git a/persistence/persistence-sql/src/main/scala/org/elasticmq/persistence/sql/DBMessage.scala b/persistence/persistence-sql/src/main/scala/org/elasticmq/persistence/sql/DBMessage.scala index 55ec5847..cd61bac7 100644 --- a/persistence/persistence-sql/src/main/scala/org/elasticmq/persistence/sql/DBMessage.scala +++ b/persistence/persistence-sql/src/main/scala/org/elasticmq/persistence/sql/DBMessage.scala @@ -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, diff --git a/rest/rest-sqs/src/main/scala/org/elasticmq/rest/sqs/QueueAttributesOps.scala b/rest/rest-sqs/src/main/scala/org/elasticmq/rest/sqs/QueueAttributesOps.scala index 3d7346d5..c7134461 100644 --- a/rest/rest-sqs/src/main/scala/org/elasticmq/rest/sqs/QueueAttributesOps.scala +++ b/rest/rest-sqs/src/main/scala/org/elasticmq/rest/sqs/QueueAttributesOps.scala @@ -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) diff --git a/rest/rest-sqs/src/test/scala/org/elasticmq/rest/sqs/directives/QueueDirectivesTest.scala b/rest/rest-sqs/src/test/scala/org/elasticmq/rest/sqs/directives/QueueDirectivesTest.scala index 4c2b3343..00f4803b 100644 --- a/rest/rest-sqs/src/test/scala/org/elasticmq/rest/sqs/directives/QueueDirectivesTest.scala +++ b/rest/rest-sqs/src/test/scala/org/elasticmq/rest/sqs/directives/QueueDirectivesTest.scala @@ -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 @@ -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 @@ -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 diff --git a/rest/rest-sqs/src/test/scala/org/elasticmq/rest/sqs/directives/QueueDirectivesWithContextPathTest.scala b/rest/rest-sqs/src/test/scala/org/elasticmq/rest/sqs/directives/QueueDirectivesWithContextPathTest.scala index 1e7863f7..d624964d 100644 --- a/rest/rest-sqs/src/test/scala/org/elasticmq/rest/sqs/directives/QueueDirectivesWithContextPathTest.scala +++ b/rest/rest-sqs/src/test/scala/org/elasticmq/rest/sqs/directives/QueueDirectivesWithContextPathTest.scala @@ -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) @@ -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)