-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FX-1451] Add unit tests for RosettaPinSubmitter and RosettaPinElement #261
Conversation
@@ -26,10 +26,11 @@ import okhttp3.RequestBody | |||
import okhttp3.RequestBody.Companion.toRequestBody | |||
import org.json.JSONObject | |||
|
|||
internal class ForagePinSubmitter( | |||
internal class RosettaPinSubmitter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed for consistency with POS code and for less ambiguity while we have dual redundancy
private fun buildVaultUrl(path: String): HttpUrl = | ||
VAULT_BASE_URL.toHttpUrlOrNull()!! | ||
StopgapGlobalState.envConfig.vaultBaseUrl.toHttpUrlOrNull()!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied fix from here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to RosettaPinElement
. The term "wrapper" applies to Basis Theory, but we're not wrapping much in RosettaPinElement
} | ||
|
||
@Test | ||
fun `Basis Theory responds with a malformed error`() = runTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^Rosetta rather than BT
val path = buildMockPaymentCapturePath(paymentRef) | ||
|
||
return VaultProxyRequest.emptyRequest() | ||
.setHeader(ForageConstants.Headers.X_KEY, "22320ce0-1a3c-4c64-970c-51ed7db34548") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to send this X-KEY
header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the X-KEY
header for Rosetta (omitted here), but on this line, I'm emulating the headers that are set by the Abstract /Base Vault Submitter, I'll update a comment to capture this context in the code
...ndroid/src/main/java/com/joinforage/forage/android/ecom/ui/vault/forage/RosettaPinElement.kt
Dismissed
Show dismissed
Hide dismissed
...ndroid/src/main/java/com/joinforage/forage/android/ecom/ui/vault/forage/RosettaPinElement.kt
Dismissed
Show dismissed
Hide dismissed
...ndroid/src/main/java/com/joinforage/forage/android/ecom/ui/vault/forage/RosettaPinElement.kt
Dismissed
Show dismissed
Hide dismissed
...ndroid/src/main/java/com/joinforage/forage/android/ecom/ui/vault/forage/RosettaPinElement.kt
Dismissed
Show dismissed
Hide dismissed
import com.joinforage.forage.android.core.ui.textwatcher.PinTextWatcher | ||
import com.joinforage.forage.android.ecom.services.vault.forage.RosettaPinSubmitter | ||
|
||
internal class RosettaPinElement @JvmOverloads constructor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devinmorgan can this file be moved to core
instead of ecom
?
This can also happen in a future PR as this is an internal change, but vocalizing now for visibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main blocker right now is that this file depends on:
import com.joinforage.forage.android.ecom.services.vault.forage.RosettaPinSubmitter
which is an ecom
file. So in theory, yes, this file ought to live in core
since it's used in both Ecom and Pos but this may be more appropriate to do in a follow on PR since it's slightly move inovled. Nice callout!
6bcfec6
to
8a08eed
Compare
9cb2565
to
4299337
Compare
1b0e23e
into
evan/fx-1368-re-introduce-the-foragevaultwrapper-into-the-coreui-module
* add ForageResponseParser * add ForagePinSubmitter * add ForageVaultWrapper * use ForageVaultWrapper in ForagePINEditText * flip logic around to reduce unnecessary diff * update comment * Update forage-android/src/main/java/com/joinforage/forage/android/ecom/ui/ForagePINEditText.kt Co-authored-by: Danilo Joksimovic <[email protected]> * Rotate sample app value for customer-id Force re-tokenization of test cards in mobile-qa-tets * [FX-1451] Add unit tests for RosettaPinSubmitter and RosettaPinElement (#261) * Add unit tests for ForagePinSubmitter * Add RosettaPinElement tests! * Add test for checking default text size * Bring parity to corner styles * Add comment about x-key in tests * Fix tests from merging against Devin's changes * Appease linter --------- Co-authored-by: Danilo Joksimovic <[email protected]> Co-authored-by: Danilo Joksimovic <[email protected]>
* [FX-1376] Fetch rosetta-traffic-percentage to determine vault provider (#258) * add support for reading rosetta-traffic-percentage flag to LDManager * update LDManager.getVaultProvider tests * re-organize and combine lines * remove `vault-primary-traffic-percentage` flag references entirely * update LDManager tests * add TODO comment to clean up vgsVaultWrapper * clean up unused imports * [FX-1368] Re-introduce the ForageVaultWrapper (#260) * add ForageResponseParser * add ForagePinSubmitter * add ForageVaultWrapper * use ForageVaultWrapper in ForagePINEditText * flip logic around to reduce unnecessary diff * update comment * Update forage-android/src/main/java/com/joinforage/forage/android/ecom/ui/ForagePINEditText.kt Co-authored-by: Danilo Joksimovic <[email protected]> * Rotate sample app value for customer-id Force re-tokenization of test cards in mobile-qa-tets * [FX-1451] Add unit tests for RosettaPinSubmitter and RosettaPinElement (#261) * Add unit tests for ForagePinSubmitter * Add RosettaPinElement tests! * Add test for checking default text size * Bring parity to corner styles * Add comment about x-key in tests * Fix tests from merging against Devin's changes * Appease linter --------- Co-authored-by: Danilo Joksimovic <[email protected]> Co-authored-by: Danilo Joksimovic <[email protected]> --------- Co-authored-by: Danilo Joksimovic <[email protected]> Co-authored-by: Danilo Joksimovic <[email protected]>
What
RosettaPinSubmitter
ForageVaultWrapper
UI element--
Test Plan
How
Can be released as-is, should be included before 6/20