Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

g.V(vertexID).headOption() returning null. #292

Open
nilay0016 opened this issue Mar 20, 2020 · 0 comments
Open

g.V(vertexID).headOption() returning null. #292

nilay0016 opened this issue Mar 20, 2020 · 0 comments

Comments

@nilay0016
Copy link

Hi,

Issue is regarding graphs, files attached for reference. I am testing a service class that has reference database connection and the graph. I have created a test graph using TinkerGraph.open.asScala as mentioned in the document and added the vertex with properties into the graph.
To mock the injected object, I am using Mockito to get a null object on mock and then return proper values on call of the object functions.
Eg. val db = mock[DbConnection]
Mockito.when(db.g).thenReturn(graph)

I am facing issues when i perform operation on my test graph to get vertex and return them on mockito call, eg -
println("VertexID GR -:"+gr.V(vertexId).headOption()) // prints None
println("VertexID GR -:"+gr.V(vertexId))
// prints -: [GraphStep(vertex,[{~label=bto, btoId=2f6a7cfe-fcd7-4e03-916b-fd1a1258b466}])]
where vertexId = val vertexId = s"{~label=bto, btoId=$id1}" // created for testing.

I have added sample files for reference.
Any help/suggestions are appreciated.

BtoService.txt
BtoServiceTest.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant