Of course, for your fn(Vertex) function that you want to test, I don't see much point in creating an actual Vertex in a graph database - you could instead just use org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex and do:Vertex vertex = new DetachedVertex("Profile:TEST", "Test", null);然后将其传递给您的函数进行测试.and then pass that to your function to test. 这篇关于如何为这些类型的方法编写单元测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-21 09:11