@Test public void shortMessageCall() { String testedString = "Some string {change}"; MessageSource mock = mock(MessageSource.class); Locale locale = new Locale("ru", mock); locale.message(testedString); verify(mock, times(1)).getMessage(eq(testedString), eq(new Object[0]), any()); }
public String message(String s, Object[] objects) { return messageSource.getMessage(s, objects, nativeLocale); }
Locale { public String message(String s, Object[] objects) { return messageSource.getMessage(s, objects, nativeLocale); } }
Locale { public String message(String s, Object[] objects) { return messageSource.getMessage(s, objects, nativeLocale); } @Autowired  Locale(@Value("#{localeCodeSource.code}") String code, MessageSource messageSource); }
Locale { public String message(String s, Object[] objects) { return messageSource.getMessage(s, objects, nativeLocale); } @Autowired  Locale(@Value("#{localeCodeSource.code}") String code, MessageSource messageSource); String message(String s, Object[] objects); String message(String s); }
Locale { public String message(String s, Object[] objects) { return messageSource.getMessage(s, objects, nativeLocale); } @Autowired  Locale(@Value("#{localeCodeSource.code}") String code, MessageSource messageSource); String message(String s, Object[] objects); String message(String s);  }