Skip to content

Commit

Permalink
[mekomsolutions#212] Message Source should interpret messages.propert…
Browse files Browse the repository at this point in the history
…ies with no suffix as Englis
  • Loading branch information
mogoodrich committed Dec 16, 2022
1 parent 41c2bfb commit 2bcd93f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
package org.openmrs.module.initializer;

import net.sf.cglib.core.Local;
import org.apache.commons.lang3.LocaleUtils;
import org.junit.Test;
import org.openmrs.api.context.Context;
Expand Down Expand Up @@ -127,10 +128,12 @@ public void shouldDefaultToDefaultLocaleSettingIfNoMessageFoundInLocale() {

@Test
public void shouldReturnEnglishIfNoOtherMatchesFound() {
Locale.setDefault(Locale.FRANCE);
Locale startingDefaultLocale = LocaleUtility.getDefaultLocale();
LocaleUtility.setDefaultLocaleCache(LocaleUtils.toLocale("fr"));
Locale.setDefault(Locale.FRANCE);
Context.setLocale(Locale.FRANCE);
testMessage("Only defined in English", "metadata.healthcenter.onlyInEnglish");
LocaleUtility.setDefaultLocaleCache(startingDefaultLocale);
}

@Test
Expand Down

0 comments on commit 2bcd93f

Please sign in to comment.