Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
2884d99a
Commit
2884d99a
authored
Feb 12, 2019
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete move to Testcontainers' Neo4j container
Closes gh-15638
parent
365ea31a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
DataNeo4jTestPropertiesIntegrationTests.java
...e/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java
+5
-5
No files found.
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java
View file @
2884d99a
/*
/*
* Copyright 2012-201
8
the original author or authors.
* Copyright 2012-201
9
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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;
...
@@ -19,10 +19,10 @@ package org.springframework.boot.test.autoconfigure.data.neo4j;
import
org.junit.ClassRule
;
import
org.junit.ClassRule
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.testcontainers.containers.Neo4jContainer
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.boot.testsupport.testcontainers.Neo4jContainer
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
...
@@ -43,7 +43,8 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -43,7 +43,8 @@ import static org.assertj.core.api.Assertions.assertThat;
public
class
DataNeo4jTestPropertiesIntegrationTests
{
public
class
DataNeo4jTestPropertiesIntegrationTests
{
@ClassRule
@ClassRule
public
static
Neo4jContainer
neo4j
=
new
Neo4jContainer
();
public
static
Neo4jContainer
<?>
neo4j
=
new
Neo4jContainer
<>()
.
withAdminPassword
(
null
);
@Autowired
@Autowired
private
Environment
environment
;
private
Environment
environment
;
...
@@ -59,8 +60,7 @@ public class DataNeo4jTestPropertiesIntegrationTests {
...
@@ -59,8 +60,7 @@ public class DataNeo4jTestPropertiesIntegrationTests {
@Override
@Override
public
void
initialize
(
public
void
initialize
(
ConfigurableApplicationContext
configurableApplicationContext
)
{
ConfigurableApplicationContext
configurableApplicationContext
)
{
TestPropertyValues
TestPropertyValues
.
of
(
"spring.data.neo4j.uri="
+
neo4j
.
getBoltUrl
())
.
of
(
"spring.data.neo4j.uri=bolt://localhost:"
+
neo4j
.
getMappedPort
())
.
applyTo
(
configurableApplicationContext
.
getEnvironment
());
.
applyTo
(
configurableApplicationContext
.
getEnvironment
());
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment