Search in sources :

Example 1 with MiraklInvoice

use of com.mirakl.client.mmp.domain.invoice.MiraklInvoice in project mirakl-hyperwallet-connector by paypal.

the class MiraklInvoiceToCreditNoteModelConverterTest method convert_shouldConvertFromMiraklInvoiceToCreditNoteModel.

@Test
void convert_shouldConvertFromMiraklInvoiceToCreditNoteModel() {
    final MiraklInvoice miraklInvoiceStub = new MiraklInvoice();
    miraklInvoiceStub.setId("2000050");
    miraklInvoiceStub.setShopId(2000L);
    miraklInvoiceStub.setTotalChargedAmount(BigDecimal.valueOf(20.00D));
    miraklInvoiceStub.setCurrencyIsoCode(MiraklIsoCurrencyCode.EUR);
    final CreditNoteModel result = testObj.convert(miraklInvoiceStub);
    assertThat(result.getInvoiceNumber()).isEqualTo("2000050");
    assertThat(result.getShopId()).isEqualTo("2000");
    assertThat(result.getCreditAmount()).isEqualTo(20.00D);
    assertThat(result.getCurrencyIsoCode()).isEqualTo("EUR");
}
Also used : MiraklInvoice(com.mirakl.client.mmp.domain.invoice.MiraklInvoice) CreditNoteModel(com.paypal.invoices.invoicesextract.model.CreditNoteModel) Test(org.junit.jupiter.api.Test)

Aggregations

MiraklInvoice (com.mirakl.client.mmp.domain.invoice.MiraklInvoice)1 CreditNoteModel (com.paypal.invoices.invoicesextract.model.CreditNoteModel)1 Test (org.junit.jupiter.api.Test)1