Merge remote-tracking branch 'origin/master'

This commit is contained in:
Grahame Grieve 2022-11-24 19:56:13 -03:00
commit 0f6b2ad297
3 changed files with 32 additions and 1 deletions

View File

@ -284,7 +284,7 @@ public class CliContext {
}
public CliContext setLocale(Locale locale) {
this.locale = locale.getDisplayLanguage();
this.locale = locale.getLanguage();
return this;
}

View File

@ -0,0 +1,17 @@
package org.hl7.fhir.validation.cli.model;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.util.Locale;
import static org.junit.Assert.assertEquals;
public class CliContextTests {
@Test
@DisplayName("test locale set and get")
public void testSetAndGetLocale() {
CliContext cliContext = new CliContext();
cliContext.setLocale(Locale.GERMAN);
assertEquals(Locale.GERMAN, cliContext.getLocale());
}
}

View File

@ -0,0 +1,14 @@
package org.hl7.fhir.validation.cli.utils;
import org.hl7.fhir.validation.cli.model.CliContext;
import org.junit.jupiter.api.Test;
import java.util.Locale;
import static org.junit.Assert.assertEquals;
public class ParamsTests {
@Test
void testLocale() throws Exception {
CliContext cliContext = Params.loadCliContext(new String[]{"-locale", "de"});
assertEquals(Locale.GERMAN, cliContext.getLocale());
}
}