Search in sources :

Example 1 with DocumentEntityPostPersist

use of jakarta.nosql.mapping.document.DocumentEntityPostPersist in project jnosql-diana by eclipse.

the class DefaultDocumentEventPersistManagerTest method shouldFirePostDocument.

@Test
public void shouldFirePostDocument() {
    DocumentEntity entity = DocumentEntity.of("collection");
    subject.firePostDocument(entity);
    ArgumentCaptor<DocumentEntityPostPersist> captor = ArgumentCaptor.forClass(DocumentEntityPostPersist.class);
    verify(documentEntityPostPersistEvent).fire(captor.capture());
    DocumentEntityPostPersist captorValue = captor.getValue();
    assertEquals(entity, captorValue.getEntity());
}
Also used : DocumentEntityPostPersist(jakarta.nosql.mapping.document.DocumentEntityPostPersist) DocumentEntity(jakarta.nosql.document.DocumentEntity) Test(org.junit.jupiter.api.Test)

Example 2 with DocumentEntityPostPersist

use of jakarta.nosql.mapping.document.DocumentEntityPostPersist in project jnosql-diana by eclipse.

the class DocumentEntityPostPersistTest method shouldReturnInstance.

@Test
public void shouldReturnInstance() {
    DocumentEntity entity = DocumentEntity.of("collection");
    DocumentEntityPostPersist postPersist = new DefaultDocumentEntityPostPersist(entity);
    assertEquals(entity, postPersist.getEntity());
}
Also used : DocumentEntityPostPersist(jakarta.nosql.mapping.document.DocumentEntityPostPersist) DocumentEntity(jakarta.nosql.document.DocumentEntity) Test(org.junit.jupiter.api.Test)

Aggregations

DocumentEntity (jakarta.nosql.document.DocumentEntity)2 DocumentEntityPostPersist (jakarta.nosql.mapping.document.DocumentEntityPostPersist)2 Test (org.junit.jupiter.api.Test)2