@@ -31,12 +31,14 @@ class Neo4jContainerTest {
3131 // See org.testcontainers.utility.LicenseAcceptance#ACCEPTANCE_FILE_NAME
3232 private static final String ACCEPTANCE_FILE_LOCATION = "/container-license-acceptance.txt" ;
3333
34+ private static final String DOCKER_IMAGE_NAME = "neo4j:5.26" ;
35+
3436 @ Test
3537 void shouldDisableAuthentication () {
3638 try (
3739 // spotless:off
3840 // withoutAuthentication {
39- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" )
41+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME )
4042 .withoutAuthentication ()
4143 // }
4244 // spotless:on
@@ -99,7 +101,7 @@ void shouldFailOnCopyDatabaseForCustomNonSemverNeo4j4Image() {
99101 void shouldCopyPlugins () {
100102 try (
101103 // registerPluginsPath {
102- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" )
104+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME )
103105 .withPlugins (MountableFile .forClasspathResource ("/custom-plugins" ))
104106 // }
105107 ) {
@@ -114,7 +116,7 @@ void shouldCopyPlugins() {
114116 void shouldCopyPlugin () {
115117 try (
116118 // registerPluginsJar {
117- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" )
119+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME )
118120 .withPlugins (MountableFile .forClasspathResource ("/custom-plugins/hello-world.jar" ))
119121 // }
120122 ) {
@@ -149,8 +151,8 @@ void shouldRunEnterprise() {
149151
150152 try (
151153 // enterpriseEdition {
152- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" )
153- .withEnterpriseEdition ()
154+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME )
155+ .withEnterpriseImage ()
154156 // }
155157 .withAdminPassword ("Picard123" )
156158 ) {
@@ -169,7 +171,7 @@ void shouldRunEnterprise() {
169171 @ Test
170172 void shouldAddConfigToEnvironment () {
171173 // neo4jConfiguration {
172- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" )
174+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME )
173175 .withNeo4jConfig ("dbms.security.procedures.unrestricted" , "apoc.*,algo.*" )
174176 .withNeo4jConfig ("dbms.tx_log.rotation.size" , "42M" );
175177 // }
@@ -181,7 +183,7 @@ void shouldAddConfigToEnvironment() {
181183
182184 @ Test
183185 void shouldRespectEnvironmentAuth () {
184- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" ).withEnv ("NEO4J_AUTH" , "neo4j/secret" );
186+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME ).withEnv ("NEO4J_AUTH" , "neo4j/secret" );
185187
186188 neo4jContainer .configure ();
187189
@@ -191,7 +193,7 @@ void shouldRespectEnvironmentAuth() {
191193 @ Test
192194 void shouldSetCustomPasswordCorrectly () {
193195 // withAdminPassword {
194- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" ).withAdminPassword ("verySecret" );
196+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME ).withAdminPassword ("verySecret" );
195197 // }
196198
197199 neo4jContainer .configure ();
@@ -201,7 +203,7 @@ void shouldSetCustomPasswordCorrectly() {
201203
202204 @ Test
203205 void containerAdminPasswordOverrulesEnvironmentAuth () {
204- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" )
206+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME )
205207 .withEnv ("NEO4J_AUTH" , "neo4j/secret" )
206208 .withAdminPassword ("anotherSecret" );
207209
@@ -212,7 +214,7 @@ void containerAdminPasswordOverrulesEnvironmentAuth() {
212214
213215 @ Test
214216 void containerWithoutAuthenticationOverrulesEnvironmentAuth () {
215- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" )
217+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME )
216218 .withEnv ("NEO4J_AUTH" , "neo4j/secret" )
217219 .withoutAuthentication ();
218220
@@ -223,7 +225,7 @@ void containerWithoutAuthenticationOverrulesEnvironmentAuth() {
223225
224226 @ Test
225227 void shouldRespectAlreadyDefinedPortMappingsBolt () {
226- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" ).withExposedPorts (7687 );
228+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME ).withExposedPorts (7687 );
227229
228230 neo4jContainer .configure ();
229231
@@ -232,7 +234,7 @@ void shouldRespectAlreadyDefinedPortMappingsBolt() {
232234
233235 @ Test
234236 void shouldRespectAlreadyDefinedPortMappingsHttp () {
235- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" ).withExposedPorts (7474 );
237+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME ).withExposedPorts (7474 );
236238
237239 neo4jContainer .configure ();
238240
@@ -241,7 +243,7 @@ void shouldRespectAlreadyDefinedPortMappingsHttp() {
241243
242244 @ Test
243245 void shouldRespectAlreadyDefinedPortMappingsWithoutHttps () {
244- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" ).withExposedPorts (7687 , 7474 );
246+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME ).withExposedPorts (7687 , 7474 );
245247
246248 neo4jContainer .configure ();
247249
@@ -250,7 +252,7 @@ void shouldRespectAlreadyDefinedPortMappingsWithoutHttps() {
250252
251253 @ Test
252254 void shouldDefaultExportBoltHttpAndHttps () {
253- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" );
255+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME );
254256
255257 neo4jContainer .configure ();
256258
@@ -259,7 +261,7 @@ void shouldDefaultExportBoltHttpAndHttps() {
259261
260262 @ Test
261263 void shouldRespectCustomWaitStrategy () {
262- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" ).waitingFor (new CustomDummyWaitStrategy ());
264+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME ).waitingFor (new CustomDummyWaitStrategy ());
263265
264266 neo4jContainer .configure ();
265267
@@ -268,7 +270,7 @@ void shouldRespectCustomWaitStrategy() {
268270
269271 @ Test
270272 void shouldConfigureSinglePluginByName () {
271- try (Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" ).withPlugins ("apoc" )) {
273+ try (Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME ).withPlugins ("apoc" )) {
272274 // needs to get called explicitly for setup
273275 neo4jContainer .configure ();
274276
@@ -280,7 +282,7 @@ void shouldConfigureSinglePluginByName() {
280282 void shouldConfigureMultiplePluginsByName () {
281283 try (
282284 // configureLabsPlugins {
283- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" ) //
285+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME ) //
284286 .withPlugins ("apoc" , "bloom" );
285287 // }
286288 ) {
@@ -296,7 +298,7 @@ void shouldConfigureMultiplePluginsByName() {
296298 void shouldCreateRandomUuidBasedPasswords () {
297299 try (
298300 // withRandomPassword {
299- Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" ).withRandomPassword ();
301+ Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME ).withRandomPassword ();
300302 // }
301303 ) {
302304 // It will throw an exception if it's not UUID parsable.
@@ -309,8 +311,8 @@ void shouldCreateRandomUuidBasedPasswords() {
309311
310312 @ Test
311313 void shouldWarnOnPasswordTooShort () {
312- try (Neo4jContainer neo4jContainer = new Neo4jContainer ("neo4j:5.26" );) {
313- Logger logger = (Logger ) DockerLoggerFactory .getLogger ("neo4j:5.26" );
314+ try (Neo4jContainer neo4jContainer = new Neo4jContainer (DOCKER_IMAGE_NAME );) {
315+ Logger logger = (Logger ) DockerLoggerFactory .getLogger (DOCKER_IMAGE_NAME );
314316 TestLogAppender testLogAppender = new TestLogAppender ();
315317 logger .addAppender (testLogAppender );
316318 testLogAppender .start ();
0 commit comments