@Test
    void requireThatSetReplyWorks() {
        SimpleProtocol protocol = new SimpleProtocol();
        protocol.addPolicyFactory("Select", new CustomPolicyFactory(true, ErrorCode.APP_FATAL_ERROR));
        protocol.addPolicyFactory("SetReply", param -> new SetReplyPolicy(true, List.of(ErrorCode.APP_FATAL_ERROR), param));
        srcServer.mb.putProtocol(protocol);
        retryPolicy.setEnabled(false);
        assertTrue(
                srcSession.send(createMessage("msg"), Route.parse("[Select:[SetReply:foo]," + dstSessName + "]")).isAccepted());
        Message msg = ((Receptor) dstSession.getMessageHandler()).getMessage(60);
        assertNotNull(msg);
        dstSession.acknowledge(msg);
        Reply reply = ((Receptor) srcSession.getReplyHandler()).getReply(60);
        assertNotNull(reply);
        assertEquals(1, reply.getNumErrors());
        assertEquals(ErrorCode.APP_FATAL_ERROR, reply.getError(0).getCode());
        assertEquals("foo", reply.getError(0).getMessage());
    }
@author havardpe
@author Simon Thoresen Hult
messagebus/src/test/java/com/yahoo/messagebus/routing/RoutingTestCase.java