### Question:
AuthorizationFilter extends EnvironmentFilter { @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); } AuthorizationFilter(); ActionPermissionResolver getActionPermissionResolver(); void setActionPermissionResolver(ActionPermissionResolver actionPermissionResolver); @Override void addDestinationInfo(ConnectionContext context, DestinationInfo info); @Override Destination addDestination(ConnectionContext context, ActiveMQDestination destination, boolean create); @Override void removeDestination(ConnectionContext context, ActiveMQDestination destination, long timeout); @Override void removeDestinationInfo(ConnectionContext context, DestinationInfo info); @Override Subscription addConsumer(ConnectionContext context, ConsumerInfo info); @Override void addProducer(ConnectionContext context, ProducerInfo info); @Override void send(ProducerBrokerExchange exchange, Message message);  }### Answer:
@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); }