Search in sources :

Example 1 with IBANBankAccountModel

use of com.paypal.sellers.bankaccountextract.model.IBANBankAccountModel in project mirakl-hyperwallet-connector by paypal.

the class MiraklShopToIBANBankAccountModelConverterStrategyTest method convert_shouldEnsureThatOptionalFieldLineAddress2IsFilledWithAnEmptyString.

@Test
void convert_shouldEnsureThatOptionalFieldLineAddress2IsFilledWithAnEmptyString() {
    when(miraklShopMock.getContactInformation()).thenReturn(contactInformationMock);
    when(miraklShopMock.getPaymentInformation()).thenReturn(miraklIbanBankAccountInformationMock);
    when(miraklShopMock.getCurrencyIsoCode()).thenReturn(MiraklIsoCurrencyCode.EUR);
    when(miraklShopMock.getProfessionalInformation()).thenReturn(miraklProfessionalInformationMock);
    when(miraklShopMock.getAdditionalFieldValues()).thenReturn(List.of(miraklBankAccountTokenFieldValueMock, miraklHyperwalletProgramFieldValueMock));
    when(miraklBankAccountTokenFieldValueMock.getCode()).thenReturn(HYPERWALLET_BANK_ACCOUNT_TOKEN);
    when(miraklBankAccountTokenFieldValueMock.getValue()).thenReturn(TOKEN);
    when(miraklHyperwalletProgramFieldValueMock.getCode()).thenReturn(SellerModelConstants.HYPERWALLET_PROGRAM);
    when(miraklHyperwalletProgramFieldValueMock.getValue()).thenReturn(HYPERWALLET_PROGRAM);
    when(contactInformationMock.getFirstname()).thenReturn(FIRST_NAME);
    when(contactInformationMock.getLastname()).thenReturn(LAST_NAME);
    when(contactInformationMock.getStreet1()).thenReturn(STREET_1);
    when(contactInformationMock.getStreet2()).thenReturn(null);
    when(contactInformationMock.getCountry()).thenReturn(SPAIN_COUNTRY);
    when(miraklIbanBankAccountInformationMock.getBic()).thenReturn(BIC_CODE);
    when(miraklIbanBankAccountInformationMock.getIban()).thenReturn(IBAN_ACCOUNT);
    when(miraklIbanBankAccountInformationMock.getBankCity()).thenReturn(CITY_NAME);
    when(miraklProfessionalInformationMock.getCorporateName()).thenReturn(BUSINESS_NAME);
    final IBANBankAccountModel result = testObj.execute(miraklShopMock);
    // @formatter:off
    assertThat(result).hasFieldOrPropertyWithValue("transferMethodCountry", ES_COUNTRY_ISO).hasFieldOrPropertyWithValue("transferMethodCurrency", EUR_CURRENCY).hasFieldOrPropertyWithValue("transferType", TransferType.BANK_ACCOUNT).hasFieldOrPropertyWithValue("type", BankAccountType.IBAN).hasFieldOrPropertyWithValue("bankBic", BIC_CODE).hasFieldOrPropertyWithValue("bankAccountNumber", IBAN_ACCOUNT).hasFieldOrPropertyWithValue("businessName", BUSINESS_NAME).hasFieldOrPropertyWithValue("firstName", FIRST_NAME).hasFieldOrPropertyWithValue("lastName", LAST_NAME).hasFieldOrPropertyWithValue("country", ES_COUNTRY_ISO).hasFieldOrPropertyWithValue("addressLine1", STREET_1).hasFieldOrPropertyWithValue("addressLine2", StringUtils.EMPTY).hasFieldOrPropertyWithValue("city", CITY_NAME).hasFieldOrPropertyWithValue("token", TOKEN).hasFieldOrPropertyWithValue("hyperwalletProgram", HYPERWALLET_PROGRAM);
// @formatter:on
}
Also used : IBANBankAccountModel(com.paypal.sellers.bankaccountextract.model.IBANBankAccountModel) Test(org.junit.jupiter.api.Test)

Example 2 with IBANBankAccountModel

use of com.paypal.sellers.bankaccountextract.model.IBANBankAccountModel in project mirakl-hyperwallet-connector by paypal.

