-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
251798b
commit ce4d24e
Showing
7 changed files
with
123 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
target | ||
.bsp/ | ||
.DS_Store | ||
.bloop | ||
.bloop | ||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
thoth-tck/src/main/java/fr/maif/eventsourcing/datastore/TestProjection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package fr.maif.eventsourcing.datastore; | ||
|
||
import fr.maif.eventsourcing.EventEnvelope; | ||
import fr.maif.eventsourcing.Projection; | ||
import io.vavr.Tuple; | ||
import io.vavr.Tuple0; | ||
import io.vavr.collection.List; | ||
import io.vavr.concurrent.Future; | ||
|
||
import java.sql.Connection; | ||
|
||
public class TestProjection implements Projection<Connection, TestEvent, Tuple0, Tuple0> { | ||
private int counter = 0; | ||
|
||
@Override | ||
public Future<Tuple0> storeProjection(Connection connection, List<EventEnvelope<TestEvent, Tuple0, Tuple0>> envelopes) { | ||
return Future.of(() -> { | ||
envelopes.forEach(envelope -> { | ||
if (envelope.event instanceof TestEvent.SimpleEvent) { | ||
counter++; | ||
} | ||
}); | ||
return Tuple.empty(); | ||
}); | ||
} | ||
|
||
public int getCount() { | ||
return counter; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters