use of com.paypal.kyc.model.KYCUserStatusNotificationBodyModel in project mirakl-hyperwallet-connector by paypal.
the class BusinessKycUserNotificationStrategyTest method isApplicable_shouldReturnFalseWhenProfileTypeIsNotIndividual.
@MethodSource("nonBusinessProfileTypes")
@ParameterizedTest
void isApplicable_shouldReturnFalseWhenProfileTypeIsNotIndividual(final HyperwalletUser.ProfileType profileType) {
// @formatter:off
final KYCUserStatusNotificationBodyModel KYCUserStatusNotificationBodyModelStub = KYCUserStatusNotificationBodyModel.builder().profileType(profileType).build();
// @formatter:on
final boolean result = testObj.isApplicable(KYCUserStatusNotificationBodyModelStub);
assertThat(result).isFalse();
}
use of com.paypal.kyc.model.KYCUserStatusNotificationBodyModel in project mirakl-hyperwallet-connector by paypal.
the class BusinessKycUserNotificationStrategyTest method expectedKycMiraklStatus_shouldSetCorrectMiraklStatusBasedOnHyperwalletUserStatusesForBusiness.
@MethodSource("validVerificationStatuses")
@ParameterizedTest
void expectedKycMiraklStatus_shouldSetCorrectMiraklStatusBasedOnHyperwalletUserStatusesForBusiness(final HyperwalletUser.VerificationStatus verificationStatus, final HyperwalletUser.BusinessStakeholderVerificationStatus businessStakeholderVerificationStatus, final HyperwalletUser.LetterOfAuthorizationStatus letterOfAuthorizationStatus, final MiraklShopKycStatus miraklShopKycStatus) {
// @formatter:off
final KYCUserStatusNotificationBodyModel KYCUserStatusNotificationBodyModelStub = KYCUserStatusNotificationBodyModel.builder().clientUserId(String.valueOf(CLIENT_USER_ID)).verificationStatus(verificationStatus).businessStakeholderVerificationStatus(businessStakeholderVerificationStatus).letterOfAuthorizationStatus(letterOfAuthorizationStatus).profileType(HyperwalletUser.ProfileType.BUSINESS).build();
// @formatter:on
final MiraklShopKycStatus result = testObj.expectedKycMiraklStatus(KYCUserStatusNotificationBodyModelStub);
assertThat(result).isEqualTo(miraklShopKycStatus);
}
use of com.paypal.kyc.model.KYCUserStatusNotificationBodyModel in project mirakl-hyperwallet-connector by paypal.
the class IndividualKYCUserNotificationStrategyTest method execute_shouldSendKycUpdateNotification_whenIndividualSeller.
@MethodSource("validVerificationStatuses")
@ParameterizedTest
void execute_shouldSendKycUpdateNotification_whenIndividualSeller(final HyperwalletUser.VerificationStatus hyperwalletVerificationStatus, final MiraklShopKycStatus miraklKycStatus) {
// @formatter:off
final KYCUserStatusNotificationBodyModel KYCUserStatusNotificationBodyModelStub = KYCUserStatusNotificationBodyModel.builder().clientUserId(String.valueOf(CLIENT_USER_ID)).verificationStatus(hyperwalletVerificationStatus).profileType(HyperwalletUser.ProfileType.INDIVIDUAL).build();
// @formatter:on
final MiraklShopKycStatus result = testObj.expectedKycMiraklStatus(KYCUserStatusNotificationBodyModelStub);
assertThat(result).isEqualTo(miraklKycStatus);
}
use of com.paypal.kyc.model.KYCUserStatusNotificationBodyModel in project mirakl-hyperwallet-connector by paypal.
the class HyperWalletObjectToKYCUserStatusExecutorNotificationBodyModelConverterTest method convert_shouldTransformHyperWalletWebhookUserNotificationWithLetterOfAuthorizationRequirementToKycUserStatusNotificationModelWithLetterOfAuthorizationReasonType_whenDetailsIsNotNull.
@Test
void convert_shouldTransformHyperWalletWebhookUserNotificationWithLetterOfAuthorizationRequirementToKycUserStatusNotificationModelWithLetterOfAuthorizationReasonType_whenDetailsIsNotNull() {
final Map<String, String> hyperWalletKycUserBodyNotification = createHyperWalletKycBusinessUserBodyNotification(HyperwalletUser.BusinessStakeholderVerificationStatus.NOT_REQUIRED, HyperwalletUser.LetterOfAuthorizationStatus.REQUIRED);
when(kycRejectionReasonServiceMock.getReasonTypes(hyperWalletKycUserBodyNotification)).thenReturn(List.of(KYCRejectionReasonTypeEnum.LETTER_OF_AUTHORIZATION_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.LETTER_OF_AUTHORIZATION_REQUIRED);
}
use of com.paypal.kyc.model.KYCUserStatusNotificationBodyModel in project mirakl-hyperwallet-connector by paypal.
the class HyperWalletObjectToKYCUserStatusExecutorNotificationBodyModelConverterTest method convert_shouldTransformHyperWalletWebhookBusinessUserNotificationToKycBusinessUserStatusNotificationModel_whenDetailsIsNotNull.
@Test
void convert_shouldTransformHyperWalletWebhookBusinessUserNotificationToKycBusinessUserStatusNotificationModel_whenDetailsIsNotNull() {
final Map<String, String> hyperWalletKycUserBodyNotification = createHyperWalletKycUserBodyNotification(BUSINESS_PROFILE_TYPE);
when(kycRejectionReasonServiceMock.getReasonTypes(hyperWalletKycUserBodyNotification)).thenReturn(List.of(KYCRejectionReasonTypeEnum.VERIFICATIONSTATUS_PROF_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(REQUIRED_VERIFICATION_STATUS);
assertThat(result.getBusinessStakeholderVerificationStatus()).isEqualTo(NOT_REQUIRED_BUSINESS_VERIFICATION_STATUS);
assertThat(result.getLetterOfAuthorizationStatus()).isEqualTo(FAILED_LETTER_VERIFICATION_STATUS);
assertThat(result.getReasonsType()).containsExactlyInAnyOrder(KYCRejectionReasonTypeEnum.VERIFICATIONSTATUS_PROF_REQUIRED);
verify(objectKYCDocumentNotificationModelListConverterMock).convert(hyperWalletKycUserBodyNotification);
}
Aggregations