@Test
public void testResolveMessageWithNoSuchMessageException() {

    ResultMessage message = mock(ResultMessage.class);
    MessageSource messageSource = mock(MessageSource.class);
    Locale locale = Locale.getDefault();
    when(message.getCode()).thenReturn("MSG001");
    when(message.getArgs()).thenReturn(null);
    when(message.getText()).thenReturn("MESSAGE_TEXT");
    when(messageSource.getMessage("MSG001", null, locale)).thenThrow(
            new NoSuchMessageException("MSG001"));
    String msg = ResultMessageUtils.resolveMessage(message, messageSource);
    assertThat(msg, is("MESSAGE_TEXT"));
}