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