Skip to content

Commit 7e51e1a

Browse files
committed
Merge branch '2.1.x'
2 parents 8e0cc27 + 365ea31 commit 7e51e1a

File tree

5 files changed

+28
-99
lines changed

5 files changed

+28
-99
lines changed

spring-boot-project/spring-boot-parent/pom.xml

+11-5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<maven.version>3.5.4</maven.version>
2727
<maven-resolver.version>1.1.1</maven-resolver.version>
2828
<spock.version>1.0-groovy-2.4</spock.version>
29+
<testcontainers.version>1.10.6</testcontainers.version>
2930
<dependency-management-plugin.version>1.0.6.RELEASE</dependency-management-plugin.version>
3031
<spring-doc-resources.version>0.1.0.BUILD-SNAPSHOT</spring-doc-resources.version>
3132
</properties>
@@ -97,11 +98,6 @@
9798
<artifactId>mockwebserver</artifactId>
9899
<version>3.9.0</version>
99100
</dependency>
100-
<dependency>
101-
<groupId>org.testcontainers</groupId>
102-
<artifactId>testcontainers</artifactId>
103-
<version>1.10.6</version>
104-
</dependency>
105101
<dependency>
106102
<groupId>com.vaadin.external.google</groupId>
107103
<artifactId>android-json</artifactId>
@@ -243,6 +239,16 @@
243239
<artifactId>spock-spring</artifactId>
244240
<version>${spock.version}</version>
245241
</dependency>
242+
<dependency>
243+
<groupId>org.testcontainers</groupId>
244+
<artifactId>neo4j</artifactId>
245+
<version>${testcontainers.version}</version>
246+
</dependency>
247+
<dependency>
248+
<groupId>org.testcontainers</groupId>
249+
<artifactId>testcontainers</artifactId>
250+
<version>${testcontainers.version}</version>
251+
</dependency>
246252
<dependency>
247253
<groupId>org.zeroturnaround</groupId>
248254
<artifactId>zt-zip</artifactId>

spring-boot-project/spring-boot-test-autoconfigure/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,11 @@
294294
<artifactId>spring-plugin-core</artifactId>
295295
<scope>test</scope>
296296
</dependency>
297+
<dependency>
298+
<groupId>org.testcontainers</groupId>
299+
<artifactId>neo4j</artifactId>
300+
<scope>test</scope>
301+
</dependency>
297302
<dependency>
298303
<groupId>org.testcontainers</groupId>
299304
<artifactId>testcontainers</artifactId>

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestIntegrationTests.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,11 +20,11 @@
2020
import org.junit.Test;
2121
import org.junit.runner.RunWith;
2222
import org.neo4j.ogm.session.Session;
23+
import org.testcontainers.containers.Neo4jContainer;
2324

2425
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
2526
import org.springframework.beans.factory.annotation.Autowired;
2627
import org.springframework.boot.test.util.TestPropertyValues;
27-
import org.springframework.boot.testsupport.testcontainers.Neo4jContainer;
2828
import org.springframework.context.ApplicationContext;
2929
import org.springframework.context.ApplicationContextInitializer;
3030
import org.springframework.context.ConfigurableApplicationContext;
@@ -39,14 +39,16 @@
3939
*
4040
* @author Eddú Meléndez
4141
* @author Stephane Nicoll
42+
* @author Michael Simons
4243
*/
4344
@RunWith(SpringRunner.class)
4445
@ContextConfiguration(initializers = DataNeo4jTestIntegrationTests.Initializer.class)
4546
@DataNeo4jTest
4647
public class DataNeo4jTestIntegrationTests {
4748

4849
@ClassRule
49-
public static Neo4jContainer neo4j = new Neo4jContainer();
50+
public static Neo4jContainer<?> neo4j = new Neo4jContainer<>()
51+
.withAdminPassword(null);
5052

5153
@Autowired
5254
private Session session;
@@ -79,8 +81,7 @@ static class Initializer
7981
@Override
8082
public void initialize(
8183
ConfigurableApplicationContext configurableApplicationContext) {
82-
TestPropertyValues
83-
.of("spring.data.neo4j.uri=bolt://localhost:" + neo4j.getMappedPort())
84+
TestPropertyValues.of("spring.data.neo4j.uri=" + neo4j.getBoltUrl())
8485
.applyTo(configurableApplicationContext.getEnvironment());
8586
}
8687

spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestWithIncludeFilterIntegrationTests.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,10 +19,10 @@
1919
import org.junit.ClassRule;
2020
import org.junit.Test;
2121
import org.junit.runner.RunWith;
22+
import org.testcontainers.containers.Neo4jContainer;
2223

2324
import org.springframework.beans.factory.annotation.Autowired;
2425
import org.springframework.boot.test.util.TestPropertyValues;
25-
import org.springframework.boot.testsupport.testcontainers.Neo4jContainer;
2626
import org.springframework.context.ApplicationContextInitializer;
2727
import org.springframework.context.ConfigurableApplicationContext;
2828
import org.springframework.context.annotation.ComponentScan.Filter;
@@ -36,14 +36,16 @@
3636
* Integration test with custom include filter for {@link DataNeo4jTest}.
3737
*
3838
* @author Eddú Meléndez
39+
* @author Michael Simons
3940
*/
4041
@RunWith(SpringRunner.class)
4142
@ContextConfiguration(initializers = DataNeo4jTestWithIncludeFilterIntegrationTests.Initializer.class)
4243
@DataNeo4jTest(includeFilters = @Filter(Service.class))
4344
public class DataNeo4jTestWithIncludeFilterIntegrationTests {
4445

4546
@ClassRule
46-
public static Neo4jContainer neo4j = new Neo4jContainer();
47+
public static Neo4jContainer<?> neo4j = new Neo4jContainer<>()
48+
.withAdminPassword(null);
4749

4850
@Autowired
4951
private ExampleService service;
@@ -59,8 +61,7 @@ static class Initializer
5961
@Override
6062
public void initialize(
6163
ConfigurableApplicationContext configurableApplicationContext) {
62-
TestPropertyValues
63-
.of("spring.data.neo4j.uri=bolt://localhost:" + neo4j.getMappedPort())
64+
TestPropertyValues.of("spring.data.neo4j.uri=" + neo4j.getBoltUrl())
6465
.applyTo(configurableApplicationContext.getEnvironment());
6566
}
6667

spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/Neo4jContainer.java

-84
This file was deleted.

0 commit comments

Comments
 (0)