Skip to content

Commit

Permalink
Merge pull request #1659 from Adyen/ui-test-networking
Browse files Browse the repository at this point in the history
Setup UI test networking
  • Loading branch information
OscarSpruit authored Jul 15, 2024
2 parents 26a161c + ea14586 commit d5868e4
Show file tree
Hide file tree
Showing 33 changed files with 1,007 additions and 45 deletions.
1 change: 1 addition & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ ext {
"org.mockito:mockito-android:$mockito_version",
"org.mockito.kotlin:mockito-kotlin:$mockito_kotlin_version"
],
mockWebServer : "com.squareup.okhttp3:mockwebserver:$okhttp_version",
robolectric : "org.robolectric:robolectric:$robolectric_version"
]
}
10 changes: 4 additions & 6 deletions drop-in/src/main/res/layout/activity_drop_in.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2019 Adyen N.V.
~
~ This file is open source and available under the MIT license. See the LICENSE file for more info.
~
~ Created by caiof on 21/3/2019.
-->

<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.DropInActivity"
tools:context=".internal.ui.DropInActivity"
tools:ignore="MergeRootFrame">

</FrameLayout>
</FrameLayout>
4 changes: 3 additions & 1 deletion example-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ android {
versionCode version_code
versionName version_name

testInstrumentationRunner 'com.adyen.checkout.HiltTestRunner'
testInstrumentationRunner 'com.adyen.checkout.test.HiltTestRunner'
}

