Skip to content

Commit 278a086

Browse files
committed
Polish "Fix Spring Data Cassandra auto-configure condition"
See gh-16971
1 parent be43513 commit 278a086

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2019 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.

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraDataAutoConfigurationTests.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,10 @@ public void customConversions() {
106106
}
107107

108108
@Test
109-
void clusterDoesNotExist() {
110-
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
111-
ctx.register(CassandraDataAutoConfiguration.class);
112-
ctx.refresh();
113-
this.context = ctx;
114-
assertThat(ctx.getBeansOfType(Session.class)).isEmpty();
109+
public void clusterDoesNotExist() {
110+
this.context = new AnnotationConfigApplicationContext(
111+
CassandraDataAutoConfiguration.class);
112+
assertThat(this.context.getBeansOfType(Session.class)).isEmpty();
115113
}
116114

117115
public void load(Class<?>... config) {

0 commit comments

Comments
 (0)