Search in sources :

Example 16 with KYCUserStatusNotificationBodyModel

use of com.paypal.kyc.model.KYCUserStatusNotificationBodyModel in project mirakl-hyperwallet-connector by paypal.

the class HyperWalletObjectToKYCUserStatusExecutorNotificationBodyModelConverterTest method convert_shouldTransformHyperWalletWebhookUserNotificationWithBusinessStakeHolderRequirementToKycUserStatusNotificationModelWithBusinessStakeholderReasonType_whenDetailsIsNotNull.

@Test
void convert_shouldTransformHyperWalletWebhookUserNotificationWithBusinessStakeHolderRequirementToKycUserStatusNotificationModelWithBusinessStakeholderReasonType_whenDetailsIsNotNull() {
    final Map<String, String> hyperWalletKycUserBodyNotification = createHyperWalletKycBusinessUserBodyNotification(HyperwalletUser.BusinessStakeholderVerificationStatus.REQUIRED, HyperwalletUser.LetterOfAuthorizationStatus.NOT_REQUIRED);
    when(kycRejectionReasonServiceMock.getReasonTypes(hyperWalletKycUserBodyNotification)).thenReturn(List.of(KYCRejectionReasonTypeEnum.BUSINESS_STAKEHOLDER_REQUIRED));
    final KYCUserStatusNotificationBodyModel result = testObj.convert(hyperWalletKycUserBodyNotification);
    assertThat(result.getClientUserId()).isEqualTo(CLIENT_USER_ID);
    assertThat(result.getProfileType()).isEqualTo(BUSINESS_PROFILE_TYPE);
    assertThat(result.getVerificationStatus()).isEqualTo(HyperwalletUser.VerificationStatus.NOT_REQUIRED);
    assertThat(result.getReasonsType()).containsExactly(KYCRejectionReasonTypeEnum.BUSINESS_STAKEHOLDER_REQUIRED);
}
Also used : KYCUserStatusNotificationBodyModel(com.paypal.kyc.model.KYCUserStatusNotificationBodyModel) Test(org.junit.jupiter.api.Test)

Aggregations

KYCUserStatusNotificationBodyModel (com.paypal.kyc.model.KYCUserStatusNotificationBodyModel)16 Test (org.junit.jupiter.api.Test)10 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)9 MiraklShopKycStatus (com.mirakl.client.mmp.domain.shop.MiraklShopKycStatus)6 MethodSource (org.junit.jupiter.params.provider.MethodSource)4 HyperwalletUser (com.hyperwallet.clientsdk.model.HyperwalletUser)1 MiraklException (com.mirakl.client.core.exception.MiraklException)1 ErrorBean (com.mirakl.client.domain.common.error.ErrorBean)1 MiraklShopKyc (com.mirakl.client.mmp.domain.shop.MiraklShopKyc)1 MiraklShopDocument (com.mirakl.client.mmp.domain.shop.document.MiraklShopDocument)1 MiraklMarketplacePlatformOperatorApiClient (com.mirakl.client.mmp.operator.core.MiraklMarketplacePlatformOperatorApiClient)1 MiraklUpdateShop (com.mirakl.client.mmp.operator.domain.shop.update.MiraklUpdateShop)1 MiraklUpdateShopWithErrors (com.mirakl.client.mmp.operator.domain.shop.update.MiraklUpdateShopWithErrors)1 MiraklUpdatedShopReturn (com.mirakl.client.mmp.operator.domain.shop.update.MiraklUpdatedShopReturn)1 MiraklUpdatedShops (com.mirakl.client.mmp.operator.domain.shop.update.MiraklUpdatedShops)1 MiraklUpdateShopsRequest (com.mirakl.client.mmp.operator.request.shop.MiraklUpdateShopsRequest)1 MiraklRequestAdditionalFieldValue (com.mirakl.client.mmp.request.additionalfield.MiraklRequestAdditionalFieldValue)1 MiraklSimpleRequestAdditionalFieldValue (com.mirakl.client.mmp.request.additionalfield.MiraklRequestAdditionalFieldValue.MiraklSimpleRequestAdditionalFieldValue)1 Converter (com.paypal.infrastructure.converter.Converter)1 HMCException (com.paypal.infrastructure.exceptions.HMCException)1