Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public IdentifiableArtefactReferenceImpl clone() {

@Override
public String toString() {
return super.toString();
String superString = super.toString();
return superString + "." + itemId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.epam.jsdmx.infomodel.sdmx30;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

class IdentifiableArtefactReferenceImplTest {
@Test
void testToString_happy() {
var subject = new IdentifiableArtefactReferenceImpl("id", "organisation", "1.0.0", StructureClassImpl.CONCEPT, "itemId");

Assertions.assertThat(subject.toString()).isEqualTo("Concept=organisation:id(1.0.0).itemId");
}

@Test
void testToString_itemIdIsNull() {
var subject = new IdentifiableArtefactReferenceImpl("id", "organisation", "1.0.0", StructureClassImpl.CONCEPT, null);

Assertions.assertThat(subject.toString()).isEqualTo("Concept=organisation:id(1.0.0).null");
}
}