Merge branch '2.1.x'

Closes gh-16990
pull/17002/head
Phillip Webb 6 years ago
commit df55d73bff

@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration;
import org.springframework.boot.autoconfigure.cassandra.CassandraProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.domain.EntityScanPackages;
@ -59,6 +60,7 @@ import org.springframework.data.cassandra.core.mapping.SimpleUserTypeResolver;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass({ Cluster.class, CassandraAdminOperations.class })
@ConditionalOnBean(Cluster.class)
@EnableConfigurationProperties(CassandraProperties.class)
@AutoConfigureAfter(CassandraAutoConfiguration.class)
public class CassandraDataAutoConfiguration {

@ -105,6 +105,13 @@ public class CassandraDataAutoConfigurationTests {
}
@Test
public void clusterDoesNotExist() {
this.context = new AnnotationConfigApplicationContext(
CassandraDataAutoConfiguration.class);
assertThat(this.context.getBeansOfType(Session.class)).isEmpty();
}
public void load(Class<?>... config) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
TestPropertyValues.of("spring.data.cassandra.keyspaceName:boot_test")

Loading…
Cancel
Save