the class MiraklShopToIBANBankAccountModelConverterStrategyTest method convert_ShouldTransformFromMiraklShopToUKIbanBankAccountModel.

@Test
void convert_ShouldTransformFromMiraklShopToUKIbanBankAccountModel() {
    when(miraklShopMock.getContactInformation()).thenReturn(contactInformationMock);
    when(miraklShopMock.getPaymentInformation()).thenReturn(miraklIbanBankAccountInformationMock);
    when(miraklShopMock.getCurrencyIsoCode()).thenReturn(MiraklIsoCurrencyCode.GBP);
    when(miraklShopMock.getProfessionalInformation()).thenReturn(miraklProfessionalInformationMock);
    when(miraklShopMock.getAdditionalFieldValues()).thenReturn(List.of(miraklBankAccountTokenFieldValueMock, miraklBankAccountStateFieldValueMock, miraklHyperwalletProgramFieldValueMock));
    when(miraklBankAccountTokenFieldValueMock.getCode()).thenReturn(HYPERWALLET_BANK_ACCOUNT_TOKEN);
    when(miraklBankAccountTokenFieldValueMock.getValue()).thenReturn(TOKEN);
    when(miraklBankAccountStateFieldValueMock.getCode()).thenReturn(HYPERWALLET_BANK_ACCOUNT_STATE);
    when(miraklBankAccountStateFieldValueMock.getValue()).thenReturn(STATE);
    when(miraklHyperwalletProgramFieldValueMock.getCode()).thenReturn(SellerModelConstants.HYPERWALLET_PROGRAM);
    when(miraklHyperwalletProgramFieldValueMock.getValue()).thenReturn(HYPERWALLET_PROGRAM);
    when(contactInformationMock.getFirstname()).thenReturn(FIRST_NAME);
    when(contactInformationMock.getLastname()).thenReturn(LAST_NAME);
    when(contactInformationMock.getStreet1()).thenReturn(STREET_1);
    when(contactInformationMock.getStreet2()).thenReturn(STREET_2);
    when(miraklIbanBankAccountInformationMock.getBankCity()).thenReturn(CITY_NAME);
    when(contactInformationMock.getCountry()).thenReturn(SPAIN_COUNTRY);
    when(miraklIbanBankAccountInformationMock.getBic()).thenReturn(BIC_CODE);
    when(miraklProfessionalInformationMock.getCorporateName()).thenReturn(BUSINESS_NAME);
    final IBANBankAccountModel result = testObj.execute(miraklShopMock);
    // @formatter:off
    assertThat(result).hasFieldOrPropertyWithValue("transferMethodCountry", ES_COUNTRY_ISO).hasFieldOrPropertyWithValue("transferType", TransferType.BANK_ACCOUNT).hasFieldOrPropertyWithValue("type", BankAccountType.IBAN).hasFieldOrPropertyWithValue("bankBic", BIC_CODE).hasFieldOrPropertyWithValue("businessName", BUSINESS_NAME).hasFieldOrPropertyWithValue("firstName", FIRST_NAME).hasFieldOrPropertyWithValue("lastName", LAST_NAME).hasFieldOrPropertyWithValue("country", ES_COUNTRY_ISO).hasFieldOrPropertyWithValue("addressLine1", STREET_1).hasFieldOrPropertyWithValue("addressLine2", STREET_2).hasFieldOrPropertyWithValue("city", CITY_NAME).hasFieldOrPropertyWithValue("stateProvince", STATE).hasFieldOrPropertyWithValue("token", TOKEN).hasFieldOrPropertyWithValue("hyperwalletProgram", HYPERWALLET_PROGRAM);
// @formatter:on
}
Also used : IBANBankAccountModel(com.paypal.sellers.bankaccountextract.model.IBANBankAccountModel) Test(org.junit.jupiter.api.Test)

Example 3 with IBANBankAccountModel

use of com.paypal.sellers.bankaccountextract.model.IBANBankAccountModel in project mirakl-hyperwallet-connector by paypal.

the class MiraklShopToIBANBankAccountModelConverterStrategyTest method convert_ShouldTransformFromMiraklShopToIbanBankAccountModel.

