use of org.apache.qpid.server.consumer.ConsumerTarget in project qpid-broker-j by apache.
the class TrustStoreMessageSourceTest method testAddConsumer.
public void testAddConsumer() throws Exception {
final EnumSet<ConsumerOption> options = EnumSet.noneOf(ConsumerOption.class);
final ConsumerTarget target = mock(ConsumerTarget.class);
when(target.allocateCredit(any(ServerMessage.class))).thenReturn(true);
MessageInstanceConsumer consumer = _trustStoreMessageSource.addConsumer(target, null, ServerMessage.class, getTestName(), options, 0);
final MessageContainer messageContainer = consumer.pullMessage();
assertNotNull("Could not pull message of TrustStore", messageContainer);
final ServerMessage message = messageContainer.getMessageInstance().getMessage();
assertCertificates(getCertificatesFromMessage(message));
}
use of org.apache.qpid.server.consumer.ConsumerTarget in project qpid-broker-j by apache.
the class VirtualHostPropertiesNodeTest method testAddConsumer.
public void testAddConsumer() throws Exception {
final EnumSet<ConsumerOption> options = EnumSet.noneOf(ConsumerOption.class);
final ConsumerTarget target = mock(ConsumerTarget.class);
when(target.allocateCredit(any(ServerMessage.class))).thenReturn(true);
MessageInstanceConsumer consumer = _virtualHostPropertiesNode.addConsumer(target, null, ServerMessage.class, getTestName(), options, 0);
final MessageContainer messageContainer = consumer.pullMessage();
assertNotNull("Could not pull message from VirtualHostPropertyNode", messageContainer);
if (messageContainer.getMessageReference() != null) {
messageContainer.getMessageReference().release();
}
}
Aggregations