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

        mc.sender.getAndRemoveMessage(0);
        // Make a bogus reply that we never asked for
        RemoveDocumentMessage msg = new RemoveDocumentMessage(new DocumentId("id:ns:testdoc::bar"));
        DocumentReply reply = msg.createReply();
        mc.sender.reply(reply);

        mc.executor.expectAndProcessTasks(1); // reply
        mc.executor.expectNoTasks();
        assertEquals(0, mc.sender.getMessageCount());
        assertTrue(mc.visitorSession.isDone());

        assertEquals("onDone : FAILURE - 'Received reply we do not know how to " +
                "handle: com.yahoo.documentapi.messagebus.protocol.RemoveDocumentReply'\n",
                mc.controlHandler.toString());
    }
Test branch where we don't know how to handle a certain reply type.
This should never happen (since we only get replies for messages we've
already sent) but deal with it anyway!
documentapi/src/test/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSessionTestCase.java