-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from epam/main
Fix TextFormat with multiple facets (#45) * fixes TextFormatImpl failing on init when multiple facets are present due to 'inconsistent value type'
- Loading branch information
Showing
2 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
sdmx30-infomodel/src/test/java/com/epam/jsdmx/infomodel/sdmx30/TextFormatImplTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.epam.jsdmx.infomodel.sdmx30; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
|
||
import java.util.Set; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class TextFormatImplTest { | ||
|
||
@Test | ||
void shouldNotFailOnMultipleFacets() { | ||
Facet f1 = new BaseFacetImpl(FacetValueType.STRING); | ||
var f2 = new BaseFacetImpl(); | ||
f2.setType(FacetType.IS_MULTILINGUAL); | ||
f2.setValue("true"); | ||
|
||
TextFormat value = assertDoesNotThrow(() -> new TextFormatImpl(Set.of(f1, f2))); | ||
|
||
assertThat(value.getValueType()).contains(FacetValueType.STRING); | ||
assertThat(value.getIsMultiLingual()).contains(true); | ||
} | ||
|
||
} |