refactoring: Masive refactor to build the V2
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package eventDemo.contexts.auth.domain
|
||||
|
||||
import eventDemo.contexts.auth.domain.events.NewUserCreatedEvent
|
||||
import io.kotest.core.spec.style.FunSpec
|
||||
import io.kotest.matchers.shouldBe
|
||||
import org.junit.jupiter.api.assertNotNull
|
||||
|
||||
class UserTest :
|
||||
FunSpec({
|
||||
|
||||
test("Create User") {
|
||||
User.createNewUser("Bob", "changeit").run {
|
||||
username shouldBe "Bob"
|
||||
password shouldBe "changeit"
|
||||
}
|
||||
}
|
||||
|
||||
test("Create User With event") {
|
||||
User
|
||||
.loadFromHistory(
|
||||
setOf(
|
||||
NewUserCreatedEvent(
|
||||
"Bob",
|
||||
"changeit",
|
||||
version = 1,
|
||||
),
|
||||
),
|
||||
).run {
|
||||
assertNotNull(this)
|
||||
username shouldBe "Bob"
|
||||
password shouldBe "changeit"
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user