[PM-10905] Update JSON model to match API (#3913)

This commit is contained in:
Dave Severns 2024-09-13 13:22:21 -04:00 committed by GitHub
parent d1f21d3585
commit 190ba792a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 0 additions and 17 deletions

View file

@ -1,25 +1,16 @@
package com.x8bit.bitwarden.data.auth.datasource.network.model
import kotlinx.serialization.Contextual
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.time.ZonedDateTime
/**
* Response object returned when requesting organization domain SSO details.
*
* @property isSsoAvailable Whether or not SSO is available for this domain.
* @property domainName The organization's domain name.
* @property organizationIdentifier The organization's identifier.
* @property isSsoRequired Whether or not SSO is required.
* @property verifiedDate The date these details were verified.
*/
@Serializable
data class OrganizationDomainSsoDetailsResponseJson(
@SerialName("ssoAvailable") val isSsoAvailable: Boolean,
@SerialName("domainName") val domainName: String,
@SerialName("organizationIdentifier") val organizationIdentifier: String,
@SerialName("ssoRequired") val isSsoRequired: Boolean,
@Contextual
@SerialName("verifiedDate") val verifiedDate: ZonedDateTime?,
)

View file

@ -13,7 +13,6 @@ import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
import retrofit2.create
import java.time.ZonedDateTime
class OrganizationServiceTest : BaseServiceTest() {
private val authenticatedOrganizationApi: AuthenticatedOrganizationApi = retrofit.create()
@ -131,9 +130,6 @@ private const val ORGANIZATION_DOMAIN_SSO_DETAILS_JSON = """
private val ORGANIZATION_DOMAIN_SSO_BODY = OrganizationDomainSsoDetailsResponseJson(
isSsoAvailable = true,
organizationIdentifier = "Test Org",
domainName = "bitwarden.com",
isSsoRequired = false,
verifiedDate = ZonedDateTime.parse("2024-09-13T00:00Z"),
)
private const val ORGANIZATION_KEYS_JSON = """

View file

@ -142,7 +142,6 @@ import org.junit.jupiter.api.Assertions.assertNull
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import java.time.ZonedDateTime
@Suppress("LargeClass")
class AuthRepositoryTest {
@ -5149,9 +5148,6 @@ class AuthRepositoryTest {
} returns OrganizationDomainSsoDetailsResponseJson(
isSsoAvailable = true,
organizationIdentifier = "Test Org",
domainName = "bitwarden.com",
isSsoRequired = false,
verifiedDate = ZonedDateTime.parse("2024-09-13T00:00Z"),
)
.asSuccess()
val result = repository.getOrganizationDomainSsoDetails(email)