@Test
void convert_ShouldTransformFromMiraklShopToIbanBankAccountModel() {
    when(miraklShopMock.getContactInformation()).thenReturn(contactInformationMock);
    when(miraklShopMock.getPaymentInformation()).thenReturn(miraklIbanBankAccountInformationMock);
    when(miraklShopMock.getCurrencyIsoCode()).thenReturn(MiraklIsoCurrencyCode.EUR);
    when(miraklShopMock.getProfessionalInformation()).thenReturn(miraklProfessionalInformationMock);
    when(miraklShopMock.getAdditionalFieldValues()).thenReturn(List.of(miraklBankAccountTokenFieldValueMock, miraklBankAccountStateFieldValueMock, miraklHyperwalletProgramFieldValueMock));
    when(miraklBankAccountTokenFieldValueMock.getCode()).thenReturn(HYPERWALLET_BANK_ACCOUNT_TOKEN);
    when(miraklBankAccountTokenFieldValueMock.getValue()).thenReturn(TOKEN);
    when(miraklBankAccountStateFieldValueMock.getCode()).thenReturn(HYPERWALLET_BANK_ACCOUNT_STATE);
    when(miraklBankAccountStateFieldValueMock.getValue()).thenReturn(STATE);
    when(miraklHyperwalletProgramFieldValueMock.getCode()).thenReturn(SellerModelConstants.HYPERWALLET_PROGRAM);
    when(miraklHyperwalletProgramFieldValueMock.getValue()).thenReturn(HYPERWALLET_PROGRAM);
    when(contactInformationMock.getFirstname()).thenReturn(FIRST_NAME);
    when(contactInformationMock.getLastname()).thenReturn(LAST_NAME);
    when(contactInformationMock.getStreet1()).thenReturn(STREET_1);
    when(contactInformationMock.getStreet2()).thenReturn(STREET_2);
    when(miraklIbanBankAccountInformationMock.getBankCity()).thenReturn(CITY_NAME);
    when(contactInformationMock.getCountry()).thenReturn(SPAIN_COUNTRY);
    when(miraklIbanBankAccountInformationMock.getBic()).thenReturn(BIC_CODE);
    when(miraklIbanBankAccountInformationMock.getIban()).thenReturn(IBAN_ACCOUNT);
    when(miraklProfessionalInformationMock.getCorporateName()).thenReturn(BUSINESS_NAME);
    final IBANBankAccountModel result = testObj.execute(miraklShopMock);
    // @formatter:off
    assertThat(result).hasFieldOrPropertyWithValue("transferMethodCountry", ES_COUNTRY_ISO).hasFieldOrPropertyWithValue("transferMethodCurrency", EUR_CURRENCY).hasFieldOrPropertyWithValue("transferType", TransferType.BANK_ACCOUNT).hasFieldOrPropertyWithValue("type", BankAccountType.IBAN).hasFieldOrPropertyWithValue("bankBic", BIC_CODE).hasFieldOrPropertyWithValue("bankAccountNumber", IBAN_ACCOUNT).hasFieldOrPropertyWithValue("businessName", BUSINESS_NAME).hasFieldOrPropertyWithValue("firstName", FIRST_NAME).hasFieldOrPropertyWithValue("lastName", LAST_NAME).hasFieldOrPropertyWithValue("country", ES_COUNTRY_ISO).hasFieldOrPropertyWithValue("addressLine1", STREET_1).hasFieldOrPropertyWithValue("addressLine2", STREET_2).hasFieldOrPropertyWithValue("city", CITY_NAME).hasFieldOrPropertyWithValue("stateProvince", STATE).hasFieldOrPropertyWithValue("token", TOKEN).hasFieldOrPropertyWithValue("hyperwalletProgram", HYPERWALLET_PROGRAM);
// @formatter:on
}
Also used : IBANBankAccountModel(com.paypal.sellers.bankaccountextract.model.IBANBankAccountModel) Test(org.junit.jupiter.api.Test)

Aggregations

IBANBankAccountModel (com.paypal.sellers.bankaccountextract.model.IBANBankAccountModel)3 Test (org.junit.jupiter.api.Test)3