@Test
    public void testExecutionErrorDuringReplyHandling() {
        MockComponents mc = createDefaultMock("id.user==1234");
        mc.visitorSession.start();
        mc.controlHandler.resetMock();
        mc.executor.expectAndProcessTasks(1);

        // Slightly dirty; since there aren't really many paths during
        // reply handling where we can reliably force an exception to
        // happen, send a bogus visitor reply with a null result bucket which
        // will trigger NPE when the progress token tries to access it.
        replyToCreateVisitor(mc.sender, (reply) -> reply.setLastBucket(null));
        mc.executor.expectAndProcessTasks(1); // reply
        mc.executor.expectNoTasks();
        // Session shall now have failed (and completed)
        assertEquals(0, mc.sender.getMessageCount());
        assertTrue(mc.visitorSession.isDone());

        var controlHandlerMessage = mc.controlHandler.toString();
        assertTrue(controlHandlerMessage.startsWith(
                "onDone : FAILURE - 'Got exception of type java.lang.NullPointerException with message '"));
        // NPE message between these strings changed with helpful NPEs in JDK 14+, so not tested.
        assertTrue(controlHandlerMessage.endsWith("' while processing reply in visitor session'\n"));
    }
Test that we don't try to override a valid route in the parameters.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSessionTestCase.java