### Question:
UIMessageSource extends UIComponentBase { public void setSource(MessageSource source) { getStateHelper().put(PropertyKeys.source, source); }  @Override String getFamily(); @Override void setParent(UIComponent parent); String getVar(); void setVar(String var); MessageSource getSource(); void setSource(MessageSource source); String getPrefix(); void setPrefix(String prefix); boolean isReturnStringsWhenPossible(); void setReturnStringsWhenPossible(boolean returnStringsWhenPossible); boolean isPrefixOptional(); void setPrefixOptional(boolean prefixOptional); static final String COMPONENT_FAMILY; }### Answer:
@Test public void shouldUseDefinedSource() throws Exception { given(this.viewRoot.getViewId()).willReturn("/WEB-INF/pages/example/page.xhtml"); MessageSource source = mock(MessageSource.class); this.uiMessageSource.setSource(source); MessageSourceMap messageSourceMap = callSetParent(); messageSourceMap.get("test").toString(); verify(source).getMessage((MessageSourceResolvable) any(), (Locale) any()); verify(this.applicationContext, never()).getMessage((MessageSourceResolvable) any(), (Locale) any()); }