From a52b6b132da550aa5d0cb785f6e368cc93d3a116 Mon Sep 17 00:00:00 2001 From: Pospolita Nikita Date: Mon, 31 Jan 2022 12:07:36 +0300 Subject: [PATCH] [APM-7] New structure in DigitalWallet (#4) 1) fistful-proto migration from rbk.money to vality.dev 2) fistful-proto new DigitalWallet structure (APM-7) 3) added github/actions --- .github/workflows/build.yml | 10 +++++++ .github/workflows/deploy.yml | 18 +++++++++++++ pom.xml | 4 +-- .../mg/connector/config/HgConfig.java | 10 +++---- ...istfulAccountToDomainAccountConverter.java | 4 +-- .../FistfulCashToDomainCashConverter.java | 6 ++--- ...tfulCurrencyToDomainCurrencyConverter.java | 4 +-- ...tfulResourceToDomainResourceConverter.java | 12 ++++----- .../converter/WithdrawalConverterImpl.java | 2 +- .../factory/FistfulEventRangeFactory.java | 2 +- ...entSinkWithdrawalToFraudStreamFactory.java | 2 +- .../impl/LogWithdrawalMapperDecorator.java | 2 +- .../mapper/impl/WithdrawalMapper.java | 8 +++--- .../parser/WithdrawalEventParser.java | 2 +- .../service/DestinationClientService.java | 6 ++--- .../service/WalletClientService.java | 6 ++--- .../service/WithdrawalClientService.java | 4 +-- .../connector/utils/WithdrawalModelUtil.java | 12 ++++----- ...raudbustersMgConnectorApplicationTest.java | 8 +++--- ...ResourceToDomainResourceConverterTest.java | 14 +++++----- .../mapper/impl/WithdrawalBeanUtils.java | 16 ++++++------ .../mapper/impl/WithdrawalMapperTest.java | 10 +++---- .../mg/connector/utils/BuildUtils.java | 26 +++++++++---------- .../connector/utils/InvoiceTestConstant.java | 6 ++--- .../utils/WithdrawalFlowGenerator.java | 16 ++++++------ 25 files changed, 118 insertions(+), 92 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f547e2c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,10 @@ +name: Maven Build Artifact + +on: + pull_request: + branches: + - '*' + +jobs: + build: + uses: valitydev/base-workflow/.github/workflows/maven-service-build.yml@v1 \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..eb9016e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,18 @@ +name: Maven Deploy Artifact + +on: + push: + branches: + - 'master' + - 'main' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + deploy: + uses: valitydev/base-workflow/.github/workflows/maven-service-deploy.yml@v1 + secrets: + github-token: ${{ secrets.GITHUB_TOKEN }} + mm-webhook-url: ${{ secrets.MATTERMOST_WEBHOOK_URL }} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 9085acd..e967cdb 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 1.18-d814d69 1.99-2a8f6ca - 1.128-d331fce + 1.133-c484877 @@ -79,7 +79,7 @@ filter - com.rbkmoney + dev.vality fistful-proto ${fistful-proto.version} diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/config/HgConfig.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/config/HgConfig.java index e4c046a..ef719fa 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/config/HgConfig.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/config/HgConfig.java @@ -1,7 +1,7 @@ package com.rbkmoney.fraudbusters.mg.connector.config; import com.rbkmoney.damsel.payment_processing.InvoicingSrv; -import com.rbkmoney.fistful.withdrawal.ManagementSrv; +import dev.vality.fistful.withdrawal.ManagementSrv; import com.rbkmoney.woody.thrift.impl.http.THSpawnClientBuilder; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; @@ -33,21 +33,21 @@ public class HgConfig { } @Bean - public com.rbkmoney.fistful.destination.ManagementSrv.Iface destinationClient( + public dev.vality.fistful.destination.ManagementSrv.Iface destinationClient( @Value("${service.destination.url}") Resource resource, @Value("${service.destination.networkTimeout}") int networkTimeout) throws IOException { return new THSpawnClientBuilder() .withNetworkTimeout(networkTimeout) - .withAddress(resource.getURI()).build(com.rbkmoney.fistful.destination.ManagementSrv.Iface.class); + .withAddress(resource.getURI()).build(dev.vality.fistful.destination.ManagementSrv.Iface.class); } @Bean - public com.rbkmoney.fistful.wallet.ManagementSrv.Iface walletClient( + public dev.vality.fistful.wallet.ManagementSrv.Iface walletClient( @Value("${service.wallet.url}") Resource resource, @Value("${service.wallet.networkTimeout}") int networkTimeout) throws IOException { return new THSpawnClientBuilder() .withNetworkTimeout(networkTimeout) - .withAddress(resource.getURI()).build(com.rbkmoney.fistful.wallet.ManagementSrv.Iface.class); + .withAddress(resource.getURI()).build(dev.vality.fistful.wallet.ManagementSrv.Iface.class); } } diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulAccountToDomainAccountConverter.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulAccountToDomainAccountConverter.java index 0007db5..ac13217 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulAccountToDomainAccountConverter.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulAccountToDomainAccountConverter.java @@ -10,12 +10,12 @@ import org.springframework.stereotype.Component; @Component @RequiredArgsConstructor public class FistfulAccountToDomainAccountConverter - implements Converter { + implements Converter { private final FistfulCurrencyToDomainCurrencyConverter convertCurrency; @Override - public Account convert(com.rbkmoney.fistful.account.Account fistfulAccount) { + public Account convert(dev.vality.fistful.account.Account fistfulAccount) { log.debug("Start convert fistfulAccount : {}", fistfulAccount); final Account account = new Account(); account.setCurrency(convertCurrency.convert(fistfulAccount.getCurrency())); diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulCashToDomainCashConverter.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulCashToDomainCashConverter.java index d3b0af9..3f45cea 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulCashToDomainCashConverter.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulCashToDomainCashConverter.java @@ -9,13 +9,13 @@ import org.springframework.stereotype.Component; @Slf4j @Component @RequiredArgsConstructor -public class FistfulCashToDomainCashConverter implements Converter { +public class FistfulCashToDomainCashConverter implements Converter { private final FistfulCurrencyToDomainCurrencyConverter convertCurrency; @Override - public Cash convert(com.rbkmoney.fistful.base.Cash cash) { - final com.rbkmoney.fistful.base.CurrencyRef currency = cash.getCurrency(); + public Cash convert(dev.vality.fistful.base.Cash cash) { + final dev.vality.fistful.base.CurrencyRef currency = cash.getCurrency(); return new Cash() .setAmount(cash.getAmount()) .setCurrency(convertCurrency.convert(currency)); diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulCurrencyToDomainCurrencyConverter.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulCurrencyToDomainCurrencyConverter.java index b3a7793..64ea2ff 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulCurrencyToDomainCurrencyConverter.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulCurrencyToDomainCurrencyConverter.java @@ -8,10 +8,10 @@ import org.springframework.stereotype.Component; @Slf4j @Component public class FistfulCurrencyToDomainCurrencyConverter - implements Converter { + implements Converter { @Override - public CurrencyRef convert(com.rbkmoney.fistful.base.CurrencyRef currency) { + public CurrencyRef convert(dev.vality.fistful.base.CurrencyRef currency) { return new CurrencyRef() .setSymbolicCode(currency.getSymbolicCode()); } diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulResourceToDomainResourceConverter.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulResourceToDomainResourceConverter.java index 2eb2457..5428763 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulResourceToDomainResourceConverter.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulResourceToDomainResourceConverter.java @@ -16,14 +16,14 @@ import org.springframework.stereotype.Component; @Slf4j @Component public class FistfulResourceToDomainResourceConverter - implements Converter { + implements Converter { public static final PaymentSystemRef DEFAULT_PAYMENT_SYSTEM = new PaymentSystemRef(LegacyBankCardPaymentSystem.visa.name()); public static final String UNKNOWN = "UNKNOWN"; @Override - public Resource convert(com.rbkmoney.fistful.base.Resource fistfulResource) { + public Resource convert(dev.vality.fistful.base.Resource fistfulResource) { log.debug("Start convert fistfulResource : {}", fistfulResource); Resource resource = new Resource(); if (fistfulResource.isSetBankCard()) { @@ -37,9 +37,9 @@ public class FistfulResourceToDomainResourceConverter } else if (fistfulResource.isSetDigitalWallet()) { DigitalWallet digitalWallet = new DigitalWallet() .setId(fistfulResource.getDigitalWallet().getDigitalWallet().getId()); - if (fistfulResource.getDigitalWallet().getDigitalWallet().getData() != null) { + if (fistfulResource.getDigitalWallet().getDigitalWallet().getPaymentService() != null) { digitalWallet.setDigitalDataProvider(fistfulResource.getDigitalWallet() - .getDigitalWallet().getData().getSetField().getFieldName()); + .getDigitalWallet().getPaymentService().getId()); } resource.setDigitalWallet(digitalWallet); } else { @@ -50,14 +50,14 @@ public class FistfulResourceToDomainResourceConverter return resource; } - private BankCard convertBankCard(com.rbkmoney.fistful.base.BankCard bankCardFrom) { + private BankCard convertBankCard(dev.vality.fistful.base.BankCard bankCardFrom) { BankCard bankCard = new BankCard(); bankCard.setToken(bankCardFrom.getToken()); bankCard.setIssuerCountry(bankCardFrom.isSetIssuerCountry() ? CountryCode.valueOf(bankCardFrom.getIssuerCountry().name()) : null); bankCard.setPaymentSystem(bankCardFrom.isSetPaymentSystem() - ? new PaymentSystemRef(PaymentSystemUtil.getFistfulPaymentSystemName(bankCardFrom)) + ? new PaymentSystemRef(bankCardFrom.getPaymentSystem().getId()) : DEFAULT_PAYMENT_SYSTEM); bankCard.setLastDigits(bankCardFrom.getMaskedPan() != null ? bankCardFrom.getMaskedPan() diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/WithdrawalConverterImpl.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/WithdrawalConverterImpl.java index 2438b8c..37e0ca6 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/WithdrawalConverterImpl.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/converter/WithdrawalConverterImpl.java @@ -1,6 +1,6 @@ package com.rbkmoney.fraudbusters.mg.connector.converter; -import com.rbkmoney.fistful.withdrawal.TimestampedChange; +import dev.vality.fistful.withdrawal.TimestampedChange; import lombok.extern.slf4j.Slf4j; import org.apache.thrift.TDeserializer; import org.apache.thrift.TException; diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/factory/FistfulEventRangeFactory.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/factory/FistfulEventRangeFactory.java index 065234b..76e1d54 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/factory/FistfulEventRangeFactory.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/factory/FistfulEventRangeFactory.java @@ -1,7 +1,7 @@ package com.rbkmoney.fraudbusters.mg.connector.factory; -import com.rbkmoney.fistful.base.EventRange; +import dev.vality.fistful.base.EventRange; import org.springframework.stereotype.Service; @Service diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/factory/MgEventSinkWithdrawalToFraudStreamFactory.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/factory/MgEventSinkWithdrawalToFraudStreamFactory.java index ce466d2..9bf3534 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/factory/MgEventSinkWithdrawalToFraudStreamFactory.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/factory/MgEventSinkWithdrawalToFraudStreamFactory.java @@ -1,7 +1,7 @@ package com.rbkmoney.fraudbusters.mg.connector.factory; import com.rbkmoney.damsel.fraudbusters.Withdrawal; -import com.rbkmoney.fistful.withdrawal.TimestampedChange; +import dev.vality.fistful.withdrawal.TimestampedChange; import com.rbkmoney.fraudbusters.mg.connector.constant.StreamType; import com.rbkmoney.fraudbusters.mg.connector.exception.StreamInitializationException; import com.rbkmoney.fraudbusters.mg.connector.mapper.Mapper; diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/LogWithdrawalMapperDecorator.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/LogWithdrawalMapperDecorator.java index 5cf1c13..3bae32e 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/LogWithdrawalMapperDecorator.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/LogWithdrawalMapperDecorator.java @@ -1,7 +1,7 @@ package com.rbkmoney.fraudbusters.mg.connector.mapper.impl; import com.rbkmoney.damsel.fraudbusters.Withdrawal; -import com.rbkmoney.fistful.withdrawal.TimestampedChange; +import dev.vality.fistful.withdrawal.TimestampedChange; import com.rbkmoney.fraudbusters.mg.connector.constant.WithdrawalEventType; import com.rbkmoney.fraudbusters.mg.connector.mapper.Mapper; import com.rbkmoney.machinegun.eventsink.MachineEvent; diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalMapper.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalMapper.java index 854feb9..3af9983 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalMapper.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalMapper.java @@ -3,10 +3,10 @@ package com.rbkmoney.fraudbusters.mg.connector.mapper.impl; import com.rbkmoney.damsel.fraudbusters.Resource; import com.rbkmoney.damsel.fraudbusters.Withdrawal; import com.rbkmoney.damsel.fraudbusters.WithdrawalStatus; -import com.rbkmoney.fistful.destination.DestinationState; -import com.rbkmoney.fistful.wallet.WalletState; -import com.rbkmoney.fistful.withdrawal.TimestampedChange; -import com.rbkmoney.fistful.withdrawal.WithdrawalState; +import dev.vality.fistful.destination.DestinationState; +import dev.vality.fistful.wallet.WalletState; +import dev.vality.fistful.withdrawal.TimestampedChange; +import dev.vality.fistful.withdrawal.WithdrawalState; import com.rbkmoney.fraudbusters.mg.connector.constant.WithdrawalEventType; import com.rbkmoney.fraudbusters.mg.connector.converter.FistfulAccountToDomainAccountConverter; import com.rbkmoney.fraudbusters.mg.connector.converter.FistfulCashToDomainCashConverter; diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/parser/WithdrawalEventParser.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/parser/WithdrawalEventParser.java index c100f51..13e0b74 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/parser/WithdrawalEventParser.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/parser/WithdrawalEventParser.java @@ -1,6 +1,6 @@ package com.rbkmoney.fraudbusters.mg.connector.parser; -import com.rbkmoney.fistful.withdrawal.TimestampedChange; +import dev.vality.fistful.withdrawal.TimestampedChange; import com.rbkmoney.fraudbusters.mg.connector.converter.BinaryConverter; import com.rbkmoney.machinegun.eventsink.MachineEvent; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/DestinationClientService.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/DestinationClientService.java index a208bbb..a0847c1 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/DestinationClientService.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/DestinationClientService.java @@ -1,9 +1,9 @@ package com.rbkmoney.fraudbusters.mg.connector.service; -import com.rbkmoney.fistful.base.EventRange; -import com.rbkmoney.fistful.destination.DestinationState; -import com.rbkmoney.fistful.destination.ManagementSrv; +import dev.vality.fistful.base.EventRange; +import dev.vality.fistful.destination.DestinationState; +import dev.vality.fistful.destination.ManagementSrv; import com.rbkmoney.fraudbusters.mg.connector.exception.PaymentInfoNotFoundException; import com.rbkmoney.fraudbusters.mg.connector.exception.PaymentInfoRequestException; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/WalletClientService.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/WalletClientService.java index 4701ec8..cd3ab80 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/WalletClientService.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/WalletClientService.java @@ -1,9 +1,9 @@ package com.rbkmoney.fraudbusters.mg.connector.service; -import com.rbkmoney.fistful.base.EventRange; -import com.rbkmoney.fistful.wallet.ManagementSrv; -import com.rbkmoney.fistful.wallet.WalletState; +import dev.vality.fistful.base.EventRange; +import dev.vality.fistful.wallet.ManagementSrv; +import dev.vality.fistful.wallet.WalletState; import com.rbkmoney.fraudbusters.mg.connector.exception.PaymentInfoNotFoundException; import com.rbkmoney.fraudbusters.mg.connector.exception.PaymentInfoRequestException; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/WithdrawalClientService.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/WithdrawalClientService.java index a71aa10..4baafc0 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/WithdrawalClientService.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/service/WithdrawalClientService.java @@ -1,8 +1,8 @@ package com.rbkmoney.fraudbusters.mg.connector.service; -import com.rbkmoney.fistful.withdrawal.ManagementSrv; -import com.rbkmoney.fistful.withdrawal.WithdrawalState; +import dev.vality.fistful.withdrawal.ManagementSrv; +import dev.vality.fistful.withdrawal.WithdrawalState; import com.rbkmoney.fraudbusters.mg.connector.exception.PaymentInfoNotFoundException; import com.rbkmoney.fraudbusters.mg.connector.exception.PaymentInfoRequestException; import com.rbkmoney.fraudbusters.mg.connector.factory.FistfulEventRangeFactory; diff --git a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/utils/WithdrawalModelUtil.java b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/utils/WithdrawalModelUtil.java index 22721de..a777c89 100644 --- a/src/main/java/com/rbkmoney/fraudbusters/mg/connector/utils/WithdrawalModelUtil.java +++ b/src/main/java/com/rbkmoney/fraudbusters/mg/connector/utils/WithdrawalModelUtil.java @@ -2,11 +2,11 @@ package com.rbkmoney.fraudbusters.mg.connector.utils; import com.rbkmoney.damsel.fraudbusters.Error; import com.rbkmoney.damsel.fraudbusters.ProviderInfo; -import com.rbkmoney.fistful.base.Failure; -import com.rbkmoney.fistful.destination.DestinationState; -import com.rbkmoney.fistful.withdrawal.StatusChange; -import com.rbkmoney.fistful.withdrawal.WithdrawalState; -import com.rbkmoney.fistful.withdrawal.status.Failed; +import dev.vality.fistful.base.Failure; +import dev.vality.fistful.destination.DestinationState; +import dev.vality.fistful.withdrawal.StatusChange; +import dev.vality.fistful.withdrawal.WithdrawalState; +import dev.vality.fistful.withdrawal.status.Failed; import com.rbkmoney.geck.serializer.kit.tbase.TBaseProcessor; import com.rbkmoney.geck.serializer.kit.tbase.TDomainToStringErrorHandler; import lombok.extern.slf4j.Slf4j; @@ -38,7 +38,7 @@ public class WithdrawalModelUtil { error = new Error(); final Failed failed = statusChange.getStatus().getFailed(); if (failed.isSetFailure()) { - final com.rbkmoney.fistful.base.Failure failure = failed.getFailure(); + final dev.vality.fistful.base.Failure failure = failed.getFailure(); error.setErrorCode(parseError(failure)) .setErrorReason(failure.getReason()); diff --git a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/FraudbustersMgConnectorApplicationTest.java b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/FraudbustersMgConnectorApplicationTest.java index 96bc218..58b0d3e 100644 --- a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/FraudbustersMgConnectorApplicationTest.java +++ b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/FraudbustersMgConnectorApplicationTest.java @@ -4,8 +4,8 @@ import com.rbkmoney.damsel.domain.*; import com.rbkmoney.damsel.fraudbusters.Payment; import com.rbkmoney.damsel.payment_processing.Invoice; import com.rbkmoney.damsel.payment_processing.InvoicingSrv; -import com.rbkmoney.fistful.withdrawal.ManagementSrv; -import com.rbkmoney.fistful.withdrawal.WithdrawalState; +import dev.vality.fistful.withdrawal.ManagementSrv; +import dev.vality.fistful.withdrawal.WithdrawalState; import com.rbkmoney.fraudbusters.mg.connector.factory.EventRangeFactory; import com.rbkmoney.fraudbusters.mg.connector.mapper.impl.WithdrawalBeanUtils; import com.rbkmoney.fraudbusters.mg.connector.serde.deserializer.ChargebackDeserializer; @@ -58,9 +58,9 @@ public class FraudbustersMgConnectorApplicationTest extends KafkaAbstractTest { @MockBean ManagementSrv.Iface fistfulClient; @MockBean - com.rbkmoney.fistful.destination.ManagementSrv.Iface destinationClient; + dev.vality.fistful.destination.ManagementSrv.Iface destinationClient; @MockBean - com.rbkmoney.fistful.wallet.ManagementSrv.Iface walletClient; + dev.vality.fistful.wallet.ManagementSrv.Iface walletClient; @Autowired private EventRangeFactory eventRangeFactory; diff --git a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulResourceToDomainResourceConverterTest.java b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulResourceToDomainResourceConverterTest.java index c8c6cc9..e42a5a6 100644 --- a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulResourceToDomainResourceConverterTest.java +++ b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/converter/FistfulResourceToDomainResourceConverterTest.java @@ -1,9 +1,9 @@ package com.rbkmoney.fraudbusters.mg.connector.converter; import com.rbkmoney.damsel.fraudbusters.Resource; -import com.rbkmoney.fistful.base.ResourceBankCard; -import com.rbkmoney.fistful.base.ResourceCryptoWallet; -import com.rbkmoney.fistful.base.ResourceDigitalWallet; +import dev.vality.fistful.base.ResourceBankCard; +import dev.vality.fistful.base.ResourceCryptoWallet; +import dev.vality.fistful.base.ResourceDigitalWallet; import com.rbkmoney.fraudbusters.mg.connector.exception.UnknownResourceException; import com.rbkmoney.fraudbusters.mg.connector.utils.BuildUtils; import lombok.extern.slf4j.Slf4j; @@ -26,7 +26,7 @@ class FistfulResourceToDomainResourceConverterTest { void convertResourceBankCardTest() { ResourceBankCard resourceBankCard = new ResourceBankCard(); resourceBankCard.setBankCard(BuildUtils.buildFistfulBankCard()); - com.rbkmoney.fistful.base.Resource baseResource = new com.rbkmoney.fistful.base.Resource(); + dev.vality.fistful.base.Resource baseResource = new dev.vality.fistful.base.Resource(); baseResource.setBankCard(resourceBankCard); Resource resource = converter.convert(baseResource); @@ -38,7 +38,7 @@ class FistfulResourceToDomainResourceConverterTest { void convertResourceCryptoWalletTest() { ResourceCryptoWallet resourceCryptoWallet = new ResourceCryptoWallet(); resourceCryptoWallet.setCryptoWallet(BuildUtils.buildFistfulCryptoWallet()); - com.rbkmoney.fistful.base.Resource baseResource = new com.rbkmoney.fistful.base.Resource(); + dev.vality.fistful.base.Resource baseResource = new dev.vality.fistful.base.Resource(); baseResource.setCryptoWallet(resourceCryptoWallet); Resource resource = converter.convert(baseResource); @@ -50,7 +50,7 @@ class FistfulResourceToDomainResourceConverterTest { void convertResourceDigitalWalletTest() { ResourceDigitalWallet resourceDigitalWallet = new ResourceDigitalWallet(); resourceDigitalWallet.setDigitalWallet(BuildUtils.buildFistfulDigitalWallet()); - com.rbkmoney.fistful.base.Resource baseResource = new com.rbkmoney.fistful.base.Resource(); + dev.vality.fistful.base.Resource baseResource = new dev.vality.fistful.base.Resource(); baseResource.setDigitalWallet(resourceDigitalWallet); Resource resource = converter.convert(baseResource); @@ -61,7 +61,7 @@ class FistfulResourceToDomainResourceConverterTest { @Test void convertUnknownResourceExceptionTest() { assertThrows(UnknownResourceException.class, () -> { - converter.convert(new com.rbkmoney.fistful.base.Resource()); + converter.convert(new dev.vality.fistful.base.Resource()); }); } diff --git a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalBeanUtils.java b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalBeanUtils.java index 4c26757..6e31139 100644 --- a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalBeanUtils.java +++ b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalBeanUtils.java @@ -1,13 +1,13 @@ package com.rbkmoney.fraudbusters.mg.connector.mapper.impl; -import com.rbkmoney.fistful.account.Account; -import com.rbkmoney.fistful.base.*; -import com.rbkmoney.fistful.destination.DestinationState; -import com.rbkmoney.fistful.wallet.WalletState; -import com.rbkmoney.fistful.withdrawal.Change; -import com.rbkmoney.fistful.withdrawal.StatusChange; -import com.rbkmoney.fistful.withdrawal.TimestampedChange; -import com.rbkmoney.fistful.withdrawal.status.Status; +import dev.vality.fistful.account.Account; +import dev.vality.fistful.base.*; +import dev.vality.fistful.destination.DestinationState; +import dev.vality.fistful.wallet.WalletState; +import dev.vality.fistful.withdrawal.Change; +import dev.vality.fistful.withdrawal.StatusChange; +import dev.vality.fistful.withdrawal.TimestampedChange; +import dev.vality.fistful.withdrawal.status.Status; import com.rbkmoney.fraudbusters.mg.connector.utils.InvoiceTestConstant; public class WithdrawalBeanUtils { diff --git a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalMapperTest.java b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalMapperTest.java index 9850820..f171e1e 100644 --- a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalMapperTest.java +++ b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/mapper/impl/WithdrawalMapperTest.java @@ -2,11 +2,11 @@ package com.rbkmoney.fraudbusters.mg.connector.mapper.impl; import com.rbkmoney.damsel.fraudbusters.Withdrawal; import com.rbkmoney.damsel.fraudbusters.WithdrawalStatus; -import com.rbkmoney.fistful.withdrawal.TimestampedChange; -import com.rbkmoney.fistful.withdrawal.WithdrawalState; -import com.rbkmoney.fistful.withdrawal.status.Failed; -import com.rbkmoney.fistful.withdrawal.status.Pending; -import com.rbkmoney.fistful.withdrawal.status.Status; +import dev.vality.fistful.withdrawal.TimestampedChange; +import dev.vality.fistful.withdrawal.WithdrawalState; +import dev.vality.fistful.withdrawal.status.Failed; +import dev.vality.fistful.withdrawal.status.Pending; +import dev.vality.fistful.withdrawal.status.Status; import com.rbkmoney.fraudbusters.mg.connector.converter.FistfulAccountToDomainAccountConverter; import com.rbkmoney.fraudbusters.mg.connector.converter.FistfulCashToDomainCashConverter; import com.rbkmoney.fraudbusters.mg.connector.converter.FistfulCurrencyToDomainCurrencyConverter; diff --git a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/BuildUtils.java b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/BuildUtils.java index 0850231..8a4ec8d 100644 --- a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/BuildUtils.java +++ b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/BuildUtils.java @@ -5,10 +5,8 @@ import com.rbkmoney.damsel.domain.*; import com.rbkmoney.damsel.payment_processing.InvoicePayment; import com.rbkmoney.damsel.payment_processing.InvoicePaymentChargeback; import com.rbkmoney.damsel.payment_processing.InvoiceRefundSession; -import com.rbkmoney.fistful.base.CardType; -import com.rbkmoney.fistful.base.DigitalData; -import com.rbkmoney.fistful.base.DigitalDataWebmoney; -import com.rbkmoney.fistful.base.Residence; +import dev.vality.fistful.base.CardType; +import dev.vality.fistful.base.Residence; import com.rbkmoney.geck.common.util.TypeUtil; import com.rbkmoney.geck.serializer.kit.mock.MockMode; import com.rbkmoney.geck.serializer.kit.mock.MockTBaseProcessor; @@ -26,31 +24,31 @@ import static com.rbkmoney.fraudbusters.mg.connector.utils.MgEventSinkFlowGenera public class BuildUtils { - public static com.rbkmoney.fistful.base.BankCard buildFistfulBankCard() { - return new com.rbkmoney.fistful.base.BankCard() + public static dev.vality.fistful.base.BankCard buildFistfulBankCard() { + return new dev.vality.fistful.base.BankCard() .setBankName(InvoiceTestConstant.BANK_NAME) .setBin(InvoiceTestConstant.CARD_BIN) .setCategory(InvoiceTestConstant.CARD_CATEGORY) .setIssuerCountry(Residence.PAN) - .setPaymentSystem(new com.rbkmoney.fistful.base.PaymentSystemRef( - com.rbkmoney.fistful.base.LegacyBankCardPaymentSystem.mastercard.name())) + .setPaymentSystem(new dev.vality.fistful.base.PaymentSystemRef( + dev.vality.fistful.base.LegacyBankCardPaymentSystem.mastercard.name())) .setToken(InvoiceTestConstant.CARD_TOKEN_PROVIDER) .setMaskedPan(InvoiceTestConstant.CARD_MASKED_PAN) .setCardType(CardType.debit) .setCardholderName(InvoiceTestConstant.CARDHOLDER_NAME); } - public static com.rbkmoney.fistful.base.CryptoWallet buildFistfulCryptoWallet() { - com.rbkmoney.fistful.base.CryptoWallet cryptoWallet = new com.rbkmoney.fistful.base.CryptoWallet(); + public static dev.vality.fistful.base.CryptoWallet buildFistfulCryptoWallet() { + dev.vality.fistful.base.CryptoWallet cryptoWallet = new dev.vality.fistful.base.CryptoWallet(); cryptoWallet.setId("id"); - cryptoWallet.setCurrency(com.rbkmoney.fistful.base.CryptoCurrency.bitcoin); + cryptoWallet.setCurrency(dev.vality.fistful.base.CryptoCurrency.bitcoin); return cryptoWallet; } - public static com.rbkmoney.fistful.base.DigitalWallet buildFistfulDigitalWallet() { - com.rbkmoney.fistful.base.DigitalWallet digitalWallet = new com.rbkmoney.fistful.base.DigitalWallet(); + public static dev.vality.fistful.base.DigitalWallet buildFistfulDigitalWallet() { + dev.vality.fistful.base.DigitalWallet digitalWallet = new dev.vality.fistful.base.DigitalWallet(); digitalWallet.setId("id"); - digitalWallet.setData(DigitalData.webmoney(new DigitalDataWebmoney())); + digitalWallet.setPaymentService(new dev.vality.fistful.base.PaymentServiceRef("webmoney")); return digitalWallet; } diff --git a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/InvoiceTestConstant.java b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/InvoiceTestConstant.java index 226a538..3251c55 100644 --- a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/InvoiceTestConstant.java +++ b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/InvoiceTestConstant.java @@ -1,8 +1,8 @@ package com.rbkmoney.fraudbusters.mg.connector.utils; -import com.rbkmoney.fistful.base.CardType; -import com.rbkmoney.fistful.base.LegacyBankCardPaymentSystem; -import com.rbkmoney.fistful.base.Residence; +import dev.vality.fistful.base.CardType; +import dev.vality.fistful.base.LegacyBankCardPaymentSystem; +import dev.vality.fistful.base.Residence; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/WithdrawalFlowGenerator.java b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/WithdrawalFlowGenerator.java index 59f92b4..981a7c5 100644 --- a/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/WithdrawalFlowGenerator.java +++ b/src/test/java/com/rbkmoney/fraudbusters/mg/connector/utils/WithdrawalFlowGenerator.java @@ -1,13 +1,13 @@ package com.rbkmoney.fraudbusters.mg.connector.utils; -import com.rbkmoney.fistful.base.Failure; -import com.rbkmoney.fistful.withdrawal.Change; -import com.rbkmoney.fistful.withdrawal.StatusChange; -import com.rbkmoney.fistful.withdrawal.TimestampedChange; -import com.rbkmoney.fistful.withdrawal.status.Failed; -import com.rbkmoney.fistful.withdrawal.status.Pending; -import com.rbkmoney.fistful.withdrawal.status.Status; -import com.rbkmoney.fistful.withdrawal.status.Succeeded; +import dev.vality.fistful.base.Failure; +import dev.vality.fistful.withdrawal.Change; +import dev.vality.fistful.withdrawal.StatusChange; +import dev.vality.fistful.withdrawal.TimestampedChange; +import dev.vality.fistful.withdrawal.status.Failed; +import dev.vality.fistful.withdrawal.status.Pending; +import dev.vality.fistful.withdrawal.status.Status; +import dev.vality.fistful.withdrawal.status.Succeeded; import com.rbkmoney.geck.common.util.TypeUtil; import com.rbkmoney.kafka.common.serialization.ThriftSerializer; import com.rbkmoney.machinegun.eventsink.MachineEvent;