testOptions {
Expand Down Expand Up @@ -112,6 +112,8 @@ dependencies {
androidTestImplementation testLibraries.barista
androidTestImplementation testLibraries.espresso
androidTestImplementation testLibraries.hilt
androidTestImplementation testLibraries.kotlinCoroutines
androidTestImplementation testLibraries.mockWebServer

kspAndroidTest testLibraries.hiltCompiler
}
3 changes: 3 additions & 0 deletions example-app/src/androidTest/assets/public_key_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"publicKey": "10001|11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
}
43 changes: 43 additions & 0 deletions example-app/src/androidTest/assets/sessions_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"amount" : {
"currency" : "EUR",
"value" : 1337
},
"authenticationData" : {
"attemptAuthentication" : "always",
"threeDSRequestData" : {
"nativeThreeDS" : "preferred"
}
},
"channel" : "Android",
"countryCode" : "NL",
"expiresAt" : "2024-06-05T16:27:48+02:00",
"id" : "CSB0C8F0236F487105",
"lineItems" : [
{
"amountExcludingTax" : 100,
"amountIncludingTax" : 100,
"description" : "Coffee",
"id" : "1717594066496",
"quantity" : 2,
"taxAmount" : 0,
"taxCategory" : "Low",
"taxPercentage" : 0
}
],
"merchantAccount" : "TestMerchantCheckout",
"recurringProcessingModel" : "Subscription",
"reference" : "android-test-components_1717594066497",
"returnUrl" : "adyencheckout:\/\/com.adyen.checkout.example",
"shopperEmail" : "",
"shopperIP" : "142.12.31.22",
"shopperLocale" : "en-US",
"shopperReference" : "test-android-components",
"showInstallmentAmount" : false,
"showRemovePaymentMethodButton" : true,
"splitCardFundingSources" : false,
"storePaymentMethodMode" : "askForConsent",
"threeDSAuthenticationOnly" : false,
"mode" : "embedded",
"sessionData" : "Ab02b4c0!BQABAgBE0IYldLlPrH34SYYyEx0dSnNuCbvnT1qo3F6J+pZqAydHpR\/DCqsmqaFL6fI8SREvHZX9ofDeHxgz2MlpKxBlqWFwz1w5\/nwfQVNbPgpXyYFnQv4I3SlXU2akUq6V1tzRcDEE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uqQAGfhBpp56MGea4THQ2nT6pAp7eAt1EgoNFPYVgVOnkKQK4Skt5KnOlRQB8yFxJrnsYtpAocM0y+nLw+bbkkhL0B2bR8TPRN4VuWock7yqN9aoHLpncXn2ub5V9preoav6\/6jyCwLphAk60l1IPjnQTFUhmVefIFBL4aJ90JU8fJ8Kalyg3mDG0cH3GZOIaeMDeolCjE6KbGTGV34O5calXn+3mhzPZlcZiCAFo3CPGsT+rOu8kF66Ka9h3ti\/0B+cMVRuJ\/PnX1Krf3ku9uBKNHGQ+DwgUEL2ze\/rNg4xZX+\/HNFQv6TfqAU7CLnSuTCO2h+93EomTAHoM6AjrHSs97LARaOt4j3bEIiv4A+BhZfNx6OaRq8EWP9AqpU\/ZxehJts21chBFM+5IcV\/2gzl5v6OhLJUW7Vr3PcQF4+c0jCuSdgulMhZn\/7+9+Y2ayv8olCHWaBcO6Ce+c4kunOQjupwSI865o81WUvGPHfQ3BgAOYAGxYdP\/R2AD5rGV5tEVoIyly6VdrHohEmxzYQdcPmLFchWyXsGueyw\/D4W6p\/CeW8DyfmZnrnXiBgNfmHwo0JHAorcEK3XE13FTDXud4p7DXxBjHyDHAkiMM2thOunro4HnmT\/RwXJgtPlB5O42edLMKA6wplz5jh+dulUiQhBvwBYxjClR+fXTG7X9x+HULtgX2TcAHNG6y8YButEjVt50mCwGWtyS0oTAgrGT9jxnUc5ecsniyqDbuy2Be89CGk\/Hoxa4BQ0+HbKHWO0QWYkrvvITVS\/xkdw+dD1VRkxRtK1WbtIojWaNlvU2oi6pgszo0vVx2fBupsKNZyITNbLu50\/DxffBuYh9jS"
}
273 changes: 273 additions & 0 deletions example-app/src/androidTest/assets/sessions_setup_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
{
"amount" : {
"currency" : "EUR",
"value" : 1337
},
"countryCode" : "NL",
"expiresAt" : "2024-06-05T16:27:48+02:00",
"id" : "CSB0C8F0236F487105",
"returnUrl" : "adyencheckout:\/\/com.adyen.checkout.example",
"shopperLocale" : "en-US",
"configuration" : {
"enableStoreDetails" : true,
"showInstallmentAmount" : false,
"showRemovePaymentMethodButton" : true
},
"paymentMethods" : {
"paymentMethods" : [
{
"issuers" : [
{
"id" : "1164",
"name" : "SNS"
},
{
"id" : "1121",
"name" : "Test Issuer"
},
{
"id" : "1154",
"name" : "Test Issuer 5"
},
{
"id" : "1165",
"name" : "iDeal Test Issuer"
},
{
"id" : "1153",
"name" : "Test Issuer 4"
},
{
"id" : "1152",
"name" : "Test Issuer 3"
},
{
"id" : "1163",
"name" : "Ideal bridge test issuer"
},
{
"id" : "1151",
"name" : "Test Issuer 2"
},
{
"id" : "1162",
"name" : "Test Issuer Cancelled"
},
{
"id" : "1161",
"name" : "Test Issuer Pending"
},
{
"id" : "1160",
"name" : "Test Issuer Refused"
},
{
"id" : "1159",
"name" : "Test Issuer 10"
},
{
"id" : "1158",
"name" : "Test Issuer 9"
},
{
"id" : "1157",
"name" : "Test Issuer 8"
},
{
"id" : "1156",
"name" : "Test Issuer 7"
},
{
"id" : "1155",
"name" : "Test Issuer 6"
}
],
"name" : "iDEAL",
"type" : "ideal"
},
{
"brands" : [
"mc",
"visa",
"bijcard",
"amex",
"maestro",
"accel",
"cup",
"diners",
"discover",
"hipercard",
"jcb",
"nyce",
"pulse",
"sodexo",
"star",
"vale_refeicao",
"vale_refeicao_prepaid"
],
"configuration" : {
"mcDpaId" : "6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1_dpa2",
"visaSrcInitiatorId" : "B9SECVKIQX2SOBQ6J9X721dVBBKHhJJl1nxxVbemHGn5oB6S8",
"mcSrcClientId" : "6d41d4d6-45b1-42c3-a5d0-a28c0e69d4b1",
"visaSrciDpaId" : "8e6e347c-254e-863f-0e6a-196bf2d9df02"
},
"name" : "Credit Card",
"type" : "scheme"
},
{
"configuration" : {
"merchantId" : "M6TNAESZ5FGNN",
"intent" : "authorize"
},
"name" : "PayPal",
"type" : "paypal"
},
{
"name" : "Riverty Invoice",
"type" : "afterpay_default"
},
{
"name" : "SEPA Direct Debit",
"type" : "sepadirectdebit"
},
{
"name" : "Paysafecard",
"type" : "paysafecard"
},
{
"name" : "AliPay",
"type" : "alipay_wap"
},
{
"name" : "Android Pay",
"type" : "androidpay"
},
{
"name" : "c_cash",
"type" : "c_cash"
},
{
"name" : "Alfamart",
"type" : "doku_alfamart"
},
{
"brand" : "genericgiftcard",
"name" : "Generic GiftCard",
"type" : "giftcard"
},
{
"brand" : "givex",
"name" : "Givex",
"type" : "giftcard"
},
{
"configuration" : {
"merchantId" : "50",
"gatewayMerchantId" : "TestMerchantCheckout"
},
"name" : "Google Pay",
"type" : "googlepay"
},
{
"name" : "Pay over time with Klarna.",
"type" : "klarna_account"
},
{
"name" : "Pay by Invoice for Businesses",
"type" : "klarna_b2b"
},
{
"name" : "Up Titre-Restaurant",
"type" : "mealVoucher_FR_groupeup"
},
{
"name" : "Bimpli (ex Apetiz) Titre-Restaurant",
"type" : "mealVoucher_FR_natixis"
},
{
"name" : "Sodexo Titre-Restaurant",
"type" : "mealVoucher_FR_sodexo"
},
{
"brand" : "plastix",
"name" : "Plastix",
"type" : "giftcard"
},
{
"name" : "UnionPay",
"type" : "unionpay"
},
{
"name" : "UPI Collect",
"type" : "upi_collect"
},
{
"name" : "WeChat Pay",
"type" : "wechatpayMiniProgram"
},
{
"name" : "WeChat Pay",
"type" : "wechatpayQR"
},
{
"name" : "WeChat Pay",
"type" : "wechatpaySDK"
},
{
"name" : "WeChat Pay",
"type" : "wechatpayWeb"
},
{
"name" : "Pay later with Klarna.",
"type" : "klarna"
},
{
"configuration" : {
"merchantId" : "A3SKIS53IXYBBU",
"storeId" : "amzn1.application-oa2-client.4cedd73b56134e5ea57aaf487bf5c77e",
"region" : "UK",
"publicKeyId" : "AG77NIXPURMDUC3DOC5WQPPH"
},
"name" : "Amazon Pay",
"type" : "amazonpay"
},
{
"brand" : "monizze_eco",
"name" : "Monizze Eco Card",
"type" : "giftcard"
},
{
"brand" : "monizze_gift",
"name" : "Monizze Gift Card",
"type" : "giftcard"
},
{
"brand" : "monizze_mealvoucher",
"name" : "Monizze Meal Voucher",
"type" : "giftcard"
}
],
"storedPaymentMethods" : [
{
"brand" : "mc",
"expiryMonth" : "03",
"expiryYear" : "30",
"holderName" : "Checkout Shopper PlaceHolder",
"id" : "B8DH7GX5G9QKTH65",
"lastFour" : "5454",
"name" : "MasterCard",
"supportedRecurringProcessingModels" : [
"Subscription",
"UnscheduledCardOnFile",
"CardOnFile"
],
"supportedShopperInteractions" : [
"ContAuth",
"Ecommerce"
],
"type" : "scheme"
}
]
},
"sessionData" : "Ab02b4c0!BQABAgBtv\/cy5Dv8Bc8dZ6wG6NfbNNec1RGytpRl+MBuvumeAmv8Vybv7Bi+jdzFps3wogC02fd3rXL3RcYrE6ksxJMM\/u61FnbT6q3lehlUuKtec91HTpSw0LTZD128T5Y9p0cfG4xpB1rDphVwtuJT8NbTUNKC45yVM40JyY30pvn0ZqO9TjE66jN\/QyCe4FVjEDtkd5FBIqvmWO2KWcwjamfgGJ2VWb\/LPflJttDCSVrf6ye9odnWs+RL0B1m+3Fze96bOFsyBz85r30LtM3cSw8TIA3VEmx+1b+jc6qIDsAQfcWdk8q\/WnF6zBdAU0HEWdZbVA3dw9UKt6+B0eeYH41Ag4Upb3gWIsNVpHHdRVh3S72aVxWJE0tOY1jt7AD1fe3wporLR6OxFaVdj2hsrBmOKy9YqZr5MKDRN5V3NbdrVue6gfhYGfkGwVs2vKFnR+L4T8j0P4gJczamLT11y8KRS4ACVxkBuUgE56bbvg+aj0lipQhgC11EdD6kcvYqEY96qxz4qzVAHvM6cXBHYGcHXQHihhTLrV9DnIH97q+bKT9GoI409n1qtyiY\/XMZd0YeqeHp7C57MEUQaEN1BTXwkgfh8rTgPmzNJfqOdnj9tIe8MWtu7ftB60nFGrz6NVorADVdCbtNoh6\/UXLSjvGjzRGb6B+nTx2\/1fmT5FUtQQyaN325pvUfDqSNMsgASnsia2V5IjoiQUYwQUFBMTAzQ0E1MzdF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