Skip to content

Bulk user creation (JUnit 5)

### ✅ Bulk user creation
- **Given** the following users exist
**Users**
| email | role | status |
| ----------------- | ----- | ------ |
| [email protected] | admin | active |
| [email protected] | user | active |
| [email protected] | user | locked |
- **When** the admin opens the user list
- **Then** the user list should include
**Expected**
| email | role | status |
| ----------------- | ----- | ------ |
| [email protected] | admin | active |
| [email protected] | user | active |
| [email protected] | user | locked |
import dev.executablestories.junit5.Story
import org.junit.jupiter.api.Test
class UsersTest {
@Test
fun `bulk user creation`() {
Story.init("Bulk user creation")
Story.given("the following users exist")
Story.table("Users",
arrayOf("email", "role", "status"),
arrayOf(
arrayOf("[email protected]", "admin", "active"),
arrayOf("[email protected]", "user", "active"),
arrayOf("[email protected]", "user", "locked"),
)
)
Story.`when`("the admin opens the user list")
Story.then("the user list should include")
Story.table("Expected",
arrayOf("email", "role", "status"),
arrayOf(
arrayOf("[email protected]", "admin", "active"),
arrayOf("[email protected]", "user", "active"),
arrayOf("[email protected]", "user", "locked"),
)
)
}
}