我有一系列单元测试需要清除 neo4j 数据库。如果我单独运行它们,所有测试都会通过,但是当我全部运行它们时,有些测试会失败,说找不到特定节点:
org.neo4j.graphdb.NotFoundException: Node[6] not found.
at org.neo4j.kernel.impl.core.NodeManager.getNodeForProxy(NodeManager.java:505)
at org.neo4j.kernel.impl.core.NodeProxy.hasProperty(NodeProxy.java:151)
at org.springframework.data.neo4j.fieldaccess.PropertyFieldAccessorFactory$PropertyFieldAccessor.doGetValue(PropertyFieldAccessorFactory.java:85)
at org.springframework.data.neo4j.fieldaccess.ConvertingNodePropertyFieldAccessorFactory$ConvertingNodePropertyFieldAccessor.doGetValue(ConvertingNodePropertyFieldAccessorFactory.java:89)
at org.springframework.data.neo4j.fieldaccess.PropertyFieldAccessorFactory$PropertyFieldAccessor.getValue(PropertyFieldAccessorFactory.java:80)
at org.springframework.data.neo4j.fieldaccess.DefaultEntityState.getValue(DefaultEntityState.java:97)
at org.springframework.data.neo4j.fieldaccess.DetachedEntityState.getValue(DetachedEntityState.java:100)
at org.springframework.data.neo4j.fieldaccess.DetachedEntityState.getValue(DetachedEntityState.java:105)
我已经尝试过了,但它没有解决我的问题:Neo4jDatabaseCleaner
值得注意的是,有问题的测试是与属性相关的测试。
我还能尝试什么?