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
46baf462
Commit
46baf462
authored
Mar 11, 2021
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start building against Spring Data 2021.0.0-M5 snapshots
See gh-25548
parent
c19e5c92
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
21 deletions
+33
-21
Neo4jDataAutoConfiguration.java
.../autoconfigure/data/neo4j/Neo4jDataAutoConfiguration.java
+4
-5
Neo4jReactiveDataAutoConfiguration.java
...figure/data/neo4j/Neo4jReactiveDataAutoConfiguration.java
+6
-5
Neo4jDataAutoConfigurationTests.java
...configure/data/neo4j/Neo4jDataAutoConfigurationTests.java
+11
-5
Neo4jReactiveDataAutoConfigurationTests.java
...e/data/neo4j/Neo4jReactiveDataAutoConfigurationTests.java
+11
-5
build.gradle
spring-boot-project/spring-boot-dependencies/build.gradle
+1
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfiguration.java
View file @
46baf462
...
@@ -94,15 +94,14 @@ public class Neo4jDataAutoConfiguration {
...
@@ -94,15 +94,14 @@ public class Neo4jDataAutoConfiguration {
@Bean
(
Neo4jRepositoryConfigurationExtension
.
DEFAULT_NEO4J_CLIENT_BEAN_NAME
)
@Bean
(
Neo4jRepositoryConfigurationExtension
.
DEFAULT_NEO4J_CLIENT_BEAN_NAME
)
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public
Neo4jClient
neo4jClient
(
Driver
driver
)
{
public
Neo4jClient
neo4jClient
(
Driver
driver
,
DatabaseSelectionProvider
databaseNameProvider
)
{
return
Neo4jClient
.
create
(
driver
);
return
Neo4jClient
.
create
(
driver
,
databaseNameProvider
);
}
}
@Bean
(
Neo4jRepositoryConfigurationExtension
.
DEFAULT_NEO4J_TEMPLATE_BEAN_NAME
)
@Bean
(
Neo4jRepositoryConfigurationExtension
.
DEFAULT_NEO4J_TEMPLATE_BEAN_NAME
)
@ConditionalOnMissingBean
(
Neo4jOperations
.
class
)
@ConditionalOnMissingBean
(
Neo4jOperations
.
class
)
public
Neo4jTemplate
neo4jTemplate
(
Neo4jClient
neo4jClient
,
Neo4jMappingContext
neo4jMappingContext
,
public
Neo4jTemplate
neo4jTemplate
(
Neo4jClient
neo4jClient
,
Neo4jMappingContext
neo4jMappingContext
)
{
DatabaseSelectionProvider
databaseNameProvider
)
{
return
new
Neo4jTemplate
(
neo4jClient
,
neo4jMappingContext
);
return
new
Neo4jTemplate
(
neo4jClient
,
neo4jMappingContext
,
databaseNameProvider
);
}
}
@Bean
(
Neo4jRepositoryConfigurationExtension
.
DEFAULT_TRANSACTION_MANAGER_BEAN_NAME
)
@Bean
(
Neo4jRepositoryConfigurationExtension
.
DEFAULT_TRANSACTION_MANAGER_BEAN_NAME
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jReactiveDataAutoConfiguration.java
View file @
46baf462
/*
/*
* Copyright 2012-202
0
the original author or authors.
* Copyright 2012-202
1
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.
...
@@ -58,15 +58,16 @@ public class Neo4jReactiveDataAutoConfiguration {
...
@@ -58,15 +58,16 @@ public class Neo4jReactiveDataAutoConfiguration {
@Bean
(
ReactiveNeo4jRepositoryConfigurationExtension
.
DEFAULT_NEO4J_CLIENT_BEAN_NAME
)
@Bean
(
ReactiveNeo4jRepositoryConfigurationExtension
.
DEFAULT_NEO4J_CLIENT_BEAN_NAME
)
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public
ReactiveNeo4jClient
reactiveNeo4jClient
(
Driver
driver
)
{
public
ReactiveNeo4jClient
reactiveNeo4jClient
(
Driver
driver
,
return
ReactiveNeo4jClient
.
create
(
driver
);
ReactiveDatabaseSelectionProvider
databaseNameProvider
)
{
return
ReactiveNeo4jClient
.
create
(
driver
,
databaseNameProvider
);
}
}
@Bean
(
ReactiveNeo4jRepositoryConfigurationExtension
.
DEFAULT_NEO4J_TEMPLATE_BEAN_NAME
)
@Bean
(
ReactiveNeo4jRepositoryConfigurationExtension
.
DEFAULT_NEO4J_TEMPLATE_BEAN_NAME
)
@ConditionalOnMissingBean
(
ReactiveNeo4jOperations
.
class
)
@ConditionalOnMissingBean
(
ReactiveNeo4jOperations
.
class
)
public
ReactiveNeo4jTemplate
reactiveNeo4jTemplate
(
ReactiveNeo4jClient
neo4jClient
,
public
ReactiveNeo4jTemplate
reactiveNeo4jTemplate
(
ReactiveNeo4jClient
neo4jClient
,
Neo4jMappingContext
neo4jMappingContext
,
ReactiveDatabaseSelectionProvider
databaseNameProvider
)
{
Neo4jMappingContext
neo4jMappingContext
)
{
return
new
ReactiveNeo4jTemplate
(
neo4jClient
,
neo4jMappingContext
,
databaseNameProvider
);
return
new
ReactiveNeo4jTemplate
(
neo4jClient
,
neo4jMappingContext
);
}
}
}
}
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfigurationTests.java
View file @
46baf462
...
@@ -97,6 +97,15 @@ class Neo4jDataAutoConfigurationTests {
...
@@ -97,6 +97,15 @@ class Neo4jDataAutoConfigurationTests {
this
.
contextRunner
.
run
((
context
)
->
assertThat
(
context
).
hasSingleBean
(
Neo4jClient
.
class
));
this
.
contextRunner
.
run
((
context
)
->
assertThat
(
context
).
hasSingleBean
(
Neo4jClient
.
class
));
}
}
@Test
void
shouldProvideNeo4jClientWithCustomDatabaseSelectionProvider
()
{
this
.
contextRunner
.
withUserConfiguration
(
CustomDatabaseSelectionProviderConfiguration
.
class
).
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
Neo4jClient
.
class
);
assertThat
(
context
.
getBean
(
Neo4jClient
.
class
)).
extracting
(
"databaseSelectionProvider"
)
.
isSameAs
(
context
.
getBean
(
DatabaseSelectionProvider
.
class
));
});
}
@Test
@Test
void
shouldReuseExistingNeo4jClient
()
{
void
shouldReuseExistingNeo4jClient
()
{
this
.
contextRunner
.
withBean
(
"myCustomClient"
,
Neo4jClient
.
class
,
()
->
mock
(
Neo4jClient
.
class
))
this
.
contextRunner
.
withBean
(
"myCustomClient"
,
Neo4jClient
.
class
,
()
->
mock
(
Neo4jClient
.
class
))
...
@@ -105,11 +114,8 @@ class Neo4jDataAutoConfigurationTests {
...
@@ -105,11 +114,8 @@ class Neo4jDataAutoConfigurationTests {
@Test
@Test
void
shouldProvideNeo4jTemplate
()
{
void
shouldProvideNeo4jTemplate
()
{
this
.
contextRunner
.
withUserConfiguration
(
CustomDatabaseSelectionProviderConfiguration
.
class
).
run
((
context
)
->
{
this
.
contextRunner
.
withUserConfiguration
(
CustomDatabaseSelectionProviderConfiguration
.
class
)
assertThat
(
context
).
hasSingleBean
(
Neo4jTemplate
.
class
);
.
run
((
context
)
->
assertThat
(
context
).
hasSingleBean
(
Neo4jTemplate
.
class
));
assertThat
(
context
.
getBean
(
Neo4jTemplate
.
class
)).
extracting
(
"databaseSelectionProvider"
)
.
isSameAs
(
context
.
getBean
(
DatabaseSelectionProvider
.
class
));
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jReactiveDataAutoConfigurationTests.java
View file @
46baf462
...
@@ -91,6 +91,16 @@ class Neo4jReactiveDataAutoConfigurationTests {
...
@@ -91,6 +91,16 @@ class Neo4jReactiveDataAutoConfigurationTests {
this
.
contextRunner
.
run
((
context
)
->
assertThat
(
context
).
hasSingleBean
(
ReactiveNeo4jClient
.
class
));
this
.
contextRunner
.
run
((
context
)
->
assertThat
(
context
).
hasSingleBean
(
ReactiveNeo4jClient
.
class
));
}
}
@Test
void
shouldProvideReactiveNeo4jClientWithCustomDatabaseSelectionProvider
()
{
this
.
contextRunner
.
withUserConfiguration
(
CustomReactiveDatabaseSelectionProviderConfiguration
.
class
)
.
run
((
context
)
->
{
assertThat
(
context
).
hasSingleBean
(
ReactiveNeo4jClient
.
class
);
assertThat
(
context
.
getBean
(
ReactiveNeo4jClient
.
class
)).
extracting
(
"databaseSelectionProvider"
)
.
isSameAs
(
context
.
getBean
(
ReactiveDatabaseSelectionProvider
.
class
));
});
}
@Test
@Test
void
shouldReuseExistingReactiveNeo4jClient
()
{
void
shouldReuseExistingReactiveNeo4jClient
()
{
this
.
contextRunner
this
.
contextRunner
...
@@ -102,11 +112,7 @@ class Neo4jReactiveDataAutoConfigurationTests {
...
@@ -102,11 +112,7 @@ class Neo4jReactiveDataAutoConfigurationTests {
@Test
@Test
void
shouldProvideReactiveNeo4jTemplate
()
{
void
shouldProvideReactiveNeo4jTemplate
()
{
this
.
contextRunner
.
withUserConfiguration
(
CustomReactiveDatabaseSelectionProviderConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
CustomReactiveDatabaseSelectionProviderConfiguration
.
class
)
.
run
((
context
)
->
{
.
run
((
context
)
->
assertThat
(
context
).
hasSingleBean
(
ReactiveNeo4jTemplate
.
class
));
assertThat
(
context
).
hasSingleBean
(
ReactiveNeo4jTemplate
.
class
);
assertThat
(
context
.
getBean
(
ReactiveNeo4jTemplate
.
class
)).
extracting
(
"databaseSelectionProvider"
)
.
isSameAs
(
context
.
getBean
(
ReactiveDatabaseSelectionProvider
.
class
));
});
}
}
@Test
@Test
...
...
spring-boot-project/spring-boot-dependencies/build.gradle
View file @
46baf462
...
@@ -1621,7 +1621,7 @@ bom {
...
@@ -1621,7 +1621,7 @@ bom {
]
]
}
}
}
}
library
(
"Spring Data Bom"
,
"2021.0.0-
M4
"
)
{
library
(
"Spring Data Bom"
,
"2021.0.0-
SNAPSHOT
"
)
{
group
(
"org.springframework.data"
)
{
group
(
"org.springframework.data"
)
{
imports
=
[
imports
=
[
"spring-data-bom"
"spring-data-bom"
...
...
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