diff --git a/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersion.java b/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersion.java index 8d1f72c1f9..66d1500140 100644 --- a/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersion.java +++ b/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersion.java @@ -49,10 +49,6 @@ default boolean isSupported() { return !(this instanceof Unsupported); } - default boolean isUnstable() { - return this instanceof Unstable; - } - record MajorMinor(int major, int minor) { @Override public String toString() { @@ -67,13 +63,6 @@ public String toString() { } } - record Unstable(int major, int minor, String fullVersion) implements Neo4jVersion { - @Override - public String toString() { - return this.major + "." + this.minor; - } - } - record Unsupported(int major, int minor, String fullVersion) implements Neo4jVersion { @Override public String toString() { diff --git a/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersionLookup.java b/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersionLookup.java index 37c70a4a46..f41afed4ec 100644 --- a/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersionLookup.java +++ b/neo4j-adapter/src/main/java/org/neo4j/gds/compat/Neo4jVersionLookup.java @@ -55,7 +55,6 @@ static Neo4jVersion findNeo4jVersion() { } private static final int SUPPORTED_MAJOR_VERSION = 5; - private static final int NUM_SUPPORTED_MINOR_VERSIONS = 6; private static final int MIN_SUPPORTED_MINOR_VERSION = 16; @VisibleForTesting @@ -81,16 +80,6 @@ static Neo4jVersion parse(CharSequence version, String fullVersion) { return new Neo4jVersion.Unsupported(majorVersion, minorVersion, fullVersion); } - if (fullVersion.contains("SNAPSHOT")) { - return new Neo4jVersion.Unstable(majorVersion, minorVersion, fullVersion); - } - - // TODO: remove this once we have a layer for that particular version, not "dev" - var LATEST_SUPPORTED_MINOR_VERSION = MIN_SUPPORTED_MINOR_VERSION + NUM_SUPPORTED_MINOR_VERSIONS - 1; // -1 because the range is inclusive - if (minorVersion > LATEST_SUPPORTED_MINOR_VERSION) { - return new Neo4jVersion.Unstable(majorVersion, minorVersion, fullVersion); - } - return new Neo4jVersion.Known(majorVersion, minorVersion, fullVersion); } } diff --git a/neo4j-adapter/src/test/java/org/neo4j/gds/compat/Neo4jVersionLookupTest.java b/neo4j-adapter/src/test/java/org/neo4j/gds/compat/Neo4jVersionLookupTest.java index 782c686257..434b3be74f 100644 --- a/neo4j-adapter/src/test/java/org/neo4j/gds/compat/Neo4jVersionLookupTest.java +++ b/neo4j-adapter/src/test/java/org/neo4j/gds/compat/Neo4jVersionLookupTest.java @@ -44,8 +44,7 @@ class Neo4jVersionLookupTest { void testParse(String input, int major, int minor) { assertThat(Neo4jVersionLookup.parse(input, input)) .returns(new Neo4jVersion.MajorMinor(major, minor), Neo4jVersion::semanticVersion) - .returns(true, Neo4jVersion::isSupported) - .returns(false, Neo4jVersion::isUnstable); + .returns(true, Neo4jVersion::isSupported); } @ParameterizedTest @@ -58,8 +57,7 @@ void testParse(String input, int major, int minor) { void testParseNext(String input, int major, int minor) { assertThat(Neo4jVersionLookup.parse(input, input)) .returns(true, v -> v.matches(major, minor)) - .returns(true, Neo4jVersion::isSupported) - .returns(true, Neo4jVersion::isUnstable); + .returns(true, Neo4jVersion::isSupported); } @ParameterizedTest diff --git a/proc/sysinfo/src/test/java/org/neo4j/gds/SysInfoProcTest.java b/proc/sysinfo/src/test/java/org/neo4j/gds/SysInfoProcTest.java index 929a6257a7..358f74671e 100644 --- a/proc/sysinfo/src/test/java/org/neo4j/gds/SysInfoProcTest.java +++ b/proc/sysinfo/src/test/java/org/neo4j/gds/SysInfoProcTest.java @@ -105,9 +105,7 @@ void testSysInfoProc() throws IOException { var neo4jVersion = GraphDatabaseApiProxy.neo4jVersion(); - var expectedCompatibility = neo4jVersion.isUnstable() - ? Set.of("Neo4j %s".formatted(neo4jVersion), "Neo4j RC", "Neo4j DEV") - : Set.of("Neo4j %s".formatted(neo4jVersion)); + var expectedCompatibility = Set.of("Neo4j %s".formatted(neo4jVersion)); var allCompatibilities = new HashSet<>(ALL_COMPATIBILITIES); allCompatibilities.removeAll(expectedCompatibility); diff --git a/test-utils/src/main/java/org/neo4j/gds/junit/annotation/Neo4jVersion.java b/test-utils/src/main/java/org/neo4j/gds/junit/annotation/Neo4jVersion.java index cccd8c3ccb..ca30c812b3 100644 --- a/test-utils/src/main/java/org/neo4j/gds/junit/annotation/Neo4jVersion.java +++ b/test-utils/src/main/java/org/neo4j/gds/junit/annotation/Neo4jVersion.java @@ -19,7 +19,7 @@ */ package org.neo4j.gds.junit.annotation; -@SuppressWarnings("all") +@SuppressWarnings("all") // squelch checkstyle public enum Neo4jVersion { V_5_16(16), V_5_17(17), @@ -29,7 +29,6 @@ public enum Neo4jVersion { V_5_21(21), V_5_22(22), V_5_23(23), - V_Dev(-2), ; private final int minor; @@ -39,8 +38,6 @@ public enum Neo4jVersion { } public boolean matches(org.neo4j.gds.compat.Neo4jVersion version) { - return (this == V_Dev) - ? version.isUnstable() - : version.major() == 5 && version.minor() == this.minor; + return version.matches(5, this.minor); } }