Multilinguism { public String getTranslation(final String key, final String language) { final String translate = i18n.translate(key, language); if (translate == null || translate.isBlank()) { log.warn("No translation found for key '{}'", key); return getEngTranslation(key); } return translate; } Multilinguism(final I18N i18n); String getTranslation(final String key, final String language); String getEngTranslation(final String key);  }
@Test void shouldGetFrenchTranslation() { String result = multilinguism.getTranslation("close", "fra"); assertEquals("Fermer", result); }
@Test void shouldGetDefaultEnglishTranslation() { String result = multilinguism.getTranslation("close", "wrong"); assertEquals("Close", result); }
@Test void shouldGetDefaultUntranslatedTranslation() { String result = multilinguism.getTranslation("wrong", "wrong"); assertEquals("[untranslated!] wrong", result); }