@Test
public void testMessageLengthIsLimitedWhenHasSmsRecipient()
{

    Entity e = entity();
    int tooLong = RandomUtils.nextInt(
        BaseNotificationMessageRenderer.SMS_CHAR_LIMIT + 1,
        BaseNotificationMessageRenderer.SMS_CHAR_LIMIT + 100
    );
    String templateString = CodeGenerator.generateCode( tooLong );
    NotificationTemplate template = template( templateString );
    NotificationMessage message = renderer.render( e, template );
    assertNotNull( message );
    assertEquals( BaseNotificationMessageRenderer.SMS_CHAR_LIMIT, message.getMessage().length() );
}