Skip to content

Commit

Permalink
[DE-988] Fix failing invoice tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-nedza committed Sep 27, 2024
1 parent b569ea6 commit 875286b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ void shouldCreateInvoice() throws IOException, ApiException {
InvoiceSeller invoiceSeller = invoice.getSeller();
assertThat(invoiceSeller)
.usingRecursiveComparison()
.ignoringFields("address.additionalProperties")
.isEqualTo(INVOICE_SELLER);

InvoiceCustomer invoiceCustomer = invoice.getCustomer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ void shouldIssuePendingInvoice() throws IOException, ApiException {
InvoiceSeller invoiceSeller = issuedInvoice.getSeller();
assertThat(invoiceSeller)
.usingRecursiveComparison()
.ignoringFields("address.additionalProperties")
.isEqualTo(INVOICE_SELLER);

InvoiceCustomer invoiceCustomer = issuedInvoice.getCustomer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ void assertInvoiceInEvent(Invoice eventInvoice, Invoice invoice) {
.ignoringFields("createdAt", "creditAmount", "credits", "discounts", "displaySettings",
"dueAmount", "id", "lineItems", "netTerms", "paidAmount", "paidDate", "payer", "payments",
"previousBalanceData", "publicUrl", "recipientEmails", "refundAmount", "refunds",
"status", "transactionTime", "updatedAt", "publicUrlExpiresOn", "additionalProperties")
"status", "transactionTime", "updatedAt", "publicUrlExpiresOn", "additionalProperties",
"billingAddress.additionalProperties")
.isEqualTo(invoice);
assertThat(eventInvoice.getCreatedAt()).isNotNull();
assertThat(eventInvoice.getUpdatedAt()).isNotNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ void shouldListInvoicesUsingSubscriptionId() throws IOException, ApiException {

assertThat(invoice.getSeller())
.usingRecursiveComparison()
.ignoringFields("address.additionalProperties")
.isEqualTo(INVOICE_SELLER);

InvoiceCustomer invoiceCustomer = invoice.getCustomer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ void shouldReadCreditNotes() throws IOException, ApiException, InterruptedExcept
.usingRecursiveComparison()
.isEqualTo(new OriginInvoice(paidInvoice.getUid(), paidInvoice.getNumber()));
assertThat(creditNote.getMemo()).isEqualTo("Special refund");
assertThat(creditNote.getSeller()).usingRecursiveComparison().isEqualTo(INVOICE_SELLER);
assertThat(creditNote.getSeller()).usingRecursiveComparison()
.ignoringFields("address.additionalProperties").isEqualTo(INVOICE_SELLER);

InvoiceCustomer creditNoteCustomer = creditNote.getCustomer();
assertThat(creditNoteCustomer.getChargifyId()).isEqualTo(customer.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ void shouldReadInvoice() throws IOException, ApiException {

assertThat(invoice.getSeller())
.usingRecursiveComparison()
.ignoringFields("address.additionalProperties")
.isEqualTo(INVOICE_SELLER);

InvoiceCustomer invoiceCustomer = invoice.getCustomer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ void shouldRecordPaymentUsingExistingPaymentProfile() throws IOException, ApiExc

assertThat(invoice.getSeller())
.usingRecursiveComparison()
.ignoringFields("address.additionalProperties")
.isEqualTo(INVOICE_SELLER);

InvoiceCustomer invoiceCustomer = invoice.getCustomer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ void assertProformaInvoice(Customer customer,
);

InvoiceAddress invoiceShippingAddress = proformaInvoice.getShippingAddress();
assertThat(invoiceShippingAddress.getAdditionalProperties()).isEmpty();
assertAll(
() -> assertThat(invoiceShippingAddress).isNotNull(),
() -> assertThat(invoiceShippingAddress.getStreet()).isEqualTo(customer.getAddress()),
Expand Down Expand Up @@ -243,6 +242,7 @@ void assertProformaInvoice(Customer customer,
assertThat(invoiceSeller.getAdditionalProperties()).isEmpty();
assertThat(invoiceSeller)
.usingRecursiveComparison()
.ignoringFields("address.additionalProperties")
.isEqualTo(INVOICE_SELLER);
assertThat(proformaInvoice.getSiteId()).isNotNull();
assertThat(proformaInvoice.getStatus()).isEqualTo(DRAFT);
Expand Down

0 comments on commit 875286b

Please sign in to comment.