diff --git a/src/test/kotlin/crablet/query/AccountsViewProjectionTest.kt b/src/test/kotlin/crablet/query/AccountsViewProjectionTest.kt index cd34a83..6dd1b8c 100644 --- a/src/test/kotlin/crablet/query/AccountsViewProjectionTest.kt +++ b/src/test/kotlin/crablet/query/AccountsViewProjectionTest.kt @@ -196,7 +196,9 @@ class AccountsViewProjectionTest : AbstractCrabletTest() { class AccountsViewProjector : EventViewProjector { override fun project(sqlConnection: SqlConnection, eventAsJson: JsonObject): Future { val eventPayload = eventAsJson.getJsonObject("event_payload") + return when (eventPayload.getString("type")) { + "AccountOpened", "AmountDeposited" -> { val id = eventPayload.getInteger("id") val balance = eventPayload.getInteger("balance", 0) @@ -220,12 +222,11 @@ class AccountsViewProjectionTest : AbstractCrabletTest() { sqlConnection.preparedQuery(upsertQuery) .executeBatch(tuples) .mapEmpty() - } + else -> Future.succeededFuture() } } - } val subscriptionConfig = SubscriptionConfig(