diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/JurisdictionUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/JurisdictionUtilities.java index 3c4529739..862312517 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/JurisdictionUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/terminologies/JurisdictionUtilities.java @@ -57,7 +57,7 @@ public class JurisdictionUtilities { } public static String displayJurisdiction(String s) { - return displayJurisdiction(CodeSystemUtilities.readCoding(getJurisdictionFromLocale(s))); + return displayJurisdiction(CodeSystemUtilities.readCoding(s)); } public static String displayJurisdiction(Coding c) { diff --git a/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/terminology/JurisdictionUtilitiesTests.java b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/terminology/JurisdictionUtilitiesTests.java new file mode 100644 index 000000000..ba56053ec --- /dev/null +++ b/org.hl7.fhir.r5/src/test/java/org/hl7/fhir/r5/terminology/JurisdictionUtilitiesTests.java @@ -0,0 +1,24 @@ +package org.hl7.fhir.r5.terminology; + +import org.hl7.fhir.r5.terminologies.JurisdictionUtilities; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class JurisdictionUtilitiesTests { + + @ParameterizedTest + @CsvSource({ + "uv,Global (Whole world)", + "world,Global (Whole world)", + "global,Global (Whole world)", + "ar,Argentina", + "bf,Burkina Faso" + }) + void testDisplayJurisdiction(String cliString, String expectedDisplayString) { + final String jurisdiction = JurisdictionUtilities.getJurisdictionFromLocale(cliString); + + assertEquals(expectedDisplayString, JurisdictionUtilities.displayJurisdiction(jurisdiction)); + } +}