Skip to content

Commit 90c4e75

Browse files
committed
Detect Neo4j https driver url
Closes gh-9549
1 parent d770566 commit 90c4e75

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jProperties.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2016 the original author or authors.
2+
* Copyright 2012-2017 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.
@@ -150,7 +150,7 @@ private String deduceDriverFromUri() {
150150
if (scheme == null || scheme.equals("file")) {
151151
return EMBEDDED_DRIVER;
152152
}
153-
if ("http".equals(scheme)) {
153+
if ("http".equals(scheme) || "https".equals(scheme)) {
154154
return HTTP_DRIVER;
155155
}
156156
if ("bolt".equals(scheme)) {

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ public void httpUriUseHttpServer() {
7171
assertDriver(configuration, Neo4jProperties.HTTP_DRIVER, "http://localhost:7474");
7272
}
7373

74+
@Test
75+
public void httpsUriUseHttpDriver() {
76+
Neo4jProperties properties = load(true,
77+
"spring.data.neo4j.uri=https://localhost:7474");
78+
Configuration configuration = properties.createConfiguration();
79+
assertDriver(configuration, Neo4jProperties.HTTP_DRIVER, "https://localhost:7474");
80+
}
81+
7482
@Test
7583
public void boltUriUseBoltDriver() {
7684
Neo4jProperties properties = load(true,

0 commit comments

Comments
 (0)