Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
#175: fix PaidNotificationProcessorTest: exclude SetAmountPaid assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-kovalenko-ct committed Oct 19, 2017
1 parent b61d230 commit fb3a573
Showing 1 changed file with 6 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,11 @@ public void processingCompletedNotificationAboutUnknownTransactionAddsChargeTran
.build());

final AddInterfaceInteraction interfaceInteraction = getAddInterfaceInteraction(notification, timestamp);

assertThat(updateActions).as("# of payment update actions").hasSize(5);
assertThat(updateActions).as("added transaction")
.filteredOn(u -> u.getAction().equals("addTransaction"))
.usingElementComparatorOnFields(
"transaction.type", "transaction.amount", "transaction.state", "transaction.timestamp")
.containsOnlyOnce(transaction);

assertThat(updateActions).as("amount paid")
.filteredOn(u -> u.getAction().equals("setAmountPaid"))
.containsOnly(SetAmountPaid.of(MoneyImpl.of(notification.getPrice(), notification.getCurrency())));
final SetStatusInterfaceCode statusInterfaceCode = getSetStatusInterfaceCode(notification);
final SetStatusInterfaceText statusInterfaceText = getSetStatusInterfaceText(notification);

assertStandardUpdateActions(updateActions, interfaceInteraction, statusInterfaceCode, statusInterfaceText);
assertThat(updateActions).as("added transactions")
.containsExactlyInAnyOrder(transaction, interfaceInteraction, statusInterfaceCode, statusInterfaceText);

verifyUpdateOrderActions(payment, ORDER_PAYMENT_STATE);
}
Expand Down Expand Up @@ -145,16 +135,11 @@ private Payment processingCompletedNotificationForPendingChargeTransactionChange
final SetStatusInterfaceCode statusInterfaceCode = getSetStatusInterfaceCode(notification);
final SetStatusInterfaceText statusInterfaceText = getSetStatusInterfaceText(notification);

assertThat(updateActions).as("# of payment update actions").hasSize(5);
assertThat(updateActions).as("transaction state change")
.filteredOn(u -> u.getAction().equals("changeTransactionState"))
.containsOnly(ChangeTransactionState.of(TransactionState.SUCCESS, chargeTransaction.getId()));
assertThat(updateActions).as("payment update actions list")
.containsExactlyInAnyOrder(
ChangeTransactionState.of(TransactionState.SUCCESS, chargeTransaction.getId()),
interfaceInteraction, statusInterfaceCode, statusInterfaceText);

assertThat(updateActions).as("amount paid")
.filteredOn(u -> u.getAction().equals("setAmountPaid"))
.containsOnly(SetAmountPaid.of(MoneyImpl.of(notification.getPrice(), notification.getCurrency())));

assertStandardUpdateActions(updateActions, interfaceInteraction, statusInterfaceCode, statusInterfaceText);
return payment;
}

Expand Down

0 comments on commit fb3a573

Please sign in to comment.