Merge pull request #10 from rbkmoney/ft/added_methods_intent_service

Bump error mapping
This commit is contained in:
Inal Arsanukaev 2019-06-26 21:27:56 +03:00 committed by GitHub
commit 53b683b9f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.rbkmoney</groupId> <groupId>com.rbkmoney</groupId>
<artifactId>adapter-bank-payout-spring-boot-starter</artifactId> <artifactId>adapter-bank-payout-spring-boot-starter</artifactId>
<version>0.0.8-SNAPSHOT</version> <version>0.0.9</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Adapter-bank-payout-spring-boot-starter</name> <name>Adapter-bank-payout-spring-boot-starter</name>
@ -18,7 +18,7 @@
<damsel-utils.version>2.1.9</damsel-utils.version> <damsel-utils.version>2.1.9</damsel-utils.version>
<damsel.version>1.303-d99319c</damsel.version> <damsel.version>1.303-d99319c</damsel.version>
<serializer.version>0.6.7</serializer.version> <serializer.version>0.6.7</serializer.version>
<error-mapping.version>1.0.2</error-mapping.version> <error-mapping.version>1.0.4</error-mapping.version>
</properties> </properties>
<dependencies> <dependencies>

View File

@ -5,7 +5,8 @@ import com.rbkmoney.adapter.bank.payout.spring.boot.starter.model.ExitStateModel
import com.rbkmoney.damsel.withdrawals.provider_adapter.Intent; import com.rbkmoney.damsel.withdrawals.provider_adapter.Intent;
public interface IntentService { public interface IntentService {
Intent getFailure(ExitStateModel exitStateModel); Intent getFailureByCode(ExitStateModel exitStateModel);
Intent getFailureByCodeAndDesc(ExitStateModel exitStateModel);
Intent getSuccess(ExitStateModel exitStateModel); Intent getSuccess(ExitStateModel exitStateModel);
Intent getSleep(ExitStateModel exitStateModel); Intent getSleep(ExitStateModel exitStateModel);
Long getMaxDateTimeInstant(EntryStateModel entryStateModel); Long getMaxDateTimeInstant(EntryStateModel entryStateModel);

View File

@ -22,8 +22,12 @@ public class IntentServiceImpl implements IntentService {
private final ErrorMapping errorMapping; private final ErrorMapping errorMapping;
private final TimerProperties timerProperties; private final TimerProperties timerProperties;
public Intent getFailure(ExitStateModel exitStateModel) { public Intent getFailureByCode(ExitStateModel exitStateModel) {
return Intent.finish(new FinishIntent(FinishStatus.failure(errorMapping.getFailureByCodeAndDescription(exitStateModel.getErrorCode(), exitStateModel.getErrorMessage())))); return Intent.finish(new FinishIntent(FinishStatus.failure(errorMapping.mapFailure(exitStateModel.getErrorCode()))));
}
public Intent getFailureByCodeAndDesc(ExitStateModel exitStateModel) {
return Intent.finish(new FinishIntent(FinishStatus.failure(errorMapping.mapFailure(exitStateModel.getErrorCode(), exitStateModel.getErrorMessage()))));
} }
public Intent getSuccess(ExitStateModel exitStateModel) { public Intent getSuccess(ExitStateModel exitStateModel) {