Message message = this.messageContext.getMessagesBySource(new FacesMessageSource("foo"))[0];
assertEquals("foo : bar", message.getText());
}
public final void testGetGlobalMessagesOnly() {
this.messageContext = new DefaultMessageContext();
EasyMock.expect(this.requestContext.getMessageContext()).andStubReturn(this.messageContext);
EasyMock.replay(new Object[] { this.requestContext });
this.facesContext.addMessage("foo", new FacesMessage(FacesMessage.SEVERITY_INFO, "foo", "bar"));
this.facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "FOO", "BAR"));