use of org.apache.qpid.server.queue.QueueEntryVisitor in project qpid-broker-j by apache.
the class ReportRunnerTest method createMockQueue.
private Queue createMockQueue(final ServerMessage<?>... messages) {
final Queue<?> queue = mock(Queue.class);
final ArgumentCaptor<QueueEntryVisitor> captor = ArgumentCaptor.forClass(QueueEntryVisitor.class);
doAnswer(new Answer() {
@Override
public Object answer(final InvocationOnMock invocation) throws Throwable {
QueueEntryVisitor visitor = captor.getValue();
for (ServerMessage<?> message : messages) {
if (visitor.visit(makeEntry(queue, message))) {
break;
}
}
return null;
}
}).when(queue).visit(captor.capture());
return queue;
}
Aggregations