@Test void testGetMessageCodeArgs() { String message = "MyMessage"; String code = "my_code"; Object[] args = {"arg0", "arg1"}; Locale locale = Locale.GERMAN; when(messageSource.getMessage(code, args, locale)).thenReturn(message); LocaleContextHolder.setLocale(locale); MessageSourceHolder.setMessageSource(messageSource); assertEquals(message, userMessageSourceImpl.getMessage(code, args)); }
@Override public String getMessage(String code) { return getMessage(code, null); }
ContextMessageSourceImpl implements ContextMessageSource { @Override public String getMessage(String code) { return getMessage(code, null); } }
ContextMessageSourceImpl implements ContextMessageSource { @Override public String getMessage(String code) { return getMessage(code, null); }  }
ContextMessageSourceImpl implements ContextMessageSource { @Override public String getMessage(String code) { return getMessage(code, null); }  @Override String getMessage(String code); @Override String getMessage(String code, @Nullable @CheckForNull Object[] args); }
ContextMessageSourceImpl implements ContextMessageSource { @Override public String getMessage(String code) { return getMessage(code, null); }  @Override String getMessage(String code); @Override String getMessage(String code, @Nullable @CheckForNull Object[] args);  }