1818
1919import jakarta .enterprise .inject .Instance ;
2020import jakarta .inject .Inject ;
21- import jakarta .nosql .tck .entities .Person ;
2221import net .datafaker .Faker ;
2322import org .eclipse .jnosql .communication .semistructured .CommunicationEntity ;
2423import org .eclipse .jnosql .communication .semistructured .Element ;
3837
3938import java .util .Collections ;
4039import java .util .Map ;
40+ import java .util .UUID ;
4141import java .util .function .Supplier ;
4242import java .util .stream .Stream ;
4343
@@ -84,13 +84,13 @@ void setUp() {
8484
8585 @ Test
8686 void shouldCypher () {
87- String cypher = "MATCH (n:Person ) RETURN n" ;
87+ String cypher = "MATCH (n:Music ) RETURN n" ;
8888 Map <String , Object > parameters = Collections .emptyMap ();
89- CommunicationEntity entity = CommunicationEntity .of ("Person " );
89+ CommunicationEntity entity = CommunicationEntity .of ("Music " );
9090 entity .add (Element .of ("name" , "Ada" ));
9191 when (manager .executeQuery (cypher , parameters )).thenReturn (Stream .of (entity ));
9292
93- Stream <Person > result = template .cypher (cypher , parameters );
93+ Stream <Music > result = template .cypher (cypher , parameters );
9494 assertNotNull (result );
9595 assertTrue (result .findFirst ().isPresent ());
9696 }
@@ -104,15 +104,15 @@ void shouldThrowExceptionWhenQueryIsNull() {
104104 @ Test
105105 void shouldCreateEdge () {
106106 var faker = new Faker ();
107- Person source = Person . of ( faker );
108- Person target = Person . of ( faker );
107+ Music source = new Music ( UUID . randomUUID (). toString (), faker . funnyName (). name (), 10 );
108+ Music target = new Music ( UUID . randomUUID (). toString (), faker . funnyName (). name (), 15 );
109109 String relationshipType = "FRIENDS" ;
110- Edge <Person , Person > edge = Edge .of (source , relationshipType , target );
110+ Edge <Music , Music > edge = Edge .of (source , relationshipType , target );
111111
112112
113113 Mockito .when (manager .insert (Mockito .any (CommunicationEntity .class ))).thenAnswer (invocation -> invocation .getArgument (0 ));
114114
115- Edge <Person , Person > result = template .edge (source , relationshipType , target );
115+ Edge <Music , Music > result = template .edge (source , relationshipType , target );
116116
117117 assertNotNull (result );
118118 assertEquals (edge , result );
@@ -122,8 +122,8 @@ void shouldCreateEdge() {
122122 @ Test
123123 void shouldThrowExceptionWhenCreatingEdgeWithNullValues () {
124124 var faker = new Faker ();
125- Person source = Person . of ( faker );
126- Person target = Person . of ( faker );
125+ Music source = new Music ( UUID . randomUUID (). toString (), faker . funnyName (). name (), 10 );
126+ Music target = new Music ( UUID . randomUUID (). toString (), faker . funnyName (). name (), 15 );
127127 assertThrows (NullPointerException .class , () -> template .edge (null , "FRIENDS" , target ));
128128 assertThrows (NullPointerException .class , () -> template .edge (source , (Supplier <String >) null , target ));
129129 assertThrows (NullPointerException .class , () -> template .edge (source , "FRIENDS" , null ));
@@ -132,8 +132,8 @@ void shouldThrowExceptionWhenCreatingEdgeWithNullValues() {
132132 @ Test
133133 void shouldRemoveEdge () {
134134 var faker = new Faker ();
135- Person source = Person . of ( faker );
136- Person target = Person . of ( faker );
135+ Music source = new Music ( UUID . randomUUID (). toString (), faker . funnyName (). name (), 10 );
136+ Music target = new Music ( UUID . randomUUID (). toString (), faker . funnyName (). name (), 15 );
137137 String relationshipType = "FRIENDS" ;
138138
139139 doNothing ().when (manager ).remove (any (), anyString (), any ());
@@ -145,8 +145,8 @@ void shouldRemoveEdge() {
145145 @ Test
146146 void shouldThrowExceptionWhenRemovingEdgeWithNullValues () {
147147 var faker = new Faker ();
148- Person source = Person . of ( faker );
149- Person target = Person . of ( faker );
148+ Music source = new Music ( UUID . randomUUID (). toString (), faker . funnyName (). name (), 10 );
149+ Music target = new Music ( UUID . randomUUID (). toString (), faker . funnyName (). name (), 15 );
150150 assertThrows (NullPointerException .class , () -> template .remove (null , "FRIENDS" , target ));
151151 assertThrows (NullPointerException .class , () -> template .remove (source , (String ) null , target ));
152152 assertThrows (NullPointerException .class , () -> template .remove (source , "FRIENDS" , null ));
0 commit comments