use of org.jnosql.diana.api.document.DocumentDeleteQuery in project jnosql-artemis by eclipse.
the class DocumentRepositoryProxyTest method shouldDeleteByName.
@Test
public void shouldDeleteByName() {
ArgumentCaptor<DocumentDeleteQuery> captor = ArgumentCaptor.forClass(DocumentDeleteQuery.class);
personRepository.deleteByName("Ada");
verify(template).delete(captor.capture());
DocumentDeleteQuery deleteQuery = captor.getValue();
DocumentCondition condition = deleteQuery.getCondition().get();
assertEquals("Person", deleteQuery.getDocumentCollection());
assertEquals(Condition.EQUALS, condition.getCondition());
assertEquals(Document.of("name", "Ada"), condition.getDocument());
}
Aggregations