Skip to content

Commit

Permalink
code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodolfo committed Jan 10, 2025
1 parent 329a5b2 commit 4ac2431
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/test/kotlin/crablet/query/AccountsViewProjectionTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ class AccountsViewProjectionTest : AbstractCrabletTest() {
class AccountsViewProjector : EventViewProjector {
override fun project(sqlConnection: SqlConnection, eventAsJson: JsonObject): Future<Void> {
val eventPayload = eventAsJson.getJsonObject("event_payload")

return when (eventPayload.getString("type")) {

"AccountOpened", "AmountDeposited" -> {
val id = eventPayload.getInteger("id")
val balance = eventPayload.getInteger("balance", 0)
Expand All @@ -220,12 +222,11 @@ class AccountsViewProjectionTest : AbstractCrabletTest() {
sqlConnection.preparedQuery(upsertQuery)
.executeBatch(tuples)
.mapEmpty()

}

else -> Future.succeededFuture()
}
}

}

val subscriptionConfig = SubscriptionConfig(
Expand Down

0 comments on commit 4ac2431

Please sign in to comment.