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();
}
}
Aggregations