From 85fbd0b3dd85e404b3eb29c169492f8255dba547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eivind=20Bergst=C3=B8l?= Date: Wed, 21 Oct 2020 12:30:19 +0200 Subject: [PATCH] =?UTF-8?q?Inkasso=20skal=20ogs=C3=A5=20kunne=20komplement?= =?UTF-8?q?eres=20av=20InvoicePayment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../java/no/digipost/api/datatypes/types/Inkasso.java | 3 +++ .../java/no/digipost/api/datatypes/ComplementByTest.java | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c942c046..51ec4713 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ digipost-data-types - 0.28-SNAPSHOT + LOCAL-SNAPSHOT Digipost Data Types Data types for Digipost messages diff --git a/src/main/java/no/digipost/api/datatypes/types/Inkasso.java b/src/main/java/no/digipost/api/datatypes/types/Inkasso.java index 241c0dd7..1bead773 100644 --- a/src/main/java/no/digipost/api/datatypes/types/Inkasso.java +++ b/src/main/java/no/digipost/api/datatypes/types/Inkasso.java @@ -5,8 +5,10 @@ import lombok.NoArgsConstructor; import lombok.Value; import lombok.With; +import no.digipost.api.datatypes.ComplementedBy; import no.digipost.api.datatypes.DataType; import no.digipost.api.datatypes.documentation.Description; +import no.digipost.api.datatypes.types.invoice.InvoicePayment; import javax.validation.constraints.Size; import javax.xml.bind.annotation.XmlElement; @@ -21,6 +23,7 @@ @NoArgsConstructor(force = true, access = AccessLevel.PRIVATE) @With @Description("A debt collection payment") +@ComplementedBy({InvoicePayment.class}) public class Inkasso implements DataType { @XmlElement @Description("A link to more information, or further actions that can be taken") diff --git a/src/test/java/no/digipost/api/datatypes/ComplementByTest.java b/src/test/java/no/digipost/api/datatypes/ComplementByTest.java index e70992f0..40180524 100644 --- a/src/test/java/no/digipost/api/datatypes/ComplementByTest.java +++ b/src/test/java/no/digipost/api/datatypes/ComplementByTest.java @@ -1,6 +1,9 @@ package no.digipost.api.datatypes; import no.digipost.api.datatypes.types.Appointment; +import no.digipost.api.datatypes.types.Inkasso; +import no.digipost.api.datatypes.types.invoice.Invoice; +import no.digipost.api.datatypes.types.invoice.InvoicePayment; import no.digipost.api.datatypes.types.pickup.PickupNotice; import no.digipost.api.datatypes.types.pickup.PickupNoticeStatus; import org.junit.jupiter.api.Test; @@ -32,4 +35,10 @@ void kan_IKKE_complementere_seg_selv_med_mindre_eksplisitt_definert() { assertThat(Appointment.EXAMPLE, whereNot(s -> s.getTypeIdentifier().canBeComplementedBy(Appointment.EXAMPLE))); assertThat(PickupNotice.EXAMPLE, where(s -> s.getTypeIdentifier().canBeComplementedBy(PickupNotice.EXAMPLE))); } + + @Test + void kan_komplementere_fakturadomene() { + assertThat(Invoice.EXAMPLE, where(s -> s.getTypeIdentifier().canBeComplementedBy(InvoicePayment.EXAMPLE))); + assertThat(Inkasso.EXAMPLE, where(s -> s.getTypeIdentifier().canBeComplementedBy(InvoicePayment.EXAMPLE))); + } }