Using APOC with test harness in 5.x

Hi,

I'm trying to migrate from Neo 4.x to 5.x. My test suite uses the test harness (org.neo4j.test:neo4j-harness:5.2.0) to test the queries my application uses. Some of the queries use APOC procedures and functions.

Prior to 5.x, I could use APOC in the test harness by including a dependency on the APOC fat-jar, (e.g. org.neo4j.procedure.apoc.4.4.0.9:all). Following 5.x, the APOC repos are split into core and extended, so I expected the new Maven coordinates to be e.g. org.neo4j.procedure.apoc-core.5.2.1:all, but I see that there's no 5.x fat-jar published to Maven Central. Using the regular jar (org.neo4j.procedure.apoc-core.5.2.1), I get a runtime exception when the test harness tries to start the database, caused by a java.lang.NoClassDefFoundError: apoc/result/NodeResult.

This looks like a missing dependency that previously I would have got from the fat-jar. Is there a new way of running the test harness with APOC in 5.x?

APOC 5 has been broken into core and extended versions. You can download the extended jar from here:

https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases

Hi @mos20

For APOC core to work,
you have to install the compatible version (in your case 5.2.1) of the apoc-core (from here: https://mvnrepository.com/artifact/org.neo4j.procedure/apoc-core) and apoc-common (from here: https://mvnrepository.com/artifact/org.neo4j.procedure/apoc-common) packages.

Can you try to see if it works with the apoc-common package?

This is because, as you can see on this page: https://mvnrepository.com/artifact/org.neo4j.procedure,
in 5.x the APOC library has been split into multiple maven packages.

Until 4.x there was only one package, the first in the list, i.e. "org.neo4j.procedure ยป apoc",
while 5.x has been separated into the other 5 packages.

To install apoc core and/or apoc extended, you must first install "apoc-common".

Then, if you also want to use extended functions/procedures (i.e these: https://neo4j.com/labs/apoc/5/overview/),
you should also install the "apoc-extended" package.

The other packages are not strictly necessary, as one contains the test utilities and the other basically contains a compatible version of neo4j community.

@mos20
Just to be sure it actually works not only in my environment,
have you tried to check if you still have problems doing this?

@giuseppe_villan I'm on 5.5.0 now, but I have it working using the solution identified in APOC issue 259. It appears that the same solution would work for 5.2.1.