use of com.vaadin.flow.component.charts.model.Lang in project flow-components by vaadin.
the class ChartOptionsJSONSerializationTest method toJSON_LangWithFinnishLocale_LocaleSerialized_ShortMonths.
@Test
public void toJSON_LangWithFinnishLocale_LocaleSerialized_ShortMonths() throws IOException {
final String[] fiShortMonths = new String[] { "Tammi", "Helmi", "Maalis", "Huhti", "Touko", "Kesä", "Heinä", "Elo", "Syys", "Loka", "Marras", "Joulu" };
final Lang fi = new Lang();
fi.setShortMonths(fiShortMonths);
options.setLang(fi);
String json = toJSON(options);
ObjectMapper om = ChartSerialization.createObjectMapper();
ChartOptions fromJson = om.readValue(json, ChartOptions.class);
Assert.assertArrayEquals(fiShortMonths, fromJson.getLang().getShortMonths());
}
Aggregations