Skip to content

Commit

Permalink
Added integration test for organization member retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
a2xchip committed Jan 22, 2025
1 parent a32aae2 commit 52c386e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/integrationTest/kotlin/OrganizationsIntegrationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.jeliuc.turso.sdk.model.InvoicesResponse
import com.jeliuc.turso.sdk.model.ListAuditLogsResponse
import com.jeliuc.turso.sdk.model.ListInvitesResponse
import com.jeliuc.turso.sdk.model.ListMembersResponse
import com.jeliuc.turso.sdk.model.MemberResponse
import com.jeliuc.turso.sdk.model.Organization
import com.jeliuc.turso.sdk.model.OrganizationDatabaseUsageResponse
import com.jeliuc.turso.sdk.model.OrganizationPlansResponse
Expand Down Expand Up @@ -113,12 +114,21 @@ class OrganizationsIntegrationTest {

@Test
fun `can list members`() {
val client = getClient()
val members =
runBlocking {
getClient().organizations.members.list(organization)
client.organizations.members.list(organization)
}

assertIs<ListMembersResponse>(members)

val username = members.members.first().username
val member =
runBlocking {
client.organizations.members.retrieve(organization, username)
}

assertIs<MemberResponse>(member)
}

private fun getClient(): TursoClient = TursoClient.using(CIO.create(), token)
Expand Down

0 comments on commit 52c386e

Please sign in to comment.