use of de.metas.banking.PaySelectionId in project metasfresh-webui-api by metasfresh.
the class ReconcilePaymentsCommandTest method bankStatementLineIsLinkedToPaySelection.
@Test
public void bankStatementLineIsLinkedToPaySelection() {
final BankStatementLineRow bankStatementLineRow = bankStatementLineRow().docStatus(DocStatus.Drafted).statementAmt(euro("1000")).build();
final PaymentToReconcileRow paymentRow = paymentRow().inboundPayment(true).customerId(customerId).paymentAmt(euro("1000")).build();
final PaymentId paymentId = paymentRow.getPaymentId();
final PaySelectionId paySelectionId = createPaySelection();
final I_C_PaySelectionLine paySelectionLine = createPaySelectionLine(paySelectionId, paymentId);
assertThat(paySelectionLine.getC_Payment_ID()).isEqualTo(paymentId.getRepoId());
assertThat(paySelectionLine.getC_BankStatement_ID()).isLessThanOrEqualTo(0);
assertThat(paySelectionLine.getC_BankStatementLine_ID()).isLessThanOrEqualTo(0);
assertThat(paySelectionLine.getC_BankStatementLine_Ref_ID()).isLessThanOrEqualTo(0);
assertReconciled(paySelectionId).isFalse();
executeReconcilePaymentsCommand(ReconcilePaymentsRequest.builder().selectedBankStatementLine(bankStatementLineRow).selectedPaymentToReconcile(paymentRow).build());
InterfaceWrapperHelper.refresh(paySelectionLine);
assertThat(paySelectionLine.getC_BankStatement_ID()).isGreaterThan(0);
assertThat(paySelectionLine.getC_BankStatementLine_ID()).isEqualTo(bankStatementLineRow.getBankStatementLineId().getRepoId());
assertThat(paySelectionLine.getC_BankStatementLine_Ref_ID()).isGreaterThan(0);
assertReconciled(paySelectionId).isTrue();
}
Aggregations