From 19f307101d8f5dfca2494a89abdc9d8ce647e3ed Mon Sep 17 00:00:00 2001 From: amihaiemil Date: Tue, 9 Mar 2021 11:28:06 +0200 Subject: [PATCH] #1045 missing unit test --- .../invoices/StoredInvoiceTestCase.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/self-core-impl/src/test/java/com/selfxdsd/core/contracts/invoices/StoredInvoiceTestCase.java b/self-core-impl/src/test/java/com/selfxdsd/core/contracts/invoices/StoredInvoiceTestCase.java index 6b614318..83061874 100644 --- a/self-core-impl/src/test/java/com/selfxdsd/core/contracts/invoices/StoredInvoiceTestCase.java +++ b/self-core-impl/src/test/java/com/selfxdsd/core/contracts/invoices/StoredInvoiceTestCase.java @@ -53,6 +53,28 @@ public void hasCorrectId() { assertThat(invoice.invoiceId(), is(1)); } + /** + * Invoice has the latest Payment. + */ + @Test + public void hasLatestPayment() { + final Payment latest = Mockito.mock(Payment.class); + final Invoice invoice = new StoredInvoice( + 1, + Mockito.mock(Contract.class), + LocalDateTime.now(), + latest, + "mihai", + "vlad", + "RO", + "RO", + BigDecimal.valueOf(487), + Mockito.mock(Storage.class) + ); + assertThat(invoice.latest(), is(latest)); + } + + /** * Invoice has the correct contract id. */