Skip to content

Commit

Permalink
ReplicaId.empty
Browse files Browse the repository at this point in the history
  • Loading branch information
patriknw committed Sep 12, 2024
1 parent 219b19b commit e1ecd02
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ import org.slf4j.LoggerFactory
object PushReplicationMigrationIntegrationSpec {

private def config(dc: ReplicaId): Config = {
val journalTable = if (dc.id == "") "event_journal" else s"event_journal_${dc.id}"
val journalTable = if (dc == ReplicaId.empty) "event_journal" else s"event_journal_${dc.id}"
val timestampOffsetTable =
if (dc.id == "") "akka_projection_timestamp_offset_store" else s"akka_projection_timestamp_offset_store_${dc.id}"
if (dc == ReplicaId.empty) "akka_projection_timestamp_offset_store"
else s"akka_projection_timestamp_offset_store_${dc.id}"
ConfigFactory.parseString(s"""
akka.actor.provider = cluster
akka.http.server.preview.enable-http2 = on
Expand Down Expand Up @@ -73,7 +74,7 @@ object PushReplicationMigrationIntegrationSpec {

private val DCA = ReplicaId("DCA")
private val DCB = ReplicaId("DCB")
private val EdgeReplicaA = ReplicaId("")
private val EdgeReplicaA = ReplicaId.empty

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ object ReplicationIntegrationSpec {

object State {
val initial =
State("Hello world", LwwTime(Long.MinValue, ReplicaId("")), "", LwwTime(Long.MinValue, ReplicaId("")))
State("Hello world", LwwTime(Long.MinValue, ReplicaId.empty), "", LwwTime(Long.MinValue, ReplicaId.empty))
}

case class State(greeting: String, greetingTimestamp: LwwTime, tag: String, tagTimestamp: LwwTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ object ReplicationJavaDSLIntegrationSpec {
final case class TagChanged(tag: String, timestamp: LwwTime) extends Event

object State {
val initial = State("Hello world", LwwTime(Long.MinValue, ReplicaId("")), "")
val initial = State("Hello world", LwwTime(Long.MinValue, ReplicaId.empty), "")
}

case class State(greeting: String, timestamp: LwwTime, tag: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ import org.slf4j.LoggerFactory
object ReplicationMigrationIntegrationSpec {

private def config(dc: ReplicaId): Config = {
val journalTable = if (dc.id == "") "event_journal" else s"event_journal_${dc.id}"
val journalTable = if (dc == ReplicaId.empty) "event_journal" else s"event_journal_${dc.id}"
val timestampOffsetTable =
if (dc.id == "") "akka_projection_timestamp_offset_store" else s"akka_projection_timestamp_offset_store_${dc.id}"
if (dc == ReplicaId.empty) "akka_projection_timestamp_offset_store"
else s"akka_projection_timestamp_offset_store_${dc.id}"
ConfigFactory.parseString(s"""
akka.actor.provider = cluster
akka.http.server.preview.enable-http2 = on
Expand Down Expand Up @@ -80,7 +81,7 @@ object ReplicationMigrationIntegrationSpec {
""")
}

private val DCA = ReplicaId("")
private val DCA = ReplicaId.empty
private val DCB = ReplicaId("DCB")
private val DCC = ReplicaId("DCC")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class EventProducerServiceSpec
else
Some(
ReplicatedEventMetadata(
originReplica = ReplicaId(""),
originReplica = ReplicaId.empty,
originSequenceNr = env.sequenceNr,
version = VersionVector(env.persistenceId, env.sequenceNr),
concurrent = false))))
Expand Down Expand Up @@ -609,14 +609,14 @@ class EventProducerServiceSpec

val out1 = probe.expectNext()
protoAnySerialization.deserialize(out1.getEvent.metadata.get) shouldBe ReplicatedEventMetadata(
originReplica = ReplicaId(""),
originReplica = ReplicaId.empty,
originSequenceNr = env1.sequenceNr,
version = VersionVector(env1.persistenceId, env1.sequenceNr),
concurrent = false)

val out2 = probe.expectNext()
protoAnySerialization.deserialize(out2.getEvent.metadata.get) shouldBe ReplicatedEventMetadata(
originReplica = ReplicaId(""),
originReplica = ReplicaId.empty,
originSequenceNr = env2.sequenceNr,
version = VersionVector(env2.persistenceId, env2.sequenceNr),
concurrent = false)
Expand Down

0 comments on commit e1ecd02

Please sign in to comment.