Skip to content

Commit 38353e5

Browse files
committed
DATAES-654 - Add JUnit5 support.
1 parent 58920af commit 38353e5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/java/org/springframework/data/elasticsearch/junit/jupiter/SpringDataElasticsearchExtension.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ public ContextCustomizer createContextCustomizer(Class<?> testClass,
105105

106106
private void customizeContext(ConfigurableApplicationContext context, MergedContextConfiguration mergedConfig) {
107107

108-
context.getBeanFactory().registerResolvableDependency(ClusterConnectionInfo.class,
109-
ClusterConnection.clusterConnectionInfo());
108+
ClusterConnectionInfo clusterConnectionInfo = ClusterConnection.clusterConnectionInfo();
109+
110+
if (clusterConnectionInfo != null) {
111+
context.getBeanFactory().registerResolvableDependency(ClusterConnectionInfo.class, clusterConnectionInfo);
112+
}
110113
}
111114

112115
}

0 commit comments

Comments
 (0)