@Test
    void selectExceptionIncludesStackTraceInMessage() {
        SimpleProtocol protocol = new SimpleProtocol();
        protocol.addPolicyFactory("Custom", exceptionOnSelectThrowingMockFactory());
        srcServer.mb.putProtocol(protocol);
        assertTrue(srcSession.send(createMessage("msg"), Route.parse("[Custom]")).isAccepted());
        Reply reply = ((Receptor) srcSession.getReplyHandler()).getReply(60);
        assertEquals(ErrorCode.POLICY_ERROR, reply.getError(0).getCode());
        // Attempting any sort of full matching of the stack trace is brittle, so
        // simplify by assuming any message which mentions the source file of the
        // originating exception is good to go.
        assertTrue(reply.getError(0).getMessage().contains("RoutingTestCase"));
    }
@author havardpe
@author Simon Thoresen Hult
messagebus/src/test/java/com/yahoo/messagebus/routing/RoutingTestCase.java