-
Notifications
You must be signed in to change notification settings - Fork 16
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
Implement assertions to work with Neo4j Java Driver #75
Comments
With this issue, assertj-neo4j would end up with two "usage modes":
I think the integration testing trend with Neo4j is to rely on solutions such as Testcontainers and its Neo4j module (no more classpath conflicts etc etc). Now, my question is: given these two "usage modes" are completely separate, does it make sense to have them in the same repo? One advantage I see is the discoverability. People interested in writing assertions on Neo4j types have a single place to look at. One drawback is that people using the "historical" mode do not care about the Java driver that they won't use at all for the existing assertions. Same applies for users of the new mode, where they only care about the Java driver and not about Neo4j Java APIs. What do you think @joel-costigliola? As a reference, you can see the excellent blogpost of @michael-simons about the different flavors of testing with Neo4j: https://medium.com/neo4j/testing-your-neo4j-based-java-application-34bef487cc3c (you can skip the SDN / OGM section). |
@fbiville is the I would go for a single library, users of the java driver will only see |
Hey everyone.
The |
Thanks for chiming in @michael-simons . I'm undecided about the best path to follow. My gut feeling is that embedded Neo4j is a less and less relevant scenario to support, while Docker/TestContainers seems to be the prevalent choice nowadays. |
For application developers testing the real thing - aka server connection over bolt - is the preferred way to go. Doesn't matter if the test runs against a test database instance or test container. For plugin developers, they must use embedded. However, here's the catch: Even the embedded instance allows you to open up a bolt connection over local socket against which you can use the driver. Thus, even more an argument for going the Also: A plugin developer is probably much more interested in testing the output of their procedures. So they would maybe write unit tests for their plugin and assert the internal / embedded results in some other wise and than call their plugins through the driver and cypher and than assert that result. Makes sense? |
OK, I will take that direction to implement this. With the local socket on embedded instance, it's make perfect sense to use directly As @joel-costigliola said, we will make in mind to have the best developer experience for its assertions. Thanks a lot for the feedback ! |
Thank you @Patouche and all others for working on that! Feel free to reach out with any other questions. |
This will allow Assertj-Neo4j to work in scenarios where tests run against a remote Neo4j instance (whether via testcontainers or a hosted standalone instance).
Note that the dependency on the Neo4j Java Driver should be optional, as people relying on Neo4j test harness do not need the driver at all and the other assertions should continue to work.
The text was updated successfully, but these errors were encountered: