use of jakarta.nosql.mapping.column.ColumnQueryPagination in project jnosql-diana by eclipse.
the class ColumnPageTest method shouldExecuteQueryPagination.
@Test
public void shouldExecuteQueryPagination() {
Pagination pagination = Pagination.page(1).size(2);
ColumnQueryPagination query = ColumnQueryPagination.of(select().from("person").build(), pagination);
subject.select(query);
verify(managerMock).select(query);
}
use of jakarta.nosql.mapping.column.ColumnQueryPagination in project jnosql-diana by eclipse.
the class DefaultColumnQueryPaginationTest method shouldCreateColumnQueryPagination.
@Test
public void shouldCreateColumnQueryPagination() {
ColumnQuery query = select().from("column").build();
Pagination pagination = Pagination.page(1).size(2);
ColumnQueryPagination queryPagination = ColumnQueryPagination.of(query, pagination);
assertNotNull(queryPagination);
isQueryEquals(query, pagination, queryPagination);
}
use of jakarta.nosql.mapping.column.ColumnQueryPagination 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();
}
}
Aggregations