@Test
    public void testLocalDataHandlerInvocationWithAck() {
        MockComponents mc = createDefaultMock("id.user=1234");
        assertEquals("reset\nsetSession\n", mc.dataHandler.toString());
        mc.dataHandler.resetMock();

        mc.visitorSession.start();
        mc.executor.expectAndProcessTasks(1);

        // Send a remove (so we don't have to create a new doc instance)
        mc.receiver.send(new RemoveDocumentMessage(new DocumentId("id:ns:testdoc::bar")));
        mc.executor.expectAndProcessTasks(1);

        // Not yet ACKed
        assertEquals("", mc.receiver.repliesToString());

        assertEquals(1, mc.dataHandler.getMessages().size());
        MockDataHandler.MessageWrapper msg = mc.dataHandler.getMessages().get(0);
        mc.dataHandler.ack(msg.getAckToken());

        assertEquals("RemoveDocumentReply\n", mc.receiver.repliesToString());

        replyToCreateVisitor(mc.sender, ProgressToken.FINISHED_BUCKET);
        mc.executor.expectAndProcessTasks(1);
        assertEquals(
                "onMessage\n" +
                "onDone\n",
                mc.dataHandler.toString());
        assertTrue(mc.visitorSession.isDone());
    }
Test that using an id.user=foo selection only tries to visit a single
superbucket for that user.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSessionTestCase.java