Skip to content

Commit be9de9d

Browse files
committed
feat: add count test for SelectQuery
Implemented a test to verify the count functionality using SelectQuery, ensuring accurate counting of entities in the graph database. Signed-off-by: Maximillian Arruda <[email protected]>
1 parent b9fb3c1 commit be9de9d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

jnosql-tinkerpop/src/test/java/org/eclipse/jnosql/databases/tinkerpop/mapping/AbstractTinkerpopTemplateTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.apache.tinkerpop.gremlin.structure.Transaction;
2323
import org.apache.tinkerpop.gremlin.structure.Vertex;
2424
import org.assertj.core.api.SoftAssertions;
25+
import org.eclipse.jnosql.communication.semistructured.SelectQuery;
2526
import org.eclipse.jnosql.databases.tinkerpop.mapping.entities.Creature;
2627
import org.eclipse.jnosql.databases.tinkerpop.mapping.entities.Human;
2728
import org.eclipse.jnosql.databases.tinkerpop.mapping.entities.Magazine;
@@ -502,6 +503,13 @@ void shouldCountFromEntity() {
502503
assertEquals(2L, getGraphTemplate().count(Human.class));
503504
}
504505

506+
@Test
507+
void shouldCountFromSelectQuery() {
508+
getGraphTemplate().insert(Human.builder().withAge().withName("Otavio").build());
509+
getGraphTemplate().insert(Human.builder().withAge().withName("Poliana").build());
510+
assertEquals(2L, getGraphTemplate().count(SelectQuery.builder().select().from("Human").build()));
511+
}
512+
505513

506514
@Test
507515
void shouldFindById() {

0 commit comments

Comments
 (0)