diff --git a/ui/src/androidTest/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodTest.java b/ui/src/androidTest/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodTest.java index c67aea94c..5c3ace145 100644 --- a/ui/src/androidTest/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodTest.java +++ b/ui/src/androidTest/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodTest.java @@ -404,4 +404,43 @@ public void testSelectTransferMethod_clickBankCardOpensAddTransferMethodUi() { onView(allOf(instanceOf(TextView.class), withParent(withId(R.id.toolbar)))).check( matches(withText(R.string.title_add_bank_card))); } + + @Test + public void testSelectTransferMethod_verifyThatCountryIsFromUserProfile() { + mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager + .getResourceContent("user_ca_response.json")).mock(); + mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager + .getResourceContent("successful_tmc_keys_response.json")).mock(); + + mActivityTestRule.launchActivity(null); + + onView(withId(R.id.select_transfer_method_country_value)).check(matches(withText("Canada"))); + onView(withId(R.id.select_transfer_method_currency_value)).check(matches(withText("CAD"))); + } + + @Test + public void testSelectTransferMethod_verifyDefaultsToUSWhenUserProfileCountryIsNotConfigured() { + mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager + .getResourceContent("user_not_configured_country_response.json")).mock(); + mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager + .getResourceContent("successful_tmc_keys_response.json")).mock(); + + mActivityTestRule.launchActivity(null); + + onView(withId(R.id.select_transfer_method_country_value)).check(matches(withText("United States"))); + onView(withId(R.id.select_transfer_method_currency_value)).check(matches(withText("USD"))); + } + + @Test + public void testSelectTransferMethod_verifyDefaultsToUSWhenUserProfileDoesNotHaveCountry() { + mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager + .getResourceContent("user_no_country_response.json")).mock(); + mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager + .getResourceContent("successful_tmc_keys_response.json")).mock(); + + mActivityTestRule.launchActivity(null); + + onView(withId(R.id.select_transfer_method_country_value)).check(matches(withText("United States"))); + onView(withId(R.id.select_transfer_method_currency_value)).check(matches(withText("USD"))); + } } diff --git a/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodContract.java b/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodContract.java index ec4a747fb..92e8c27bf 100644 --- a/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodContract.java +++ b/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodContract.java @@ -28,6 +28,7 @@ package com.hyperwallet.android.ui.transfermethod; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.hyperwallet.android.model.HyperwalletError; @@ -89,8 +90,8 @@ interface Presenter { void loadCurrency(final boolean forceUpdate, @NonNull final String countryCode); - void loadTransferMethodConfigurationKeys(final boolean forceUpdate, @NonNull final String countryCode, - @NonNull final String currencyCode); + void loadTransferMethodConfigurationKeys(final boolean forceUpdate, @Nullable final String countryCode, + @Nullable final String currencyCode); void loadTransferMethodTypes(final boolean forceUpdate, @NonNull final String countryCode, @NonNull final String currencyCode); diff --git a/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodFragment.java b/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodFragment.java index b18a9cb93..c0e67af51 100644 --- a/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodFragment.java +++ b/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodFragment.java @@ -55,8 +55,6 @@ public class SelectTransferMethodFragment extends Fragment implements SelectTran private static final String ARGUMENT_COUNTRY_CODE_SELECTED = "ARGUMENT_COUNTRY_CODE_SELECTED"; private static final String ARGUMENT_CURRENCY_CODE_SELECTED = "ARGUMENT_CURRENCY_CODE_SELECTED"; - private static final String DEFAULT_COUNTRY_CODE = "US"; - private static final String DEFAULT_CURRENCY_CODE = "USD"; private static final boolean FORCE_UPDATE = false; private static final String TAG = SelectTransferMethodFragment.class.getName(); @@ -80,8 +78,6 @@ public SelectTransferMethodFragment() { public static SelectTransferMethodFragment newInstance() { SelectTransferMethodFragment selectTransferMethodFragment = new SelectTransferMethodFragment(); - selectTransferMethodFragment.mSelectedCountryCode = DEFAULT_COUNTRY_CODE; - selectTransferMethodFragment.mSelectedCurrencyCode = DEFAULT_CURRENCY_CODE; Bundle arguments = new Bundle(); arguments.putString(ARGUMENT_COUNTRY_CODE_SELECTED, selectTransferMethodFragment.mSelectedCountryCode); diff --git a/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodPresenter.java b/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodPresenter.java index e6cb193bd..015fa8bfa 100644 --- a/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodPresenter.java +++ b/ui/src/main/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodPresenter.java @@ -17,9 +17,14 @@ */ package com.hyperwallet.android.ui.transfermethod; +import static com.hyperwallet.android.ExceptionMapper.EC_UNEXPECTED_EXCEPTION; + +import android.text.TextUtils; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.hyperwallet.android.model.HyperwalletError; import com.hyperwallet.android.model.HyperwalletErrors; import com.hyperwallet.android.model.graphql.HyperwalletTransferMethodConfigurationKey; import com.hyperwallet.android.model.graphql.keyed.Country; @@ -30,6 +35,7 @@ import com.hyperwallet.android.ui.repository.UserRepository; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -37,6 +43,8 @@ public class SelectTransferMethodPresenter implements SelectTransferMethodContract.Presenter { + private static final String DEFAULT_COUNTRY_CODE = "US"; + private final TransferMethodConfigurationRepository mTransferMethodConfigurationRepository; private final UserRepository mUserRepository; private final SelectTransferMethodContract.View mView; @@ -50,8 +58,8 @@ public class SelectTransferMethodPresenter implements SelectTransferMethodContra } @Override - public void loadTransferMethodConfigurationKeys(final boolean forceUpdate, @NonNull final String countryCode, - @NonNull final String currencyCode) { + public void loadTransferMethodConfigurationKeys(final boolean forceUpdate, @Nullable final String countryCode, + @Nullable final String currencyCode) { mView.showProgressBar(); @@ -69,16 +77,41 @@ public void onKeysLoaded(@Nullable final HyperwalletTransferMethodConfigurationK if (!mView.isActive()) { return; } + + Country country = TextUtils.isEmpty(countryCode) ? key.getCountry(user.getCountry()) + : key.getCountry(countryCode); + + if (country == null) { // param and user country is null + country = key.getCountry(DEFAULT_COUNTRY_CODE); + } + + String currencyCodeString = currencyCode; + Set currencies = key.getCurrencies(country.getCode()); + if (TextUtils.isEmpty(currencyCodeString) && currencies != null + && !currencies.isEmpty()) { + currencyCodeString = ((Currency) currencies.toArray()[0]).getCode(); + } + + // at this point if currencyCodeString is still null/empty, that means program is + // mis-configured + if (TextUtils.isEmpty(currencyCodeString)) { + HyperwalletError error = new HyperwalletError( + "Can't get Currency based from Country: " + country.getCode(), + EC_UNEXPECTED_EXCEPTION); + showErrorLoadTransferMethods(new HyperwalletErrors(Arrays.asList(error))); + return; + } + mView.hideProgressBar(); Set transferMethodTypes = - key.getTransferMethodType(countryCode, currencyCode) != null - ? key.getTransferMethodType(countryCode, currencyCode) : + key.getTransferMethodType(country.getCode(), currencyCodeString) != null + ? key.getTransferMethodType(country.getCode(), currencyCodeString) : new HashSet(); - mView.showTransferMethodCountry(countryCode); - mView.showTransferMethodCurrency(currencyCode); + mView.showTransferMethodCountry(country.getCode()); + mView.showTransferMethodCurrency(currencyCodeString); mView.showTransferMethodTypes( - getTransferMethodSelectionItems(countryCode, currencyCode, + getTransferMethodSelectionItems(country.getCode(), currencyCodeString, user.getProfileType(), transferMethodTypes)); } diff --git a/ui/src/test/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodPresenterTest.java b/ui/src/test/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodPresenterTest.java index 9a109230a..d90192572 100644 --- a/ui/src/test/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodPresenterTest.java +++ b/ui/src/test/java/com/hyperwallet/android/ui/transfermethod/SelectTransferMethodPresenterTest.java @@ -1,5 +1,7 @@ package com.hyperwallet.android.ui.transfermethod; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; import static org.mockito.Matchers.any; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; @@ -11,6 +13,8 @@ import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.initMocks; +import static com.hyperwallet.android.ExceptionMapper.EC_UNEXPECTED_EXCEPTION; + import com.hyperwallet.android.model.HyperwalletError; import com.hyperwallet.android.model.HyperwalletErrors; import com.hyperwallet.android.model.graphql.HyperwalletTransferMethodConfigurationKey; @@ -23,12 +27,15 @@ import com.hyperwallet.android.ui.repository.UserRepositoryImpl; import com.hyperwallet.android.ui.rule.HyperwalletExternalResourceManager; +import org.hamcrest.Matchers; import org.json.JSONObject; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; import org.mockito.ArgumentMatchers; +import org.mockito.Captor; import org.mockito.Mock; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -50,7 +57,11 @@ public class SelectTransferMethodPresenterTest { private TransferMethodConfigurationRepositoryImpl mTransferMethodConfigurationRepository; @Mock private UserRepositoryImpl mUserRepository; + @Captor + private ArgumentCaptor> mErrorCaptor; + private HyperwalletTransferMethodConfigurationKey mResult; + private HyperwalletTransferMethodConfigurationKey mPartialResult; private HyperwalletUser mUser; private SelectTransferMethodPresenter selectTransferMethodPresenter; @@ -61,6 +72,10 @@ public void initialize() throws Exception { final JSONObject jsonObject = new JSONObject(responseBody); mResult = new HyperwalletTransferMethodConfigurationKeyResult(jsonObject); + String partialResponseBody = externalResourceManager.getResourceContent( + "partial_success_tmc_keys_response.json"); + mPartialResult = new HyperwalletTransferMethodConfigurationKeyResult(new JSONObject(partialResponseBody)); + String userResponseBody = externalResourceManager.getResourceContent("user_response.json"); final JSONObject userJsonObject = new JSONObject(userResponseBody); mUser = new HyperwalletUser(userJsonObject); @@ -187,6 +202,94 @@ public Object answer(InvocationOnMock invocation) { verify(view, never()).showAddTransferMethod(anyString(), anyString(), anyString(), anyString()); } + @Test + public void testLoadTransferMethodConfigurationKeys_loadsKeysIntoUserProfileCountryViewOnSuccess() { + // When + when(view.isActive()).thenReturn(true); + + doAnswer(new Answer() { + @Override + public Object answer(InvocationOnMock invocation) { + TransferMethodConfigurationRepository.LoadKeysCallback callback = + (TransferMethodConfigurationRepository.LoadKeysCallback) invocation.getArguments()[0]; + callback.onKeysLoaded(mResult); + return callback; + } + }).when(mTransferMethodConfigurationRepository).getKeys(any( + TransferMethodConfigurationRepository.LoadKeysCallback.class)); + + doAnswer(new Answer() { + @Override + public Object answer(InvocationOnMock invocation) { + UserRepository.LoadUserCallback userCallback = + (UserRepository.LoadUserCallback) invocation.getArguments()[0]; + userCallback.onUserLoaded(mUser); + return userCallback; + } + }).when(mUserRepository).loadUser(any( + UserRepository.LoadUserCallback.class)); + + // Then + selectTransferMethodPresenter.loadTransferMethodConfigurationKeys(false, null, null); + + verify(view).showTransferMethodCountry("US"); + verify(view).showTransferMethodCurrency("USD"); + verify(view).showTransferMethodTypes(ArgumentMatchers.anyList()); + verify(view, never()).showErrorLoadTransferMethodConfigurationKeys( + ArgumentMatchers.anyList()); + verify(view, never()).showErrorLoadCurrency(ArgumentMatchers.anyList()); + verify(view, never()).showErrorLoadTransferMethodTypes(ArgumentMatchers.anyList()); + verify(view, never()).showErrorLoadCountrySelection(ArgumentMatchers.anyList()); + verify(view, never()).showErrorLoadCurrencySelection(ArgumentMatchers.anyList()); + verify(view, never()).showAddTransferMethod(anyString(), anyString(), anyString(), anyString()); + } + + @Test + public void testLoadTransferMethodConfigurationKeys_loadsKeysIntoUserProfileCountryViewOnError() { + // When + when(view.isActive()).thenReturn(true); + + doAnswer(new Answer() { + @Override + public Object answer(InvocationOnMock invocation) { + TransferMethodConfigurationRepository.LoadKeysCallback callback = + (TransferMethodConfigurationRepository.LoadKeysCallback) invocation.getArguments()[0]; + callback.onKeysLoaded(mPartialResult); + return callback; + } + }).when(mTransferMethodConfigurationRepository).getKeys(any( + TransferMethodConfigurationRepository.LoadKeysCallback.class)); + + doAnswer(new Answer() { + @Override + public Object answer(InvocationOnMock invocation) { + UserRepository.LoadUserCallback userCallback = + (UserRepository.LoadUserCallback) invocation.getArguments()[0]; + userCallback.onUserLoaded(mUser); + return userCallback; + } + }).when(mUserRepository).loadUser(any( + UserRepository.LoadUserCallback.class)); + + // Then + selectTransferMethodPresenter.loadTransferMethodConfigurationKeys(false, null, null); + + + verify(view).showProgressBar(); + verify(view, times(2)).isActive(); + verify(view).hideProgressBar(); + verify(view).showErrorLoadTransferMethodConfigurationKeys(mErrorCaptor.capture()); + verify(view, never()).showTransferMethodCountry(anyString()); + verify(view, never()).showTransferMethodCurrency(anyString()); + verify(view, never()).showTransferMethodTypes(ArgumentMatchers.anyList()); + + // Assert + List errors = mErrorCaptor.getValue(); + assertThat(errors, Matchers.hasSize(1)); + assertThat(errors.get(0).getCode(), is(EC_UNEXPECTED_EXCEPTION)); + assertThat(errors.get(0).getMessage(), is("Can't get Currency based from Country: US")); + } + @Test public void testLoadCurrency_loadsCurrenciesIntoViewOnSuccess() { // When diff --git a/ui/src/test/resources/partial_success_tmc_keys_response.json b/ui/src/test/resources/partial_success_tmc_keys_response.json new file mode 100644 index 000000000..14c93e060 --- /dev/null +++ b/ui/src/test/resources/partial_success_tmc_keys_response.json @@ -0,0 +1,300 @@ +{ + "data": { + "countries": { + "nodes": [ + { + "code": "CA", + "name": "Canada", + "currencies": { + "nodes": [ + { + "code": "CAD", + "name": "Canadian Dollar", + "transferMethodTypes": { + "nodes": [ + { + "code": "BANK_ACCOUNT", + "name": "Bank Account", + "fees": { + "nodes": [ + { + "country": "CA", + "currency": "CAD", + "transferMethodType": "BANK_ACCOUNT", + "value": "2.20", + "feeRateType": "FLAT" + } + ] + }, + "processingTimes": { + "nodes": [ + { + "value": "1-2 Business days", + "country": "CA", + "currency": "CAD", + "transferMethodType": "BANK_ACCOUNT" + } + ] + } + }, + { + "code": "PAYPAL_ACCOUNT", + "name": "PayPal Account", + "fees": { + "nodes": [ + { + "country": "CA", + "currency": "CAD", + "transferMethodType": "PAYPAL_ACCOUNT", + "value": "0.25", + "feeRateType": "FLAT" + } + ] + }, + "processingTimes": { + "nodes": [ + { + "value": "IMMEDIATE", + "country": "CA", + "currency": "CAD", + "transferMethodType": "PAYPAL_ACCOUNT" + } + ] + } + } + ] + } + }, + { + "code": "USD", + "name": "United States Dollar", + "transferMethodTypes": { + "nodes": [ + { + "code": "BANK_ACCOUNT", + "name": "Bank Account", + "fees": { + "nodes": [ + { + "country": "CA", + "currency": "USD", + "transferMethodType": "BANK_ACCOUNT", + "value": "2.00", + "feeRateType": "FLAT" + } + ] + }, + "processingTimes": { + "nodes": [ + { + "value": "1-2 Business days", + "country": "CA", + "currency": "USD", + "transferMethodType": "BANK_ACCOUNT" + } + ] + } + } + ] + } + } + ] + } + }, + { + "code": "HR", + "name": "Croatia", + "currencies": { + "nodes": [ + { + "code": "EUR", + "name": "Euro", + "transferMethodTypes": { + "nodes": [ + { + "code": "BANK_ACCOUNT", + "name": "Bank Account", + "fees": { + "nodes": [ + { + "country": "HR", + "currency": "EUR", + "transferMethodType": "BANK_ACCOUNT", + "value": "1.50", + "feeRateType": "FLAT" + } + ] + }, + "processingTimes": { + "nodes": [ + { + "value": "2-3 Business days", + "country": "HR", + "currency": "EUR", + "transferMethodType": "BANK_ACCOUNT" + } + ] + } + } + ] + } + }, + { + "code": "HRK", + "name": "Croatian Kuna", + "transferMethodTypes": { + "nodes": [ + { + "code": "BANK_ACCOUNT", + "name": "Bank Account", + "fees": { + "nodes": [ + { + "country": "HR", + "currency": "HRK", + "transferMethodType": "BANK_ACCOUNT", + "value": "1.50", + "feeRateType": "FLAT" + } + ] + }, + "processingTimes": { + "nodes": [ + { + "value": "1-2 Business days", + "country": "HR", + "currency": "HRK", + "transferMethodType": "BANK_ACCOUNT" + } + ] + } + } + ] + } + } + ] + } + }, + { + "code": "MX", + "name": "Mexico", + "currencies": { + "nodes": [ + { + "code": "MXN", + "name": "Mexican Peso", + "transferMethodTypes": { + "nodes": [ + { + "code": "BANK_ACCOUNT", + "name": "Bank Account", + "fees": { + "nodes": [ + { + "country": "MX", + "currency": "MXN", + "transferMethodType": "BANK_ACCOUNT", + "value": "26.15", + "feeRateType": "FLAT" + } + ] + }, + "processingTimes": { + "nodes": [ + { + "value": "1-2 Business days", + "country": "MX", + "currency": "MXN", + "transferMethodType": "BANK_ACCOUNT" + } + ] + } + } + ] + } + } + ] + } + }, + { + "code": "GB", + "name": "United Kingdom", + "currencies": { + "nodes": [ + { + "code": "EUR", + "name": "Euro", + "transferMethodTypes": { + "nodes": [ + { + "code": "BANK_ACCOUNT", + "name": "Bank Account", + "fees": { + "nodes": [ + { + "country": "GB", + "currency": "EUR", + "transferMethodType": "BANK_ACCOUNT", + "value": "1.50", + "feeRateType": "FLAT" + } + ] + }, + "processingTimes": { + "nodes": [ + { + "value": "2-4 Business days", + "country": "GB", + "currency": "EUR", + "transferMethodType": "BANK_ACCOUNT" + } + ] + } + } + ] + } + }, + { + "code": "GBP", + "name": "British Pound", + "transferMethodTypes": { + "nodes": [ + { + "code": "BANK_ACCOUNT", + "name": "Bank Account", + "fees": { + "nodes": [ + { + "country": "GB", + "currency": "GBP", + "transferMethodType": "BANK_ACCOUNT", + "value": "1.20", + "feeRateType": "FLAT" + } + ] + }, + "processingTimes": { + "nodes": [ + { + "value": "1-2 Business days", + "country": "GB", + "currency": "GBP", + "transferMethodType": "BANK_ACCOUNT" + } + ] + } + } + ] + } + } + ] + } + }, + { + "code": "US", + "name": "United States" + } + ] + } + } +} \ No newline at end of file diff --git a/ui/src/test/resources/user_business_response.json b/ui/src/test/resources/user_business_response.json index 5ba6c60e2..02b57af6d 100644 --- a/ui/src/test/resources/user_business_response.json +++ b/ui/src/test/resources/user_business_response.json @@ -1,5 +1,5 @@ { - "token": "usr-e602a937-334c-49e5-b37e-4c842c1cc7a1", + "token": "usr-token-1", "status": "PRE_ACTIVATED", "verificationStatus": "NOT_REQUIRED", "createdOn": "2019-05-14T21:51:15", @@ -28,17 +28,17 @@ "addressLine2": "second floor", "city": "Burnaby", "stateProvince": "XZ", - "country": "CA", + "country": "US", "postalCode": "v5z3a2", "language": "en", "timeZone": "GMT", - "programToken": "prg-7a2441be-1b00-4239-b2d6-623a0eb8f160", + "programToken": "prg-token-1", "links": [ { "params": { "rel": "self" }, - "href": "https://api.sandbox.hyperwallet.com/rest/v3/users/usr-e602a937-334c-49e5-b37e-4c842c1cc7a1" + "href": "https://localhost/rest/v3/users/usr-token-1" } ] } \ No newline at end of file diff --git a/ui/src/test/resources/user_ca_response.json b/ui/src/test/resources/user_ca_response.json new file mode 100644 index 000000000..4d771cc49 --- /dev/null +++ b/ui/src/test/resources/user_ca_response.json @@ -0,0 +1,26 @@ +{ + "token": "usr-token-2", + "status": "PRE_ACTIVATED", + "createdOn": "2017-10-30T22:15:45", + "clientUserId": "123456", + "profileType": "INDIVIDUAL", + "firstName": "Person", + "lastName": "FromCanada", + "dateOfBirth": "1991-01-01", + "email": "user+4satF1xV@hyperwallet.com", + "addressLine1": "950 Granville", + "city": "Vancouver", + "stateProvince": "BC", + "country": "CA", + "postalCode": "H0H0H0", + "language": "en", + "programToken": "prg-token-2", + "links": [ + { + "params": { + "rel": "self" + }, + "href": "https://localhost/rest/v3/users/usr-token-2" + } + ] +} \ No newline at end of file diff --git a/ui/src/test/resources/user_no_country_response.json b/ui/src/test/resources/user_no_country_response.json new file mode 100644 index 000000000..cb0586fd2 --- /dev/null +++ b/ui/src/test/resources/user_no_country_response.json @@ -0,0 +1,25 @@ +{ + "token": "usr-token-3", + "status": "PRE_ACTIVATED", + "createdOn": "2017-10-30T22:15:45", + "clientUserId": "123456", + "profileType": "INDIVIDUAL", + "firstName": "Person", + "lastName": "FromNoCountry", + "dateOfBirth": "1991-01-01", + "email": "user+4satF1xV@hyperwallet.com", + "addressLine1": "950 Granville", + "city": "Vancouver", + "stateProvince": "BC", + "postalCode": "H0H0H0", + "language": "en", + "programToken": "prg-token-3", + "links": [ + { + "params": { + "rel": "self" + }, + "href": "https://localhost/rest/v3/users/usr-token-3" + } + ] +} \ No newline at end of file diff --git a/ui/src/test/resources/user_not_configured_country_response.json b/ui/src/test/resources/user_not_configured_country_response.json new file mode 100644 index 000000000..9c65d0375 --- /dev/null +++ b/ui/src/test/resources/user_not_configured_country_response.json @@ -0,0 +1,26 @@ +{ + "token": "usr-token-4", + "status": "PRE_ACTIVATED", + "createdOn": "2017-10-30T22:15:45", + "clientUserId": "123456", + "profileType": "INDIVIDUAL", + "firstName": "Person", + "lastName": "FromJapan", + "dateOfBirth": "1991-01-01", + "email": "user+4satF1xV@hyperwallet.com", + "addressLine1": "950 Granville", + "city": "Vancouver", + "stateProvince": "BC", + "country": "JP", + "postalCode": "H0H0H0", + "language": "en", + "programToken": "prg-token-4", + "links": [ + { + "params": { + "rel": "self" + }, + "href": "https://localhost/rest/v3/users/usr-token-4" + } + ] +} \ No newline at end of file diff --git a/ui/src/test/resources/user_response.json b/ui/src/test/resources/user_response.json index e65074bef..018ea339e 100644 --- a/ui/src/test/resources/user_response.json +++ b/ui/src/test/resources/user_response.json @@ -1,5 +1,5 @@ { - "token": "usr-f9154016-94e8-4686-a840-075688ac07b5", + "token": "usr-token-5", "status": "PRE_ACTIVATED", "createdOn": "2017-10-30T22:15:45", "clientUserId": "123456", @@ -14,13 +14,13 @@ "country": "US", "postalCode": "94105", "language": "en", - "programToken": "prg-83836cdf-2ce2-4696-8bc5-f1b86077238c", + "programToken": "prg-token-5", "links": [ { "params": { "rel": "self" }, - "href": "https://api.sandbox.hyperwallet.com/rest/v3/users/usr-f9154016-94e8-4686-a840-075688ac07b5" + "href": "https://localhost/rest/v3/users/usr-token-5" } ] } \ No newline at end of file