@Test(expected = NoSuchMessageException.class)
public void testNoSuchMessageException() {

    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(null);
    when(messageSource.getMessage("MSG001", null, locale)).thenThrow(
            new NoSuchMessageException("MSG001"));
    ResultMessageUtils.resolveMessage(message, messageSource);
}