Skip to content

Commit

Permalink
Merge pull request #63 from digipost/inkasso_complement_by
Browse files Browse the repository at this point in the history
Inkasso skal også kunne komplementeres av InvoicePayment
  • Loading branch information
eivinhb authored Oct 21, 2020
2 parents 7ceb76e + 85fbd0b commit c010481
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>

<artifactId>digipost-data-types</artifactId>
<version>0.28-SNAPSHOT</version>
<version>LOCAL-SNAPSHOT</version>
<name>Digipost Data Types</name>
<description>Data types for Digipost messages</description>

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/no/digipost/api/datatypes/types/Inkasso.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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")
Expand Down
9 changes: 9 additions & 0 deletions src/test/java/no/digipost/api/datatypes/ComplementByTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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)));
}
}

0 comments on commit c010481

Please sign in to comment.