@Test
    public void testClusterStateParseFailure() {
        MockComponents mc = createDefaultMock();
        mc.visitorSession.start();
        mc.controlHandler.resetMock(); // clear messages
        mc.executor.expectAndProcessTasks(1);
        assertEquals(2, mc.sender.getMessageCount());

        assertEquals("CreateVisitorMessage(buckets=[\n" +
                "BucketId(0x0400000000000000)\n" +
                "BucketId(0x0000000000000000)\n" +
                "]\n)",
                replyWrongDistributionToCreateVisitor(
                        mc.sender, "one:bad cluster:state"));
        mc.executor.expectAndProcessTasks(1); // WDR reply
        // no resending since visiting has failed
        mc.executor.expectNoTasks();
        assertFalse(mc.controlHandler.isDone());

        // Complete visiting
        assertEquals("CreateVisitorMessage(buckets=[\n" +
                "BucketId(0x0400000000000001)\n" +
                "BucketId(0x0000000000000000)\n" +
                "]\n)",
                replyWrongDistributionToCreateVisitor(
                        mc.sender, "another:bad cluster:state"));
        mc.executor.expectAndProcessTasks(1); // WDR reply
        assertTrue(mc.controlHandler.isDone());
        assertEquals("onDone : FAILURE - 'Failed to parse cluster state 'one:bad cluster:state''\n",
                mc.controlHandler.toString());
    }
Test that receiving a WrongDistributionReply with a cluster state
we cannot parse fails the visiting session. We cannot visit anything
if we don't have a proper state anyway, so might as well fail fast.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/MessageBusVisitorSessionTestCase.java