use of com.yahoo.documentapi.messagebus.protocol.PutDocumentMessage in project vespa by vespa-engine.
the class VisitorDataQueueTest method multiple_messages_are_enqueued_and_dequeued_in_fifo_order.
@Test
public void multiple_messages_are_enqueued_and_dequeued_in_fifo_order() {
final VisitorDataQueue queue = new VisitorDataQueue();
final PutDocumentMessage firstPut = createPutMessage("id:foo:testdoc::foo");
final PutDocumentMessage secondPut = createPutMessage("id:foo:testdoc::baz");
queue.onMessage(firstPut, createDummyAckToken());
queue.onMessage(createRemoveMessage("id:foo:testdoc::bar"), createDummyAckToken());
queue.onMessage(secondPut, createDummyAckToken());
queue.onMessage(createRemoveMessage("id:foo:testdoc::fleeb"), createDummyAckToken());
assertResponseHasSinglePut(queue.getNext(), firstPut.getDocumentPut());
assertResponseHasSingleRemove(queue.getNext(), "id:foo:testdoc::bar");
assertResponseHasSinglePut(queue.getNext(), secondPut.getDocumentPut());
assertResponseHasSingleRemove(queue.getNext(), "id:foo:testdoc::fleeb");
}
Aggregations