LocalizationUtil { public static String resolveMessage(LocalizableValidationException e, Operation op) { Locale requested; if (op == null) { Logger.getAnonymousLogger().fine("Request not provided for localization, using default locale."); requested = DEFAULT_LOCALE; } else { requested = resolveLocale(op); } return resolveMessage(e, requested); } private  LocalizationUtil(); static String resolveMessage(LocalizableValidationException e, Operation op); static Locale resolveLocale(Operation op); static final Locale DEFAULT_LOCALE; }
@Test public void testWithNullLocale() { String message = LocalizationUtil.resolveMessage(this.ex, null); assertEquals(ERROR_MESSAGE_EN, message); }
@Test public void testMissingErrorCodeResolution() { this.ex = new LocalizableValidationException(SYSTEM_EX_MESSAGE, "missing.error.code", EX_ARG_VALUE); String message = LocalizationUtil.resolveMessage(this.ex, null); assertEquals(SYSTEM_EX_MESSAGE, message); }