Search in sources :

Example 1 with ColumnEventPersistManager

use of jakarta.nosql.mapping.column.ColumnEventPersistManager in project jnosql-diana by eclipse.

the class ColumnPageTest method setUp.

@BeforeEach
public void setUp() {
    managerMock = Mockito.mock(ColumnFamilyManager.class);
    columnEventPersistManager = Mockito.mock(ColumnEventPersistManager.class);
    captor = ArgumentCaptor.forClass(ColumnEntity.class);
    Instance<ColumnFamilyManager> instance = Mockito.mock(Instance.class);
    when(instance.get()).thenReturn(managerMock);
    this.subject = new DefaultColumnTemplate(converter, instance, new DefaultColumnWorkflow(columnEventPersistManager, converter), columnEventPersistManager, classMappings, converters);
    Pagination pagination = Pagination.page(1).size(1);
    ColumnQueryPagination query = ColumnQueryPagination.of(select().from("person").build(), pagination);
    for (int index = 0; index <= 10; index++) {
        Column[] columns = new Column[] { Column.of("age", index), Column.of("name", "Ada " + index), Column.of("_id", (long) index) };
        ColumnEntity columnEntity = ColumnEntity.of("Person");
        columnEntity.addAll(Stream.of(columns).collect(Collectors.toList()));
        when(managerMock.select(query)).thenReturn(Stream.of(columnEntity));
        query = query.next();
    }
}
Also used : Pagination(jakarta.nosql.mapping.Pagination) ColumnQueryPagination(jakarta.nosql.mapping.column.ColumnQueryPagination) ColumnQueryPagination(jakarta.nosql.mapping.column.ColumnQueryPagination) ColumnEventPersistManager(jakarta.nosql.mapping.column.ColumnEventPersistManager) ColumnEntity(jakarta.nosql.column.ColumnEntity) ColumnFamilyManager(jakarta.nosql.column.ColumnFamilyManager) Column(jakarta.nosql.column.Column) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Column (jakarta.nosql.column.Column)1 ColumnEntity (jakarta.nosql.column.ColumnEntity)1 ColumnFamilyManager (jakarta.nosql.column.ColumnFamilyManager)1 Pagination (jakarta.nosql.mapping.Pagination)1 ColumnEventPersistManager (jakarta.nosql.mapping.column.ColumnEventPersistManager)1 ColumnQueryPagination (jakarta.nosql.mapping.column.ColumnQueryPagination)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1