@Test
    void requireThatErrorDirectiveWorks() {
        Route route = Route.parse("foo/bar/baz");
        route.getHop(0).setDirective(1, new ErrorDirective("err"));
        assertTrue(srcSession.send(createMessage("msg"), route).isAccepted());
        Reply reply = ((Receptor) srcSession.getReplyHandler()).getReply(60);
        assertNotNull(reply);
        assertEquals(1, reply.getNumErrors());
        assertEquals(ErrorCode.ILLEGAL_ROUTE, reply.getError(0).getCode());
        assertEquals("err", reply.getError(0).getMessage());
    }
@author havardpe
@author Simon Thoresen Hult
messagebus/src/test/java/com/yahoo/messagebus/routing/RoutingTestCase.java