Skip to content

Commit 8155afd

Browse files
committed
fix: stub newRID in remote mock tests (#3943)
(cherry picked from commit f2039a9)
1 parent 5259303 commit 8155afd

4 files changed

Lines changed: 8 additions & 0 deletions

File tree

network/src/test/java/com/arcadedb/remote/RemoteImmutableDocumentTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package com.arcadedb.remote;
2020

21+
import com.arcadedb.database.RID;
2122
import com.arcadedb.schema.DocumentType;
2223
import com.arcadedb.schema.Property;
2324
import org.junit.jupiter.api.BeforeEach;
@@ -48,6 +49,7 @@ void setUp() {
4849
when(mockSchema.getType("TestDoc")).thenReturn(mockType);
4950
when(mockType.getName()).thenReturn("TestDoc");
5051
when(mockType.getPolymorphicPropertyIfExists(ArgumentMatchers.anyString())).thenReturn(null);
52+
when(mockDatabase.newRID(ArgumentMatchers.anyString())).thenAnswer(inv -> new RID(inv.getArgument(0)));
5153

5254
final Map<String, Object> attributes = new HashMap<>();
5355
attributes.put(Property.TYPE_PROPERTY, "TestDoc");

network/src/test/java/com/arcadedb/remote/RemoteImmutableEdgeTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package com.arcadedb.remote;
2020

21+
import com.arcadedb.database.RID;
2122
import com.arcadedb.graph.Edge;
2223
import com.arcadedb.schema.Property;
2324
import org.junit.jupiter.api.BeforeEach;
@@ -47,6 +48,7 @@ void setUp() {
4748
when(mockSchema.getType("TestEdge")).thenReturn(mockType);
4849
when(mockType.getName()).thenReturn("TestEdge");
4950
when(mockType.getPolymorphicPropertyIfExists(ArgumentMatchers.anyString())).thenReturn(null);
51+
when(mockDatabase.newRID(ArgumentMatchers.anyString())).thenAnswer(inv -> new RID(inv.getArgument(0)));
5052

5153
final Map<String, Object> attributes = new HashMap<>();
5254
attributes.put(Property.TYPE_PROPERTY, "TestEdge");

network/src/test/java/com/arcadedb/remote/RemoteImmutableVertexTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package com.arcadedb.remote;
2020

21+
import com.arcadedb.database.RID;
2122
import com.arcadedb.graph.Vertex;
2223
import com.arcadedb.schema.Property;
2324
import org.junit.jupiter.api.BeforeEach;
@@ -47,6 +48,7 @@ void setUp() {
4748
when(mockSchema.getType("TestVertex")).thenReturn(mockType);
4849
when(mockType.getName()).thenReturn("TestVertex");
4950
when(mockType.getPolymorphicPropertyIfExists(ArgumentMatchers.anyString())).thenReturn(null);
51+
when(mockDatabase.newRID(ArgumentMatchers.anyString())).thenAnswer(inv -> new RID(inv.getArgument(0)));
5052

5153
final Map<String, Object> attributes = new HashMap<>();
5254
attributes.put(Property.TYPE_PROPERTY, "TestVertex");

network/src/test/java/com/arcadedb/remote/RemoteMutableEdgeTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package com.arcadedb.remote;
2020

21+
import com.arcadedb.database.RID;
2122
import com.arcadedb.graph.Edge;
2223
import com.arcadedb.graph.Vertex;
2324
import com.arcadedb.query.sql.executor.Result;
@@ -50,6 +51,7 @@ void setUp() {
5051
when(mockDatabase.getSchema()).thenReturn(mockSchema);
5152
when(mockSchema.getType("TestEdge")).thenReturn(mockEdgeType);
5253
when(mockEdgeType.getName()).thenReturn("TestEdge");
54+
when(mockDatabase.newRID(ArgumentMatchers.anyString())).thenAnswer(inv -> new RID(inv.getArgument(0)));
5355

5456
// Build an immutable edge to use as source for the mutable edge
5557
final Map<String, Object> attributes = new HashMap<>();

0 commit comments

Comments
 (0)