Skip to content

Commit 3c3d8ea

Browse files
committed
Add server shutdown to DatabaseExtension (neo4j#1022) (neo4j#1023)
1 parent 24ff1a6 commit 3c3d8ea

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

driver/src/test/java/org/neo4j/driver/util/DatabaseExtension.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package org.neo4j.driver.util;
2020

21+
import org.junit.jupiter.api.extension.AfterAllCallback;
2122
import org.junit.jupiter.api.extension.BeforeEachCallback;
2223
import org.junit.jupiter.api.extension.ExtensionContext;
2324

@@ -41,7 +42,7 @@
4142
import static org.neo4j.driver.util.Neo4jSettings.DEFAULT_TLS_CERT_PATH;
4243
import static org.neo4j.driver.util.Neo4jSettings.DEFAULT_TLS_KEY_PATH;
4344

44-
public class DatabaseExtension implements BeforeEachCallback
45+
public class DatabaseExtension implements BeforeEachCallback, AfterAllCallback
4546
{
4647
static final String TEST_RESOURCE_FOLDER_PATH = "src/test/resources";
4748

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

70+
@Override
71+
public void afterAll( ExtensionContext context )
72+
{
73+
if ( runner != null )
74+
{
75+
runner.stopNeo4j();
76+
}
77+
}
78+
6979
public Driver driver()
7080
{
7181
return runner.driver();

0 commit comments

Comments
 (0)