mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-02 09:29:13 +00:00
Fixed -locale parameter for validatorcli (#1002)
* "Added Failing Tests" * Added Failing Tests * Failing Tests * Fixed locale param for validatorcli
This commit is contained in:
parent
01d212afac
commit
8e5ad3a693
@ -284,7 +284,7 @@ public class CliContext {
|
||||
}
|
||||
|
||||
public CliContext setLocale(Locale locale) {
|
||||
this.locale = locale.getDisplayLanguage();
|
||||
this.locale = locale.getLanguage();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
@ -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());
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user