From 90c4e7518b6dd836121ea6c2313f9fad01f3900c Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 23 Jun 2017 11:39:39 +0200 Subject: [PATCH] Detect Neo4j https driver url Closes gh-9549 --- .../boot/autoconfigure/data/neo4j/Neo4jProperties.java | 4 ++-- .../autoconfigure/data/neo4j/Neo4jPropertiesTests.java | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jProperties.java index e58bda102b..6e3fde9309 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 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. @@ -150,7 +150,7 @@ public class Neo4jProperties implements ApplicationContextAware { if (scheme == null || scheme.equals("file")) { return EMBEDDED_DRIVER; } - if ("http".equals(scheme)) { + if ("http".equals(scheme) || "https".equals(scheme)) { return HTTP_DRIVER; } if ("bolt".equals(scheme)) { diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jPropertiesTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jPropertiesTests.java index 1d89b40f99..6f206749db 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jPropertiesTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jPropertiesTests.java @@ -71,6 +71,14 @@ public class Neo4jPropertiesTests { assertDriver(configuration, Neo4jProperties.HTTP_DRIVER, "http://localhost:7474"); } + @Test + public void httpsUriUseHttpDriver() { + Neo4jProperties properties = load(true, + "spring.data.neo4j.uri=https://localhost:7474"); + Configuration configuration = properties.createConfiguration(); + assertDriver(configuration, Neo4jProperties.HTTP_DRIVER, "https://localhost:7474"); + } + @Test public void boltUriUseBoltDriver() { Neo4jProperties properties = load(true,