2121import org .eclipse .jnosql .mapping .core .Converters ;
2222import org .eclipse .jnosql .mapping .core .spi .EntityMetadataExtension ;
2323import org .eclipse .jnosql .databases .tinkerpop .mapping .entities .Creature ;
24- import org .eclipse .jnosql .databases .tinkerpop .mapping .entities .Person ;
24+ import org .eclipse .jnosql .databases .tinkerpop .mapping .entities .Human ;
2525import org .eclipse .jnosql .databases .tinkerpop .mapping .spi .GraphExtension ;
2626import org .eclipse .jnosql .mapping .reflection .Reflections ;
2727import org .eclipse .jnosql .mapping .semistructured .EntityConverter ;
@@ -65,17 +65,17 @@ void shouldReturnErrorWhenVertexIdIsNull() {
6565
6666 @ Test
6767 void shouldGetVertexFromId () {
68- List <Person > people = graphTemplate .traversalVertex (otavio .getId (), poliana .getId ()).<Person >result ()
68+ List <Human > people = graphTemplate .traversalVertex (otavio .getId (), poliana .getId ()).<Human >result ()
6969 .collect (toList ());
7070
7171 assertThat (people ).contains (otavio , poliana );
7272 }
7373
7474 @ Test
7575 void shouldDefineLimit () {
76- List <Person > people = graphTemplate .traversalVertex (otavio .getId (), poliana .getId (),
76+ List <Human > people = graphTemplate .traversalVertex (otavio .getId (), poliana .getId (),
7777 paulo .getId ()).limit (1 )
78- .<Person >result ()
78+ .<Human >result ()
7979 .collect (toList ());
8080
8181 assertEquals (1 , people .size ());
@@ -84,8 +84,8 @@ void shouldDefineLimit() {
8484
8585 @ Test
8686 void shouldDefineLimit2 () {
87- List <Person > people = graphTemplate .traversalVertex (otavio .getId (), poliana .getId (), paulo .getId ()).
88- <Person >next (2 )
87+ List <Human > people = graphTemplate .traversalVertex (otavio .getId (), poliana .getId (), paulo .getId ()).
88+ <Human >next (2 )
8989 .collect (toList ());
9090
9191 assertEquals (2 , people .size ());
@@ -107,7 +107,7 @@ void shouldEmptyNext() {
107107
108108 @ Test
109109 void shouldHave () {
110- Optional <Person > person = graphTemplate .traversalVertex ().has ("name" , "Poliana" ).next ();
110+ Optional <Human > person = graphTemplate .traversalVertex ().has ("name" , "Poliana" ).next ();
111111 assertTrue (person .isPresent ());
112112 assertEquals (person .get (), poliana );
113113 }
@@ -128,7 +128,7 @@ void shouldReturnErrorWhenHasNullValue() {
128128
129129 @ Test
130130 void shouldHaveId () {
131- Optional <Person > person = graphTemplate .traversalVertex ().has (T .id , poliana .getId ()).next ();
131+ Optional <Human > person = graphTemplate .traversalVertex ().has (T .id , poliana .getId ()).next ();
132132 assertTrue (person .isPresent ());
133133 assertEquals (person .get (), poliana );
134134 }
@@ -209,27 +209,27 @@ void shouldReturnErrorWhenInIsNull() {
209209
210210 @ Test
211211 void shouldOut () {
212- List <Person > people = graphTemplate .traversalVertex ().in (READS ).<Person >result ().collect (toList ());
212+ List <Human > people = graphTemplate .traversalVertex ().in (READS ).<Human >result ().collect (toList ());
213213 assertEquals (3 , people .size ());
214214 assertThat (people ).contains (otavio , poliana , paulo );
215215 }
216216
217217 @ Test
218218 void shouldReturnErrorWhenOutIsNull () {
219- assertThrows (NullPointerException .class , () -> graphTemplate .traversalVertex ().in ((String ) null ).<Person >result ().toList ());
219+ assertThrows (NullPointerException .class , () -> graphTemplate .traversalVertex ().in ((String ) null ).<Human >result ().toList ());
220220 }
221221
222222 @ Test
223223 void shouldBoth () {
224224 List <?> entities = graphTemplate .traversalVertex ().both (READS )
225- .<Person >result ().toList ();
225+ .<Human >result ().toList ();
226226 assertEquals (6 , entities .size ());
227227 }
228228
229229 @ Test
230230 void shouldReturnErrorWhenBothIsNull () {
231231 assertThrows (NullPointerException .class , () -> graphTemplate .traversalVertex ().both ((String ) null )
232- .<Person >result ().toList ());
232+ .<Human >result ().toList ());
233233 }
234234
235235 @ Test
@@ -445,15 +445,15 @@ void shouldReturnErrorWhenHasLabelEntityClassNull() {
445445
446446 @ Test
447447 void shouldReturnHasLabel () {
448- assertTrue (graphTemplate .traversalVertex ().hasLabel ("Person" ).result ().allMatch (Person .class ::isInstance ));
448+ assertTrue (graphTemplate .traversalVertex ().hasLabel ("Person" ).result ().allMatch (Human .class ::isInstance ));
449449 assertTrue (graphTemplate .traversalVertex ().hasLabel (() -> "Book" ).result ().allMatch (Magazine .class ::isInstance ));
450450 assertTrue (graphTemplate .traversalVertex ().hasLabel (Creature .class ).result ().allMatch (Creature .class ::isInstance ));
451451 }
452452
453453 @ Test
454454 void shouldReturnResultAsList () {
455- List <Person > people = graphTemplate .traversalVertex ().hasLabel ("Person" )
456- .<Person >result ()
455+ List <Human > people = graphTemplate .traversalVertex ().hasLabel ("Person" )
456+ .<Human >result ()
457457 .toList ();
458458 assertEquals (3 , people .size ());
459459 }
@@ -472,9 +472,9 @@ void shouldReturnOptionalEmptyWhenThereIsNotResultInSingleResult() {
472472 @ Test
473473 void shouldReturnSingleResult () {
474474 String name = "Poliana" ;
475- Optional <Person > poliana = graphTemplate .traversalVertex ().hasLabel ("Person" ).
475+ Optional <Human > poliana = graphTemplate .traversalVertex ().hasLabel ("Person" ).
476476 has ("name" , name ).singleResult ();
477- assertEquals (name , poliana .map (Person ::getName ).orElse ("" ));
477+ assertEquals (name , poliana .map (Human ::getName ).orElse ("" ));
478478 }
479479
480480 @ Test
@@ -485,8 +485,8 @@ void shouldReturnErrorWhenPredicateIsNull() {
485485 @ Test
486486 void shouldPredicate () {
487487 long count = graphTemplate .traversalVertex ()
488- .hasLabel (Person .class )
489- .filter (Person ::isAdult ).count ();
488+ .hasLabel (Human .class )
489+ .filter (Human ::isAdult ).count ();
490490 assertEquals (3L , count );
491491 }
492492
@@ -500,16 +500,16 @@ void shouldDedup() {
500500 graphTemplate .edge (poliana , "knows" , paulo );
501501 graphTemplate .edge (paulo , "knows" , poliana );
502502
503- List <Person > people = graphTemplate .traversalVertex ()
504- .hasLabel (Person .class )
505- .in ("knows" ).<Person >result ()
503+ List <Human > people = graphTemplate .traversalVertex ()
504+ .hasLabel (Human .class )
505+ .in ("knows" ).<Human >result ()
506506 .collect (Collectors .toList ());
507507
508508 assertEquals (6 , people .size ());
509509
510510 people = graphTemplate .traversalVertex ()
511- .hasLabel (Person .class )
512- .in ("knows" ).dedup ().<Person >result ()
511+ .hasLabel (Human .class )
512+ .in ("knows" ).dedup ().<Human >result ()
513513 .toList ();
514514
515515 assertEquals (3 , people .size ());
0 commit comments