diff --git a/build.sbt b/build.sbt index c8c9d058..7afb6941 100644 --- a/build.sbt +++ b/build.sbt @@ -106,7 +106,7 @@ lazy val docs = project "extref.pekko-docs.base_url" -> s"https://pekko.apache.org/docs/pekko/${Dependencies.PekkoVersionInDocs}/%s", "extref.pekko-projection.base_url" -> s"https://pekko.apache.org/docs/pekko-projection/${Dependencies.PekkoProjectionVersionInDocs}/%s", "extref.java-docs.base_url" -> "https://docs.oracle.com/en/java/javase/11/%s", - "scaladoc.scala.base_url" -> s"https://www.scala-lang.org/api/current/", + "scaladoc.scala.base_url" -> "https://www.scala-lang.org/api/current/", "scaladoc.org.apache.pekko.persistence.r2dbc.base_url" -> s"https://pekko.apache.org/api/pekko-persistence-r2dbc/${Dependencies.PekkoPersistenceR2dbcVersionInDocs}", "scaladoc.org.apache.pekko.projection.r2dbc.base_url" -> @@ -114,7 +114,7 @@ lazy val docs = project "scaladoc.org.apache.pekko.projection.base_url" -> s"https://pekko.apache.org/api/pekko-projection/${Dependencies.PekkoProjectionVersionInDocs}", "scaladoc.org.apache.pekko.base_url" -> s"https://pekko.apache.org/api/pekko/${Dependencies.PekkoVersionInDocs}", - "scaladoc.com.typesafe.config.base_url" -> s"https://lightbend.github.io/config/latest/api/"), + "scaladoc.com.typesafe.config.base_url" -> "https://lightbend.github.io/config/latest/api/"), apidocRootPackage := "org.apache.pekko", Compile / paradoxMarkdownToHtml / sourceGenerators += Def.taskDyn { val targetFile = (Compile / paradox / sourceManaged).value / "license-report.md" diff --git a/core/src/test/scala/org/apache/pekko/persistence/r2dbc/query/EventsBySlicePerfSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/r2dbc/query/EventsBySlicePerfSpec.scala index 0c982f6d..85b045ba 100644 --- a/core/src/test/scala/org/apache/pekko/persistence/r2dbc/query/EventsBySlicePerfSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/r2dbc/query/EventsBySlicePerfSpec.scala @@ -45,7 +45,7 @@ class EventsBySlicePerfSpec private val query = PersistenceQuery(testKit.system).readJournalFor[R2dbcReadJournal](R2dbcReadJournal.Identifier) - s"EventsBySlices performance" should { + "EventsBySlices performance" should { "retrieve from several slices" in { // increase these properties for "real" testing diff --git a/core/src/test/scala/org/apache/pekko/persistence/r2dbc/query/EventsBySlicePubSubSpec.scala b/core/src/test/scala/org/apache/pekko/persistence/r2dbc/query/EventsBySlicePubSubSpec.scala index edb726a1..bc2bcfcf 100644 --- a/core/src/test/scala/org/apache/pekko/persistence/r2dbc/query/EventsBySlicePubSubSpec.scala +++ b/core/src/test/scala/org/apache/pekko/persistence/r2dbc/query/EventsBySlicePubSubSpec.scala @@ -96,7 +96,7 @@ class EventsBySlicePubSubSpec private val envB1 = createEnvelope(pidB, 1L, "b1") private val envB2 = createEnvelope(pidB, 2L, "b2") - s"EventsBySlices pub-sub" should { + "EventsBySlices pub-sub" should { "publish new events" in new Setup { diff --git a/projection/src/main/scala/org/apache/pekko/projection/r2dbc/internal/BySliceSourceProviderAdapter.scala b/projection/src/main/scala/org/apache/pekko/projection/r2dbc/internal/BySliceSourceProviderAdapter.scala index 2e13e3cf..1c4b1909 100644 --- a/projection/src/main/scala/org/apache/pekko/projection/r2dbc/internal/BySliceSourceProviderAdapter.scala +++ b/projection/src/main/scala/org/apache/pekko/projection/r2dbc/internal/BySliceSourceProviderAdapter.scala @@ -75,7 +75,7 @@ import pekko.projection.BySlicesSourceProvider Future.failed( new IllegalArgumentException( s"Expected SourceProvider [${delegate.getClass.getName}] to implement " + - s"EventTimestampQuery when TimestampOffset is used.")) + "EventTimestampQuery when TimestampOffset is used.")) } override def loadEnvelope[Event](persistenceId: String, sequenceNr: Long): Future[EventEnvelope[Event]] = @@ -86,6 +86,6 @@ import pekko.projection.BySlicesSourceProvider Future.failed( new IllegalArgumentException( s"Expected SourceProvider [${delegate.getClass.getName}] to implement " + - s"EventTimestampQuery when LoadEventQuery is used.")) + "EventTimestampQuery when LoadEventQuery is used.")) } } diff --git a/projection/src/main/scala/org/apache/pekko/projection/r2dbc/internal/R2dbcOffsetStore.scala b/projection/src/main/scala/org/apache/pekko/projection/r2dbc/internal/R2dbcOffsetStore.scala index 9b0583c0..3a0a5526 100644 --- a/projection/src/main/scala/org/apache/pekko/projection/r2dbc/internal/R2dbcOffsetStore.scala +++ b/projection/src/main/scala/org/apache/pekko/projection/r2dbc/internal/R2dbcOffsetStore.scala @@ -263,7 +263,7 @@ private[projection] class R2dbcOffsetStore( case Some(provider) => provider case None => throw new IllegalArgumentException( - s"Expected BySlicesSourceProvider to be defined when TimestampOffset is used.") + "Expected BySlicesSourceProvider to be defined when TimestampOffset is used.") } private def timestampOf(persistenceId: String, sequenceNr: Long): Future[Option[Instant]] = { @@ -276,7 +276,7 @@ private[projection] class R2dbcOffsetStore( timestampQuery.timestampOf(persistenceId, sequenceNr).asScala.map(_.toScala) case _ => throw new IllegalArgumentException( - s"Expected BySlicesSourceProvider to implement EventTimestampQuery when TimestampOffset is used.") + "Expected BySlicesSourceProvider to implement EventTimestampQuery when TimestampOffset is used.") } } @@ -494,7 +494,7 @@ private[projection] class R2dbcOffsetStore( if (slice < minSlice || slice > maxSlice) throw new IllegalArgumentException( s"This offset store [$projectionId] manages slices " + - s"[$minSlice - $maxSlice] but received slice [$slice] for persistenceId [${record.pid}]") + "[$minSlice - $maxSlice] but received slice [$slice] for persistenceId [${record.pid}]") stmt .bind(0, projectionId.name) diff --git a/projection/src/test/scala/org/apache/pekko/projection/r2dbc/R2dbcOffsetStoreSpec.scala b/projection/src/test/scala/org/apache/pekko/projection/r2dbc/R2dbcOffsetStoreSpec.scala index 4bf106da..b9af9940 100644 --- a/projection/src/test/scala/org/apache/pekko/projection/r2dbc/R2dbcOffsetStoreSpec.scala +++ b/projection/src/test/scala/org/apache/pekko/projection/r2dbc/R2dbcOffsetStoreSpec.scala @@ -70,7 +70,7 @@ class R2dbcOffsetStoreSpec "The R2dbcOffsetStore" must { - s"save and read offsets" in { + "save and read offsets" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) @@ -83,7 +83,7 @@ class R2dbcOffsetStoreSpec offset2.futureValue shouldBe Some(2L) // yep, saveOffset overwrites previous } - s"save and retrieve offsets of type Long" in { + "save and retrieve offsets of type Long" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) offsetStore.saveOffset(1L).futureValue @@ -91,7 +91,7 @@ class R2dbcOffsetStoreSpec offset.futureValue shouldBe Some(1L) } - s"save and retrieve offsets of type java.lang.Long" in { + "save and retrieve offsets of type java.lang.Long" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) offsetStore.saveOffset(java.lang.Long.valueOf(1L)).futureValue @@ -99,7 +99,7 @@ class R2dbcOffsetStoreSpec offset.futureValue shouldBe Some(1L) } - s"save and retrieve offsets of type Int" in { + "save and retrieve offsets of type Int" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) offsetStore.saveOffset(1).futureValue @@ -107,7 +107,7 @@ class R2dbcOffsetStoreSpec offset.futureValue shouldBe Some(1) } - s"save and retrieve offsets of type java.lang.Integer" in { + "save and retrieve offsets of type java.lang.Integer" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) offsetStore.saveOffset(java.lang.Integer.valueOf(1)).futureValue @@ -115,7 +115,7 @@ class R2dbcOffsetStoreSpec offset.futureValue shouldBe Some(1) } - s"save and retrieve offsets of type String" in { + "save and retrieve offsets of type String" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) val randOffset = UUID.randomUUID().toString @@ -124,7 +124,7 @@ class R2dbcOffsetStoreSpec offset.futureValue shouldBe Some(randOffset) } - s"save and retrieve offsets of type pekko.persistence.query.Sequence" in { + "save and retrieve offsets of type pekko.persistence.query.Sequence" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) val seqOffset = Sequence(1L) @@ -133,7 +133,7 @@ class R2dbcOffsetStoreSpec offset.futureValue shouldBe Some(seqOffset) } - s"save and retrieve offsets of type pekko.persistence.query.TimeBasedUUID" in { + "save and retrieve offsets of type pekko.persistence.query.TimeBasedUUID" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) @@ -144,7 +144,7 @@ class R2dbcOffsetStoreSpec offset.futureValue shouldBe Some(timeUuidOffset) } - s"save and retrieve offsets of unknown custom serializable type" in { + "save and retrieve offsets of unknown custom serializable type" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) @@ -154,7 +154,7 @@ class R2dbcOffsetStoreSpec offset.futureValue shouldBe Some(customOffset) } - s"save and retrieve MergeableOffset" in { + "save and retrieve MergeableOffset" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) val origOffset = MergeableOffset(Map("abc" -> 1L, "def" -> 1L, "ghi" -> 1L)) @@ -163,7 +163,7 @@ class R2dbcOffsetStoreSpec offset.futureValue shouldBe Some(origOffset) } - s"add new offsets to MergeableOffset" in { + "add new offsets to MergeableOffset" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) @@ -181,7 +181,7 @@ class R2dbcOffsetStoreSpec offset2.futureValue shouldBe Some(updatedOffset) } - s"update timestamp" in { + "update timestamp" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) @@ -198,7 +198,7 @@ class R2dbcOffsetStoreSpec instant3 shouldBe instant2 } - s"set offset" in { + "set offset" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) @@ -209,7 +209,7 @@ class R2dbcOffsetStoreSpec offsetStore.readOffset[Long]().futureValue shouldBe Some(2L) } - s"clear offset" in { + "clear offset" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) @@ -220,7 +220,7 @@ class R2dbcOffsetStoreSpec offsetStore.readOffset[Long]().futureValue shouldBe None } - s"read and save paused" in { + "read and save paused" in { val projectionId = genRandomProjectionId() val offsetStore = createOffsetStore(projectionId) diff --git a/projection/src/test/scala/org/apache/pekko/projection/r2dbc/R2dbcTimestampOffsetProjectionSpec.scala b/projection/src/test/scala/org/apache/pekko/projection/r2dbc/R2dbcTimestampOffsetProjectionSpec.scala index 163b5ee7..36852425 100644 --- a/projection/src/test/scala/org/apache/pekko/projection/r2dbc/R2dbcTimestampOffsetProjectionSpec.scala +++ b/projection/src/test/scala/org/apache/pekko/projection/r2dbc/R2dbcTimestampOffsetProjectionSpec.scala @@ -291,33 +291,33 @@ class R2dbcTimestampOffsetProjectionSpec val startTime = Instant.now() Vector( - createEnvelope(pid1, 1, startTime, s"e1-1"), - createEnvelope(pid1, 2, startTime.plusMillis(1), s"e1-2"), - createEnvelope(pid2, 1, startTime.plusMillis(2), s"e2-1"), - createEnvelope(pid1, 3, startTime.plusMillis(4), s"e1-3"), + createEnvelope(pid1, 1, startTime, "e1-1"), + createEnvelope(pid1, 2, startTime.plusMillis(1), "e1-2"), + createEnvelope(pid2, 1, startTime.plusMillis(2), "e2-1"), + createEnvelope(pid1, 3, startTime.plusMillis(4), "e1-3"), // pid1-3 is emitted before pid2-2 even though pid2-2 timestamp is earlier, // from backtracking query previous events are emitted again, including the missing pid2-2 - createEnvelope(pid1, 1, startTime, s"e1-1"), - createEnvelope(pid1, 2, startTime.plusMillis(1), s"e1-2"), - createEnvelope(pid2, 1, startTime.plusMillis(2), s"e2-1"), + createEnvelope(pid1, 1, startTime, "e1-1"), + createEnvelope(pid1, 2, startTime.plusMillis(1), "e1-2"), + createEnvelope(pid2, 1, startTime.plusMillis(2), "e2-1"), // now it pid2-2 is included - createEnvelope(pid2, 2, startTime.plusMillis(3), s"e2-2"), - createEnvelope(pid1, 3, startTime.plusMillis(4), s"e1-3"), + createEnvelope(pid2, 2, startTime.plusMillis(3), "e2-2"), + createEnvelope(pid1, 3, startTime.plusMillis(4), "e1-3"), // and then some normal again - createEnvelope(pid1, 4, startTime.plusMillis(5), s"e1-4"), - createEnvelope(pid2, 3, startTime.plusMillis(6), s"e2-3")) + createEnvelope(pid1, 4, startTime.plusMillis(5), "e1-4"), + createEnvelope(pid2, 3, startTime.plusMillis(6), "e2-3")) } def createEnvelopesUnknownSequenceNumbers(startTime: Instant, pid1: Pid, pid2: Pid): Vector[EventEnvelope[String]] = { Vector( - createEnvelope(pid1, 1, startTime, s"e1-1"), - createEnvelope(pid1, 2, startTime.plusMillis(1), s"e1-2"), - createEnvelope(pid2, 1, startTime.plusMillis(2), s"e2-1"), + createEnvelope(pid1, 1, startTime, "e1-1"), + createEnvelope(pid1, 2, startTime.plusMillis(1), "e1-2"), + createEnvelope(pid2, 1, startTime.plusMillis(2), "e2-1"), // pid2 seqNr 2 missing, will reject 3 - createEnvelope(pid2, 3, startTime.plusMillis(4), s"e2-3"), - createEnvelope(pid1, 3, startTime.plusMillis(5), s"e1-3"), + createEnvelope(pid2, 3, startTime.plusMillis(4), "e2-3"), + createEnvelope(pid1, 3, startTime.plusMillis(5), "e1-3"), // pid1 seqNr 4 missing, will reject 5 - createEnvelope(pid1, 5, startTime.plusMillis(7), s"e1-5")) + createEnvelope(pid1, 5, startTime.plusMillis(7), "e1-5")) } def createEnvelopesBacktrackingUnknownSequenceNumbers( @@ -326,14 +326,14 @@ class R2dbcTimestampOffsetProjectionSpec pid2: Pid): Vector[EventEnvelope[String]] = { Vector( // may also contain some duplicates - createEnvelope(pid1, 2, startTime.plusMillis(1), s"e1-2"), - createEnvelope(pid2, 2, startTime.plusMillis(3), s"e2-2"), - createEnvelope(pid2, 3, startTime.plusMillis(4), s"e2-3"), - createEnvelope(pid1, 3, startTime.plusMillis(5), s"e1-3"), - createEnvelope(pid1, 4, startTime.plusMillis(6), s"e1-4"), - createEnvelope(pid1, 5, startTime.plusMillis(7), s"e1-5"), - createEnvelope(pid2, 4, startTime.plusMillis(8), s"e2-4"), - createEnvelope(pid1, 6, startTime.plusMillis(9), s"e1-6")) + createEnvelope(pid1, 2, startTime.plusMillis(1), "e1-2"), + createEnvelope(pid2, 2, startTime.plusMillis(3), "e2-2"), + createEnvelope(pid2, 3, startTime.plusMillis(4), "e2-3"), + createEnvelope(pid1, 3, startTime.plusMillis(5), "e1-3"), + createEnvelope(pid1, 4, startTime.plusMillis(6), "e1-4"), + createEnvelope(pid1, 5, startTime.plusMillis(7), "e1-5"), + createEnvelope(pid2, 4, startTime.plusMillis(8), "e2-4"), + createEnvelope(pid1, 6, startTime.plusMillis(9), "e1-6")) } def groupedHandler(probe: ActorRef[String]): R2dbcHandler[immutable.Seq[EventEnvelope[String]]] = {