@Override
    public void send(ProducerBrokerExchange exchange, Message message) throws Exception {

        DestinationAction action = new DestinationAction(exchange.getConnectionContext(), message.getDestination(), "write");
        assertAuthorized(action, "write to");

        super.send(exchange, message);
    }
@Test(expected=UnauthorizedException.class)
    public void testBrokerExchangeSendNotAuthorized() throws Exception {
        String name = "myTopic";

        ActiveMQDestination dest = new ActiveMQTopic(name);
        ActiveMQTextMessage message = new ActiveMQTextMessage();
        message.setDestination(dest);
        message.setText("Hello, world!");

        Subject subject = new PermsSubject();
        ConnectionContext context = createContext(subject);
        ProducerBrokerExchange exchange = new ProducerBrokerExchange();
        exchange.setConnectionContext(context);

        filter.send(exchange, message);
    }