Skip to content

Commit

Permalink
Use a list for dinaComponents
Browse files Browse the repository at this point in the history
  • Loading branch information
cgendreau committed Dec 23, 2024
1 parent 4df40d8 commit fda0d33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import ca.gc.aafc.dina.i18n.MultilingualTitle;
import ca.gc.aafc.dina.vocabulary.VocabularyElement;

import java.util.List;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
Expand All @@ -27,7 +28,7 @@ public abstract class IdentifierType implements VocabularyElement, DinaEntity {
/**
* The component (material-sample, project) where this identifier type is expected to be used.
*/
private String dinaComponent;
private List<String> dinaComponents;

/**
* Like wikidata. A URI template where "$1" can be automatically replaced with the value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.time.OffsetDateTime;
import java.util.List;
import java.util.UUID;
import javax.inject.Inject;
import javax.inject.Named;
Expand All @@ -44,6 +45,7 @@ public void identifierTypeService_OnCreate_KeyCorrectlyGenerated() {
.id(11)
.uuid(UUID.randomUUID())
.uriTemplate("https://abc.abc/$1")
.dinaComponents(List.of("project", "person"))
.name("dina specialIdentifier #11").build());

assertEquals("dina_special_identifier_11", identifierType.getKey());
Expand Down

0 comments on commit fda0d33

Please sign in to comment.