diff --git a/monkeys/src/commonMain/kotlin/com/wire/kalium/monkeys/importer/TestData.kt b/monkeys/src/commonMain/kotlin/com/wire/kalium/monkeys/importer/TestData.kt index 1774d331d7f..dd79b7d8747 100644 --- a/monkeys/src/commonMain/kotlin/com/wire/kalium/monkeys/importer/TestData.kt +++ b/monkeys/src/commonMain/kotlin/com/wire/kalium/monkeys/importer/TestData.kt @@ -17,43 +17,93 @@ */ package com.wire.kalium.monkeys.importer +import com.wire.kalium.logic.data.conversation.ConversationOptions import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable data class TestDataJsonModel( - @SerialName("backends") - val backends: List + @SerialName("testCases") val testCases: List, + @SerialName("backends") val backends: List ) +@Serializable +data class TestCase( + @SerialName("name") val name: String, + @SerialName("conversationDistribution") val conversationDistribution: Map, + @SerialName("setup") val setup: List = listOf(), + @SerialName("actions") val actions: List +) + +@Serializable +sealed class UserCount { + @Serializable + @SerialName("PERCENTAGE") + data class Percentage(@SerialName("value") val value: UInt) : UserCount() + + @Serializable + @SerialName("FIXED_COUNT") + data class FixedCount(@SerialName("value") val value: UInt) : UserCount() +} + +@Serializable +data class GroupConfig( + @SerialName("userCount") val userCount: UserCount, + @SerialName("protocol") val protocol: ConversationOptions.Protocol = ConversationOptions.Protocol.MLS, + @SerialName("groupCount") val groupCount: UInt = 1u +) + +@Serializable +data class Action( + @SerialName("description") val description: String, + @SerialName("type") val type: ActionType, + @SerialName("count") val count: UserCount, + @SerialName("repeatDuration") val repeatDuration: UInt +) + +@Serializable +sealed class ActionType { + @Serializable + data class Login(@SerialName("duration") val duration: UInt = 0u) : ActionType() + + @Serializable + data class Reconnect(@SerialName("durationOffline") val durationOffline: UInt) : ActionType() + + @Serializable + data class SendMessage( + @SerialName("count") val count: UInt, + @SerialName("targets") val targets: List = listOf() + ) : ActionType() + + @Serializable + data class CreateConversation(@SerialName("userCount") val userCount: UserCount) : ActionType() + + @Serializable + data class LeaveConversation(@SerialName("userCount") val userCount: UserCount) : ActionType() + + @Serializable + data class DestroyConversation(@SerialName("count") val count: UInt) : ActionType() + + @Serializable + data class SendRequest(@SerialName("userCount") val userCount: UInt) : ActionType() +} + @Serializable data class BackendDataJsonModel( - @SerialName("api") - val api: String, - @SerialName("accounts") - val accounts: String, - @SerialName("webSocket") - val webSocket: String, - @SerialName("blackList") - val blackList: String, - @SerialName("teams") - val teams: String, - @SerialName("website") - val website: String, - @SerialName("title") - val title: String, - @SerialName("passwordForUsers") - val passwordForUsers: String, - @SerialName("domain") - val domain: String, - @SerialName("users") - val users: List + @SerialName("api") val api: String, + @SerialName("accounts") val accounts: String, + @SerialName("webSocket") val webSocket: String, + @SerialName("blackList") val blackList: String, + @SerialName("teams") val teams: String, + @SerialName("website") val website: String, + @SerialName("title") val title: String, + @SerialName("passwordForUsers") val passwordForUsers: String, + @SerialName("domain") val domain: String, + @SerialName("users") val users: List ) @Serializable data class UserAccountDataJsonModel( - @SerialName("email") - val email: String, - @SerialName("id") - val unqualifiedId: String + @SerialName("email") val email: String, + @SerialName("id") val unqualifiedId: String )