-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose Klarna property on Source object (#2396)
Added unit test
- Loading branch information
1 parent
423a7c9
commit 50fb89c
Showing
5 changed files
with
180 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
stripe/src/test/java/com/stripe/android/model/parsers/SourceJsonParserTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.stripe.android.model.parsers | ||
|
||
import com.google.common.truth.Truth.assertThat | ||
import com.stripe.android.model.Source | ||
import com.stripe.android.model.SourceFixtures | ||
import org.junit.Test | ||
|
||
class SourceJsonParserTest { | ||
|
||
@Test | ||
fun parse_shouldReturnExpectedObject() { | ||
assertThat(SourceFixtures.KLARNA.klarna) | ||
.isEqualTo( | ||
Source.Klarna( | ||
firstName = "Arthur", | ||
lastName = "Dent", | ||
purchaseCountry = "UK", | ||
clientToken = "CLIENT_TOKEN", | ||
payLaterAssetUrlsDescriptive = "https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg", | ||
payLaterAssetUrlsStandard = "https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg", | ||
payLaterName = "Pay later in 14 days", | ||
payLaterRedirectUrl = "https://payment-eu.playground.klarna.com/8b45xe2", | ||
payNowAssetUrlsDescriptive = null, | ||
payNowAssetUrlsStandard = null, | ||
payNowName = null, | ||
payNowRedirectUrl = null, | ||
payOverTimeAssetUrlsDescriptive = "https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg", | ||
payOverTimeAssetUrlsStandard = "https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg", | ||
payOverTimeName = "3 interest-free instalments", | ||
payOverTimeRedirectUrl = "https://payment-eu.playground.klarna.com/8DA6imn", | ||
paymentMethodCategories = setOf("pay_later", "pay_over_time"), | ||
customPaymentMethods = emptySet() | ||
) | ||
) | ||
} | ||
} |