Skip to content

Commit

Permalink
Add server shutdown to DatabaseExtension (#1022) (#1023) (#1041)
Browse files Browse the repository at this point in the history
  • Loading branch information
injectives authored Oct 22, 2021
1 parent 24ff1a6 commit e054e67
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package org.neo4j.driver.util;

import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;

Expand All @@ -41,7 +42,7 @@
import static org.neo4j.driver.util.Neo4jSettings.DEFAULT_TLS_CERT_PATH;
import static org.neo4j.driver.util.Neo4jSettings.DEFAULT_TLS_KEY_PATH;

public class DatabaseExtension implements BeforeEachCallback
public class DatabaseExtension implements BeforeEachCallback, AfterAllCallback
{
static final String TEST_RESOURCE_FOLDER_PATH = "src/test/resources";

Expand All @@ -66,6 +67,15 @@ public void beforeEach( ExtensionContext context ) throws Exception
TestUtil.cleanDb( driver() );
}

@Override
public void afterAll( ExtensionContext context )
{
if ( runner != null )
{
runner.stopNeo4j();
}
}

public Driver driver()
{
return runner.driver();
Expand Down

0 comments on commit e054e67

Please sign in to comment.