From 92b0c48aeb9817bf011ec5c7a80df2d7cf50ef29 Mon Sep 17 00:00:00 2001 From: Andrew Jefferson Date: Mon, 22 Jun 2020 20:17:54 +0200 Subject: [PATCH] handle the difference between community and enterprise mountable directories in TestUpgrade --- .../java/com/neo4j/docker/TestUpgrade.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/neo4j/docker/TestUpgrade.java b/src/test/java/com/neo4j/docker/TestUpgrade.java index 4061c794..c3d5c588 100644 --- a/src/test/java/com/neo4j/docker/TestUpgrade.java +++ b/src/test/java/com/neo4j/docker/TestUpgrade.java @@ -17,7 +17,6 @@ import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.images.PullPolicy; -import org.testcontainers.shaded.com.google.common.collect.ImmutableList; import java.io.File; import java.io.FileWriter; @@ -27,6 +26,8 @@ import java.nio.file.Path; import java.time.Duration; import java.time.Instant; +import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -40,8 +41,9 @@ public class TestUpgrade { private static final Logger log = LoggerFactory.getLogger( TestUpgrade.class ); - ImmutableList readonlyMounts = ImmutableList.of( "conf" ); - ImmutableList writableMounts = ImmutableList.of( "data", "logs", "metrics" ); + private static final List readonlyMounts = Collections.singletonList( "conf" ); + private static final List writableMounts = getWriteableMounts(); + private final String user = "neo4j"; private final String password = "quality"; @@ -297,4 +299,18 @@ private static String releaseImageName( int major, int minor ) return String.format( "neo4j:%d.%d%s", major, minor, (TestSettings.EDITION == TestSettings.Edition.ENTERPRISE) ? "-enterprise" : "" ); } + + private static List getWriteableMounts() + { + switch ( TestSettings.EDITION ) + { + case COMMUNITY: + return Arrays.asList( "data", "logs" ); + case ENTERPRISE: + return Arrays.asList( "data", "logs", "metrics" ); + default: + Assertions.fail( "Unknown Edition: " + TestSettings.EDITION ); + return Collections.emptyList(); + } + } }