From 2884d99a5dcd2c32f06e6bc48ae9ba189241154e Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 12 Feb 2019 09:45:56 +0000 Subject: [PATCH 1/2] Complete move to Testcontainers' Neo4j container Closes gh-15638 --- .../neo4j/DataNeo4jTestPropertiesIntegrationTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java index cdd81f391c..842e35faed 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,10 +19,10 @@ package org.springframework.boot.test.autoconfigure.data.neo4j; import org.junit.ClassRule; import org.junit.Test; import org.junit.runner.RunWith; +import org.testcontainers.containers.Neo4jContainer; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.util.TestPropertyValues; -import org.springframework.boot.testsupport.testcontainers.Neo4jContainer; import org.springframework.context.ApplicationContextInitializer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.core.env.Environment; @@ -43,7 +43,8 @@ import static org.assertj.core.api.Assertions.assertThat; public class DataNeo4jTestPropertiesIntegrationTests { @ClassRule - public static Neo4jContainer neo4j = new Neo4jContainer(); + public static Neo4jContainer neo4j = new Neo4jContainer<>() + .withAdminPassword(null); @Autowired private Environment environment; @@ -59,8 +60,7 @@ public class DataNeo4jTestPropertiesIntegrationTests { @Override public void initialize( ConfigurableApplicationContext configurableApplicationContext) { - TestPropertyValues - .of("spring.data.neo4j.uri=bolt://localhost:" + neo4j.getMappedPort()) + TestPropertyValues.of("spring.data.neo4j.uri=" + neo4j.getBoltUrl()) .applyTo(configurableApplicationContext.getEnvironment()); } From 8426d8854fe6bb6cfcfc8c176c164334345efea5 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 12 Feb 2019 09:46:20 +0000 Subject: [PATCH 2/2] Import Testcontainers' bom rather than managing modules individually Closes gh-15900 --- spring-boot-project/spring-boot-parent/pom.xml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-parent/pom.xml b/spring-boot-project/spring-boot-parent/pom.xml index ba4913b063..fb04d3d6a3 100644 --- a/spring-boot-project/spring-boot-parent/pom.xml +++ b/spring-boot-project/spring-boot-parent/pom.xml @@ -240,13 +240,10 @@ org.testcontainers - neo4j - ${testcontainers.version} - - - org.testcontainers - testcontainers + testcontainers-bom ${testcontainers.version} + import + pom org.zeroturnaround