Class Neo4jExtensionBuilder
java.lang.Object
org.neo4j.harness.junit.extension.Neo4jExtensionBuilder
Neo4jExtension
extension builder.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Pre-populate the server with databases copied from the specified source directory.withAggregationFunction
(Class<?> functionClass) Configure the server to load the specified aggregation function definition class.withConfig
(Setting<T> key, T value) Configure the Neo4j instance.Disable web server on configured Neo4j instance.withFixture
(String fixtureStatement) Data fixture to inject upon server build.withFixture
(Path cypherFileOrDirectory) Data fixtures to inject upon server build.withFixture
(Function<GraphDatabaseService, Void> fixtureFunction) Data fixture to inject upon server build.withFolder
(Path workingDirectory) Configure the Neo4j to use provided directorywithFunction
(Class<?> functionClass) Configure the server to load the specified function definition class.withProcedure
(Class<?> procedureClass) Configure the server to load the specified procedure definition class.withUnmanagedExtension
(String mountPath, Class<?> extension) Shortcut for configuring the server to use an unmanaged extension.withUnmanagedExtension
(String mountPath, String packageName) Shortcut for configuring the server to find and mount all unmanaged extensions in the given package.
-
Method Details
-
withFolder
Configure the Neo4j to use provided directory- Parameters:
workingDirectory
- new working directory- Returns:
- this configurator instance
-
withConfig
Configure the Neo4j instance. Configuration here can be both configuration aimed at the server as well as the database tuning options. Please refer to the Neo4j Manual for details on available configuration options.- Type Parameters:
T
- the setting type- Parameters:
key
- the config keyvalue
- the config value- Returns:
- this configurator instance
-
withUnmanagedExtension
Shortcut for configuring the server to use an unmanaged extension. Please refer to the Neo4j Manual on how to write unmanaged extensions.- Parameters:
mountPath
- the http path, relative to the server base URI, that this extension should be mounted at.extension
- the unmanaged extension class.- Returns:
- this configurator instance
-
withUnmanagedExtension
Shortcut for configuring the server to find and mount all unmanaged extensions in the given package.- Parameters:
mountPath
- the http path, relative to the server base URI, that this extension should be mounted at.packageName
- a java package with extension classes.- Returns:
- this configurator instance
- See Also:
-
withDisabledServer
Disable web server on configured Neo4j instance. For cases where web server is not required to test specific functionality it can be fully disabled using this tuning option.- Returns:
- this configurator instance.
-
withFixture
Data fixtures to inject upon server build. This can be either a file with a plain-text cypher query (for example, myFixture.cyp), or a directory containing such files with the suffix ".cyp".- Parameters:
cypherFileOrDirectory
- file with cypher statement, or directory containing ".cyp"-suffixed files.- Returns:
- this configurator instance
-
withFixture
Data fixture to inject upon server build. This should be a valid Cypher statement.- Parameters:
fixtureStatement
- a cypher statement- Returns:
- this configurator instance
-
withFixture
Data fixture to inject upon server build. This should be a user implemented fixture function operating on aGraphDatabaseService
instance- Parameters:
fixtureFunction
- a fixture function- Returns:
- this configurator instance
-
copyFrom
Pre-populate the server with databases copied from the specified source directory. The source directory needs to have sub-folders `databases/neo4j` in which the source store files are located.- Parameters:
sourceDirectory
- the directory to copy from- Returns:
- this configurator instance
-
withProcedure
Configure the server to load the specified procedure definition class. The class should contain one or more methods annotated withProcedure
, these will become available to call through cypher.- Parameters:
procedureClass
- a class containing one or more procedure definitions- Returns:
- this configurator instance
-
withFunction
Configure the server to load the specified function definition class. The class should contain one or more methods annotated withUserFunction
, these will become available to call through cypher.- Parameters:
functionClass
- a class containing one or more function definitions- Returns:
- this configurator instance
-
withAggregationFunction
Configure the server to load the specified aggregation function definition class. The class should contain one or more methods annotated withUserAggregationFunction
, these will become available to call through cypher.- Parameters:
functionClass
- a class containing one or more function definitions- Returns:
- this configurator instance
-
build
-