Search in sources :

Example 1 with Entry

use of com.yahoo.vdslib.Entry in project vespa by vespa-engine.

the class VisitorDataQueueTest method assertResponseHasSinglePut.

private static void assertResponseHasSinglePut(final VisitorResponse response, final DocumentPut expectedInstance) {
    assertNonNullDocumentListResponse(response);
    final DocumentListVisitorResponse visitorResponse = (DocumentListVisitorResponse) response;
    assertThat(visitorResponse.getDocumentList().size(), equalTo(1));
    final Entry entry = visitorResponse.getDocumentList().get(0);
    assertThat(entry.getDocumentOperation(), is(expectedInstance));
}
Also used : Entry(com.yahoo.vdslib.Entry)

Example 2 with Entry

use of com.yahoo.vdslib.Entry in project vespa by vespa-engine.

the class VisitorDataQueueTest method assertResponseHasSingleRemove.

private static void assertResponseHasSingleRemove(final VisitorResponse response, final String docId) {
    assertNonNullDocumentListResponse(response);
    final DocumentListVisitorResponse visitorResponse = (DocumentListVisitorResponse) response;
    assertThat(visitorResponse.getDocumentList().size(), equalTo(1));
    final Entry entry = visitorResponse.getDocumentList().get(0);
    assertThat(entry.isRemoveEntry(), is(true));
    assertThat(entry.getDocumentOperation(), instanceOf(DocumentRemove.class));
    assertThat(entry.getDocumentOperation().getId(), equalTo(new DocumentId(docId)));
}
Also used : Entry(com.yahoo.vdslib.Entry) DocumentRemove(com.yahoo.document.DocumentRemove) DocumentId(com.yahoo.document.DocumentId)

Aggregations

Entry (com.yahoo.vdslib.Entry)2 DocumentId (com.yahoo.document.DocumentId)1 DocumentRemove (com.yahoo.document.DocumentRemove)1