Skip to content

Commit 63be167

Browse files
committed
Polish "Use LOCAL_ONE when querying system.local"
See gh-20709
1 parent 851f631 commit 63be167

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraHealthIndicator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 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.
@@ -32,6 +32,7 @@
3232
* Cassandra data stores.
3333
*
3434
* @author Julien Dubois
35+
* @author Alexandre Dutra
3536
* @since 2.0.0
3637
*/
3738
public class CassandraHealthIndicator extends AbstractHealthIndicator {

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/cassandra/CassandraHealthIndicatorTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import com.datastax.driver.core.ResultSet;
2020
import com.datastax.driver.core.Row;
21-
import com.datastax.driver.core.querybuilder.Select;
21+
import com.datastax.driver.core.Statement;
2222
import org.junit.Test;
2323

2424
import org.springframework.boot.actuate.health.Health;
@@ -51,8 +51,8 @@ public void verifyHealthStatusWhenExhausted() {
5151
ResultSet resultSet = mock(ResultSet.class);
5252
CassandraHealthIndicator healthIndicator = new CassandraHealthIndicator(cassandraOperations);
5353
given(cassandraOperations.getCqlOperations()).willReturn(cqlOperations);
54-
given(cqlOperations.queryForResultSet(any(Select.class))).willReturn(resultSet);
55-
given(resultSet.isExhausted()).willReturn(true);
54+
given(cqlOperations.queryForResultSet(any(Statement.class))).willReturn(resultSet);
55+
given(resultSet.isFullyFetched()).willReturn(true);
5656
Health health = healthIndicator.health();
5757
assertThat(health.getStatus()).isEqualTo(Status.UP);
5858
}
@@ -65,8 +65,8 @@ public void verifyHealthStatusWithVersion() {
6565
Row row = mock(Row.class);
6666
CassandraHealthIndicator healthIndicator = new CassandraHealthIndicator(cassandraOperations);
6767
given(cassandraOperations.getCqlOperations()).willReturn(cqlOperations);
68-
given(cqlOperations.queryForResultSet(any(Select.class))).willReturn(resultSet);
69-
given(resultSet.isExhausted()).willReturn(false);
68+
given(cqlOperations.queryForResultSet(any(Statement.class))).willReturn(resultSet);
69+
given(resultSet.isFullyFetched()).willReturn(false);
7070
given(resultSet.one()).willReturn(row);
7171
String expectedVersion = "1.0.0";
7272
given(row.getString(0)).willReturn(expectedVersion);

0 commit comments

Comments
 (0)