use of com.djrapitops.plan.settings.locale.Message in project Plan by plan-player-analytics.
the class ActivityIndexTest method createTestLocale.
private Locale createTestLocale() {
Locale locale = new Locale();
locale.put(HtmlLang.INDEX_VERY_ACTIVE, new Message("A"));
locale.put(HtmlLang.INDEX_ACTIVE, new Message("B"));
locale.put(HtmlLang.INDEX_REGULAR, new Message("C"));
locale.put(HtmlLang.INDEX_IRREGULAR, new Message("D"));
locale.put(HtmlLang.INDEX_INACTIVE, new Message("E"));
return locale;
}
use of com.djrapitops.plan.settings.locale.Message in project Plan by plan-player-analytics.
the class ComparatorTest method localeEntryComparator.
@Test
void localeEntryComparator() {
Map<Lang, Message> messageMap = new HashMap<>();
messageMap.put(HelpLang.SERVERS, new Message(RandomData.randomString(10)));
messageMap.put(HelpLang.SERVER, new Message(RandomData.randomString(10)));
messageMap.put(HelpLang.DB_RESTORE, new Message(RandomData.randomString(10)));
List<Lang> result = messageMap.entrySet().stream().sorted(new LocaleEntryComparator()).map(Map.Entry::getKey).collect(Collectors.toList());
List<Lang> expected = Arrays.asList(HelpLang.DB_RESTORE, HelpLang.SERVER, HelpLang.SERVERS);
assertEquals(expected, result);
}