Skip to content

Commit

Permalink
[ld3WXRsV] Fix APOC extended TTL tests (#3664) (#3725)
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 authored Aug 21, 2023
1 parent 490aaac commit 3120d1f
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions extended/src/test/java/apoc/ttl/TTLTest.java
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
package apoc.ttl;

import apoc.periodic.Periodic;
import apoc.util.DbmsTestUtil;
import apoc.util.TestUtil;
import apoc.util.collection.Iterators;

import java.io.IOException;
import java.util.Map;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;

import java.util.concurrent.TimeUnit;

import org.junit.rules.TemporaryFolder;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Transaction;
import org.neo4j.test.rule.DbmsRule;
import org.neo4j.test.rule.ImpermanentDbmsRule;

import static apoc.ExtendedApocConfig.APOC_TTL_ENABLED;
import static apoc.ExtendedApocConfig.APOC_TTL_SCHEDULE;
import static org.junit.Assert.assertTrue;

/**
* TODO:
* Normally apocConfig() can be used to replace ApocSettings,
* but apocConfig() doesn't exist yet in @BeforeClass and it is too late to set the config values in @Before.
* Instead we must either find a way to mock this or
* make it use Neo4jContainerExtension, which would work if core was a submodule
* (currently this approach has the same issue as CoreExtendedTest.java)
*/
@Ignore
public class TTLTest {
@ClassRule
public static TemporaryFolder temporaryFolder = new TemporaryFolder();

@ClassRule
public static DbmsRule db = new ImpermanentDbmsRule();
//.withSetting(ApocSettings.apoc_ttl_schedule, Duration.ofMillis(3000))
//.withSetting(ApocSettings.apoc_ttl_enabled, true);

@BeforeClass
public static void beforeClass() throws IOException {
DbmsTestUtil.startDbWithApocConfigs(temporaryFolder,
Map.of(APOC_TTL_ENABLED, "true",
APOC_TTL_SCHEDULE, "3")
);
}

@AfterClass
public static void tearDown() {
Expand Down

0 comments on commit 3120d1f

Please sign in to comment.