I see the problem. Maybe instead of a hard wait (which might not be long enough on a busy CI server), we should


    while(n++ < 100 && message.getPayload().size() != 11) {
        Thread.sleep(100);
    }