@Override
  public synchronized void cleanupAll() {
    LOG.info("Attempting to clean up Neo4j manager.");

    boolean producedError = false;

    // First, delete the database if it was not given as a static argument
    try {
      if (!usingStaticDatabase) {
        dropDatabase(databaseName, waitOption);
      }
    } catch (Exception e) {
      LOG.error("Failed to delete Neo4j database {}.", databaseName, e);
      producedError = true;
    }

    // Next, try to close the Neo4j client connection
    try {
      neo4jDriver.close();
    } catch (Exception e) {
      LOG.error("Failed to delete Neo4j client.", e);
      producedError = true;
    }

    // Throw Exception at the end if there were any errors
    if (producedError) {
      throw new Neo4jResourceManagerException(
          "Failed to delete resources. Check above for errors.");
    }

    super.cleanupAll();

    LOG.info("Neo4j manager successfully cleaned up.");
  }
@Test
  public void testCleanupAllShouldThrowErrorWhenNeo4jDriverFailsToClose() {
    doThrow(RuntimeException.class).when(neo4jDriver).close();

    assertThrows(Neo4jResourceManagerException.class, () -> testManager.cleanupAll());
  }