@Test public void testMessageWithParameters() { WisdomMessageResolver resolver = new WisdomMessageResolver(); resolver.i18n = mock(InternationalizationService.class); when(resolver.i18n.get(locales, "welcome", "wisdom")).thenReturn("welcome wisdom"); when(resolver.i18n.get(locales, "welcome", NULL_ARRAY)).thenReturn("welcome"); MessageResolution resolution = resolver.resolveMessage(null, "welcome", null); assertThat(resolution).isNotNull(); assertThat(resolution.getResolvedMessage()).isEqualTo("welcome"); resolution = resolver.resolveMessage(null, "welcome", new Object[] {"wisdom"}); assertThat(resolution).isNotNull(); assertThat(resolution.getResolvedMessage()).isEqualTo("welcome wisdom"); }
@Override public MessageResolution resolveMessage(Arguments arguments, String key, Object[] messageParameters) { Locale[] locales = getLocales(); String message = i18n.get(locales, key, messageParameters); if (message == null) { return null; } return new MessageResolution(message); }
WisdomMessageResolver extends AbstractMessageResolver implements IMessageResolver { @Override public MessageResolution resolveMessage(Arguments arguments, String key, Object[] messageParameters) { Locale[] locales = getLocales(); String message = i18n.get(locales, key, messageParameters); if (message == null) { return null; } return new MessageResolution(message); } }
WisdomMessageResolver extends AbstractMessageResolver implements IMessageResolver { @Override public MessageResolution resolveMessage(Arguments arguments, String key, Object[] messageParameters) { Locale[] locales = getLocales(); String message = i18n.get(locales, key, messageParameters); if (message == null) { return null; } return new MessageResolution(message); }  }
WisdomMessageResolver extends AbstractMessageResolver implements IMessageResolver { @Override public MessageResolution resolveMessage(Arguments arguments, String key, Object[] messageParameters) { Locale[] locales = getLocales(); String message = i18n.get(locales, key, messageParameters); if (message == null) { return null; } return new MessageResolution(message); }  @Override MessageResolution resolveMessage(Arguments arguments, String key, Object[] messageParameters); }
WisdomMessageResolver extends AbstractMessageResolver implements IMessageResolver { @Override public MessageResolution resolveMessage(Arguments arguments, String key, Object[] messageParameters) { Locale[] locales = getLocales(); String message = i18n.get(locales, key, messageParameters); if (message == null) { return null; } return new MessageResolution(message); }  @Override MessageResolution resolveMessage(Arguments arguments, String key, Object[] messageParameters);  }