v3.0.0
Version 3.0.0 is a reactive and multiplatform version of fmodel
libraries optimized for Event sourcing, CQRS, and Domain Modeling.
What's Changed
- A multiplatform support (jvm, js, native) included
- Switched from Spek to Kotest test framework
- Switched from Maven to Gradle
Tests example
class DeciderTest : FunSpec({
val evenDecider = evenNumberDecider()
val oddDecider = oddNumberDecider()
test("Event-sourced Decider - add even number") {
with(evenDecider) {
givenEvents(emptyList()) {
whenCommand(AddEvenNumber(Description("2"), NumberValue(2)))
} thenEvents listOf(EvenNumberAdded(Description("2"), NumberValue(2)))
}
}
test("Event-sourced Decider - given previous state, add even number") {
with(evenDecider) {
givenEvents(listOf(EvenNumberAdded(Description("2"), NumberValue(2)))) {
whenCommand(AddEvenNumber(Description("4"), NumberValue(4)))
} thenEvents listOf(EvenNumberAdded(Description("4"), NumberValue(4)))
}
}
})