@Test
    void requireThatPolicyOnlyConsumesDeclaredErrors() {
        SimpleProtocol protocol = new SimpleProtocol();
        protocol.addPolicyFactory("Custom", new CustomPolicyFactory());
        srcServer.mb.putProtocol(protocol);
        retryPolicy.setEnabled(false);
        assertTrue(srcSession.send(createMessage("msg"), Route.parse("[Custom:dst/unknown]")).isAccepted());
        Reply reply = ((Receptor) srcSession.getReplyHandler()).getReply(60);
        assertNotNull(reply);
        assertEquals(1, reply.getNumErrors());
        assertEquals(ErrorCode.NO_ADDRESS_FOR_SERVICE, reply.getError(0).getCode());
        assertTrace(List.of("Selecting [dst/unknown].",
                        "[NO_ADDRESS_FOR_SERVICE @ localhost]",
                        "Merged [dst/unknown]."),
                reply.getTrace());
    }
@author havardpe
@author Simon Thoresen Hult
messagebus/src/test/java/com/yahoo/messagebus/routing/RoutingTestCase.java