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
62bc955b
Commit
62bc955b
authored
Aug 26, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6746 from xenoterracide:neo4j-bolt
* pr/6746: Polish contribution Detect Neo4j bolt driver
parents
b9104c93
47c568a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
Neo4jProperties.java
...mework/boot/autoconfigure/data/neo4j/Neo4jProperties.java
+5
-0
Neo4jPropertiesTests.java
...k/boot/autoconfigure/data/neo4j/Neo4jPropertiesTests.java
+8
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jProperties.java
View file @
62bc955b
...
@@ -45,6 +45,8 @@ public class Neo4jProperties implements ApplicationContextAware {
...
@@ -45,6 +45,8 @@ public class Neo4jProperties implements ApplicationContextAware {
static
final
String
DEFAULT_HTTP_URI
=
"http://localhost:7474"
;
static
final
String
DEFAULT_HTTP_URI
=
"http://localhost:7474"
;
static
final
String
BOLT_DRIVER
=
"org.neo4j.ogm.drivers.bolt.driver.BoltDriver"
;
/**
/**
* URI used by the driver. Auto-detected by default.
* URI used by the driver. Auto-detected by default.
*/
*/
...
@@ -151,6 +153,9 @@ public class Neo4jProperties implements ApplicationContextAware {
...
@@ -151,6 +153,9 @@ public class Neo4jProperties implements ApplicationContextAware {
if
(
"http"
.
equals
(
scheme
))
{
if
(
"http"
.
equals
(
scheme
))
{
return
HTTP_DRIVER
;
return
HTTP_DRIVER
;
}
}
if
(
"bolt"
.
equals
(
scheme
))
{
return
BOLT_DRIVER
;
}
throw
new
IllegalArgumentException
(
throw
new
IllegalArgumentException
(
"Could not deduce driver to use based on URI '"
+
uri
+
"'"
);
"Could not deduce driver to use based on URI '"
+
uri
+
"'"
);
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jPropertiesTests.java
View file @
62bc955b
...
@@ -71,6 +71,14 @@ public class Neo4jPropertiesTests {
...
@@ -71,6 +71,14 @@ public class Neo4jPropertiesTests {
assertDriver
(
configuration
,
Neo4jProperties
.
HTTP_DRIVER
,
"http://localhost:7474"
);
assertDriver
(
configuration
,
Neo4jProperties
.
HTTP_DRIVER
,
"http://localhost:7474"
);
}
}
@Test
public
void
boltUriUseBoltDriver
()
{
Neo4jProperties
properties
=
load
(
true
,
"spring.data.neo4j.uri=bolt://localhost:7687"
);
Configuration
configuration
=
properties
.
createConfiguration
();
assertDriver
(
configuration
,
Neo4jProperties
.
BOLT_DRIVER
,
"bolt://localhost:7687"
);
}
@Test
@Test
public
void
fileUriUseEmbeddedServer
()
{
public
void
fileUriUseEmbeddedServer
()
{
Neo4jProperties
properties
=
load
(
true
,
Neo4jProperties
properties
=
load
(
true
,
...
...
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