Search in sources :

Example 1 with GlobalExtensions

use of org.neo4j.kernel.extension.GlobalExtensions in project neo4j by neo4j.

the class TestExtension method dependenciesCanBeRetrieved.

/**
 * Check that dependencies can be accessed
 */
@Test
void dependenciesCanBeRetrieved() {
    GraphDatabaseAPI graphdb = graphDb();
    try {
        GlobalExtensions globalExtensions = graphdb.getDependencyResolver().resolveDependency(GlobalExtensions.class);
        assertNotNull(globalExtensions.resolveDependency(DummyExtension.class).getDependencies().getConfig());
        assertEquals(graphdb.getDependencyResolver().resolveDependency(DatabaseManager.class), globalExtensions.resolveDependency(DummyExtension.class).getDependencies().getDatabaseManager());
    } finally {
        managementService.shutdown();
    }
}
Also used : GraphDatabaseAPI(org.neo4j.kernel.internal.GraphDatabaseAPI) DatabaseManager(org.neo4j.dbms.database.DatabaseManager) GlobalExtensions(org.neo4j.kernel.extension.GlobalExtensions) Test(org.junit.jupiter.api.Test) ExtensionFactoryContractTest(org.neo4j.kernel.extension.ExtensionFactoryContractTest)

Aggregations

Test (org.junit.jupiter.api.Test)1 DatabaseManager (org.neo4j.dbms.database.DatabaseManager)1 ExtensionFactoryContractTest (org.neo4j.kernel.extension.ExtensionFactoryContractTest)1 GlobalExtensions (org.neo4j.kernel.extension.GlobalExtensions)1 GraphDatabaseAPI (org.neo4j.kernel.internal.GraphDatabaseAPI)1