use of com.paypal.kyc.model.KYCDocumentBusinessStakeHolderInfoModel in project mirakl-hyperwallet-connector by paypal.
the class MiraklBusinessStakeholderDocumentDownloadExtractServiceImplTest method documents.
private static Stream<Arguments> documents() {
// Case 1: Document needs LOA and KYC but does not exist in Mirakl
final KYCDocumentBusinessStakeHolderInfoModel case1 = spy(KYCDocumentBusinessStakeHolderInfoModel.builder().requiresLetterOfAuthorization(true).requiresKYC(true).build());
when(case1.existsDocumentInMirakl()).thenReturn(false);
// Case 2: Document needs LOA and KYC, exists in Mirakl but does not have LoA
// document in Mirakl
final KYCDocumentBusinessStakeHolderInfoModel case2 = spy(KYCDocumentBusinessStakeHolderInfoModel.builder().requiresLetterOfAuthorization(true).requiresKYC(true).build());
when(case2.existsDocumentInMirakl()).thenReturn(true);
when(case2.existsDocumentInMirakl()).thenReturn(false);
// Case 3: Document needs LOA (not KYC), but does not have a LoA document in
// Mirakl
final KYCDocumentBusinessStakeHolderInfoModel case3 = spy(KYCDocumentBusinessStakeHolderInfoModel.builder().requiresLetterOfAuthorization(true).requiresKYC(false).build());
when(case3.existsLetterOfAuthorizationDocumentInMirakl()).thenReturn(false);
// Case 4: Document needs KYC, but does not have a document in Mirakl
final KYCDocumentBusinessStakeHolderInfoModel case4 = spy(KYCDocumentBusinessStakeHolderInfoModel.builder().requiresLetterOfAuthorization(false).requiresKYC(true).build());
when(case4.existsDocumentInMirakl()).thenReturn(false);
return Stream.of(Arguments.of(case1), Arguments.of(case2), Arguments.of(case3), Arguments.of(case4));
}
use of com.paypal.kyc.model.KYCDocumentBusinessStakeHolderInfoModel in project mirakl-hyperwallet-connector by paypal.
the class MiraklBusinessStakeholderDocumentDownloadExtractServiceImplTest method getBusinessStakeholderDocumentsSelectedBySeller_shouldReturnSameInputWhenRequiresKYCButDocumentsDoesNotExists.
@Test
void getBusinessStakeholderDocumentsSelectedBySeller_shouldReturnSameInputWhenRequiresKYCButDocumentsDoesNotExists() {
// @formatter:off
final KYCDocumentBusinessStakeHolderInfoModel kycDocumentBusinessStakeHolderInfoModel = KYCDocumentBusinessStakeHolderInfoModel.builder().requiresKYC(true).businessStakeholderMiraklNumber(1).clientUserId(MIRAKL_SHOP_ID).proofOfIdentity(KYCProofOfIdentityEnum.GOVERNMENT_ID).build();
// @formatter:on
final KYCDocumentBusinessStakeHolderInfoModel result = testObj.getBusinessStakeholderDocumentsSelectedBySeller(kycDocumentBusinessStakeHolderInfoModel);
assertThat(kycDocumentBusinessStakeHolderInfoModel).isEqualTo(result);
}
use of com.paypal.kyc.model.KYCDocumentBusinessStakeHolderInfoModel in project mirakl-hyperwallet-connector by paypal.
the class MiraklBusinessStakeholderDocumentDownloadExtractServiceImplTest method getBusinessStakeholderDocumentsSelectedBySeller_shouldReturnSameInputWhenAuthorizationLetterIsRequiredAndRequiresKYCButDocumentsDoesNotExists.
@Test
void getBusinessStakeholderDocumentsSelectedBySeller_shouldReturnSameInputWhenAuthorizationLetterIsRequiredAndRequiresKYCButDocumentsDoesNotExists() {
// @formatter:off
final KYCDocumentBusinessStakeHolderInfoModel kycDocumentBusinessStakeHolderInfoModel = KYCDocumentBusinessStakeHolderInfoModel.builder().requiresKYC(true).requiresLetterOfAuthorization(true).businessStakeholderMiraklNumber(1).clientUserId(MIRAKL_SHOP_ID).proofOfIdentity(KYCProofOfIdentityEnum.GOVERNMENT_ID).build();
// @formatter:on
final KYCDocumentBusinessStakeHolderInfoModel result = testObj.getBusinessStakeholderDocumentsSelectedBySeller(kycDocumentBusinessStakeHolderInfoModel);
assertThat(kycDocumentBusinessStakeHolderInfoModel).isEqualTo(result);
}
use of com.paypal.kyc.model.KYCDocumentBusinessStakeHolderInfoModel in project mirakl-hyperwallet-connector by paypal.
the class MiraklBusinessStakeholderDocumentDownloadExtractServiceImplTest method getBusinessStakeholderDocumentsSelectedBySeller_shouldNotPopulateKYCInfoModelWithDocumentInformationWhenLetterOfAuthorizationIsRequiredAndLetterOfAuthorizationDocumentIsNotFilled.
@Test
void getBusinessStakeholderDocumentsSelectedBySeller_shouldNotPopulateKYCInfoModelWithDocumentInformationWhenLetterOfAuthorizationIsRequiredAndLetterOfAuthorizationDocumentIsNotFilled() {
// @formatter:off
final KYCDocumentBusinessStakeHolderInfoModel kycDocumentBusinessStakeHolderInfoModel = KYCDocumentBusinessStakeHolderInfoModel.builder().businessStakeholderMiraklNumber(1).requiresLetterOfAuthorization(Boolean.TRUE).clientUserId(MIRAKL_SHOP_ID).proofOfIdentity(KYCProofOfIdentityEnum.GOVERNMENT_ID).build();
// @formatter:on
final MiraklShopDocument miraklShopProofOfIdentityDocumentFront = new MiraklShopDocument();
miraklShopProofOfIdentityDocumentFront.setTypeCode("hw-bsh1-proof-identity-front");
final MiraklShopDocument miraklShopProofOfIdentityDocumentBack = new MiraklShopDocument();
miraklShopProofOfIdentityDocumentBack.setTypeCode("hw-bsh1-proof-identity-back");
final List<MiraklShopDocument> miraklShopDocumentsList = List.of(miraklShopProofOfIdentityDocumentFront, miraklShopProofOfIdentityDocumentBack);
when(miraklMarketplacePlatformOperatorApiClientMock.getShopDocuments(new MiraklGetShopDocumentsRequest(List.of(MIRAKL_SHOP_ID)))).thenReturn(miraklShopDocumentsList);
final KYCDocumentBusinessStakeHolderInfoModel result = testObj.getBusinessStakeholderDocumentsSelectedBySeller(kycDocumentBusinessStakeHolderInfoModel);
verify(miraklMarketplacePlatformOperatorApiClientMock).getShopDocuments(new MiraklGetShopDocumentsRequest(List.of(MIRAKL_SHOP_ID)));
verifyNoMoreInteractions(miraklMarketplacePlatformOperatorApiClientMock);
assertThat(result.getDocuments()).isEmpty();
}
use of com.paypal.kyc.model.KYCDocumentBusinessStakeHolderInfoModel in project mirakl-hyperwallet-connector by paypal.
the class MiraklBusinessStakeholderDocumentDownloadExtractServiceImplTest method getBusinessStakeholderDocumentsSelectedBySeller_shouldReturnAnEmptyListWhenNoProofOfAddressNeitherProofOfIdentityHasBeenSelectedBySeller.
@Test
void getBusinessStakeholderDocumentsSelectedBySeller_shouldReturnAnEmptyListWhenNoProofOfAddressNeitherProofOfIdentityHasBeenSelectedBySeller() {
// @formatter:off
final KYCDocumentBusinessStakeHolderInfoModel kycBusinessStakeholderNonSelectedDocuments = KYCDocumentBusinessStakeHolderInfoModel.builder().clientUserId(MIRAKL_SHOP_ID).proofOfIdentity(KYCProofOfIdentityEnum.GOVERNMENT_ID).build();
// @formatter:on
final KYCDocumentBusinessStakeHolderInfoModel result = testObj.getBusinessStakeholderDocumentsSelectedBySeller(kycBusinessStakeholderNonSelectedDocuments);
assertThat(result.getDocuments()).isEmpty();
}
Aggregations