You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "Arsnael (via GitHub)" <gi...@apache.org> on 2023/04/20 08:55:34 UTC

[GitHub] [james-project] Arsnael commented on a diff in pull request #1532: JAMES-3777 Snapshots for eventSourcing JMAP filters

Arsnael commented on code in PR #1532:
URL: https://github.com/apache/james-project/pull/1532#discussion_r1172286945


##########
event-sourcing/event-store-cassandra/src/test/scala/org/apache/james/eventsourcing/eventstore/cassandra/CassandraEventStoreTest.scala:
##########
@@ -18,8 +18,41 @@
  ****************************************************************/
 package org.apache.james.eventsourcing.eventstore.cassandra
 
-import org.apache.james.eventsourcing.eventstore.EventStoreContract
+import org.apache.james.eventsourcing.eventstore.cassandra.dto.SnapshotEvent
+import org.apache.james.eventsourcing.{EventId, TestEvent}
+import org.apache.james.eventsourcing.eventstore.{EventStore, EventStoreContract, History}
+import org.assertj.core.api.Assertions.assertThat
+import org.junit.jupiter.api.Test
 import org.junit.jupiter.api.extension.ExtendWith
+import reactor.core.scala.publisher.SMono
 
 @ExtendWith(Array(classOf[CassandraEventStoreExtensionForTestEvents]))
-class CassandraEventStoreTest extends EventStoreContract
\ No newline at end of file
+class CassandraEventStoreTest extends EventStoreContract {
+  @Test
+  def test(testee: EventStore) : Unit = {

Review Comment:
   a more meaningful test name maybe?



##########
event-sourcing/event-store-cassandra/src/test/scala/org/apache/james/eventsourcing/eventstore/cassandra/CassandraEventStoreTest.scala:
##########
@@ -18,8 +18,41 @@
  ****************************************************************/
 package org.apache.james.eventsourcing.eventstore.cassandra
 
-import org.apache.james.eventsourcing.eventstore.EventStoreContract
+import org.apache.james.eventsourcing.eventstore.cassandra.dto.SnapshotEvent
+import org.apache.james.eventsourcing.{EventId, TestEvent}
+import org.apache.james.eventsourcing.eventstore.{EventStore, EventStoreContract, History}
+import org.assertj.core.api.Assertions.assertThat
+import org.junit.jupiter.api.Test
 import org.junit.jupiter.api.extension.ExtendWith
+import reactor.core.scala.publisher.SMono
 
 @ExtendWith(Array(classOf[CassandraEventStoreExtensionForTestEvents]))
-class CassandraEventStoreTest extends EventStoreContract
\ No newline at end of file
+class CassandraEventStoreTest extends EventStoreContract {
+  @Test
+  def test(testee: EventStore) : Unit = {
+    val event1 = TestEvent(EventId.first, EventStoreContract.AGGREGATE_1, "first")
+    val event2 = SnapshotEvent(EventId.first.next, EventStoreContract.AGGREGATE_1, "second")
+    val event3 = TestEvent(EventId.first.next.next, EventStoreContract.AGGREGATE_1, "third")
+
+    SMono(testee.append(event1)).block()
+    SMono(testee.append(event2)).block()
+    SMono(testee.append(event3)).block()
+
+    assertThat(SMono(testee.getEventsOfAggregate(EventStoreContract.AGGREGATE_1)).block())
+      .isEqualTo(History.of(event2, event3))
+  }
+
+  @Test
+  def test1(testee: EventStore) : Unit = {

Review Comment:
   idem



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org