Search in sources :

Example 1 with LocalizedString

use of org.n52.janmayen.i18n.LocalizedString in project arctic-sea by 52North.

the class SettingValueFactoryTest method testMultilingualStringParsing.

@Test
public void testMultilingualStringParsing() {
    String s = "{\"de\":\"Hallo\",\"en\":\"Hello\"}";
    MultilingualString ms = SettingValueFactory.decodeMultiLingualStringValue(s);
    errors.checkThat(ms, is(notNullValue()));
    errors.checkThat(ms.getLocalization(Locale.ENGLISH), is(Optional.of(new LocalizedString(Locale.ENGLISH, "Hello"))));
    errors.checkThat(ms.getLocalization(Locale.GERMAN), is(Optional.of(new LocalizedString(Locale.GERMAN, "Hallo"))));
}
Also used : MultilingualString(org.n52.janmayen.i18n.MultilingualString) LocalizedString(org.n52.janmayen.i18n.LocalizedString) MultilingualString(org.n52.janmayen.i18n.MultilingualString) LocalizedString(org.n52.janmayen.i18n.LocalizedString) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 LocalizedString (org.n52.janmayen.i18n.LocalizedString)1 MultilingualString (org.n52.janmayen.i18n.MultilingualString)1