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
63be1678
Commit
63be1678
authored
Mar 28, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Use LOCAL_ONE when querying system.local"
See gh-20709
parent
851f631e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
CassandraHealthIndicator.java
...work/boot/actuate/cassandra/CassandraHealthIndicator.java
+2
-1
CassandraHealthIndicatorTests.java
...boot/actuate/cassandra/CassandraHealthIndicatorTests.java
+5
-5
No files found.
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cassandra/CassandraHealthIndicator.java
View file @
63be1678
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -32,6 +32,7 @@ import org.springframework.util.Assert;
* Cassandra data stores.
*
* @author Julien Dubois
* @author Alexandre Dutra
* @since 2.0.0
*/
public
class
CassandraHealthIndicator
extends
AbstractHealthIndicator
{
...
...
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/cassandra/CassandraHealthIndicatorTests.java
View file @
63be1678
...
...
@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.cassandra;
import
com.datastax.driver.core.ResultSet
;
import
com.datastax.driver.core.Row
;
import
com.datastax.driver.core.
querybuilder.Selec
t
;
import
com.datastax.driver.core.
Statemen
t
;
import
org.junit.Test
;
import
org.springframework.boot.actuate.health.Health
;
...
...
@@ -51,8 +51,8 @@ public class CassandraHealthIndicatorTests {
ResultSet
resultSet
=
mock
(
ResultSet
.
class
);
CassandraHealthIndicator
healthIndicator
=
new
CassandraHealthIndicator
(
cassandraOperations
);
given
(
cassandraOperations
.
getCqlOperations
()).
willReturn
(
cqlOperations
);
given
(
cqlOperations
.
queryForResultSet
(
any
(
S
elec
t
.
class
))).
willReturn
(
resultSet
);
given
(
resultSet
.
is
Exhaust
ed
()).
willReturn
(
true
);
given
(
cqlOperations
.
queryForResultSet
(
any
(
S
tatemen
t
.
class
))).
willReturn
(
resultSet
);
given
(
resultSet
.
is
FullyFetch
ed
()).
willReturn
(
true
);
Health
health
=
healthIndicator
.
health
();
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
UP
);
}
...
...
@@ -65,8 +65,8 @@ public class CassandraHealthIndicatorTests {
Row
row
=
mock
(
Row
.
class
);
CassandraHealthIndicator
healthIndicator
=
new
CassandraHealthIndicator
(
cassandraOperations
);
given
(
cassandraOperations
.
getCqlOperations
()).
willReturn
(
cqlOperations
);
given
(
cqlOperations
.
queryForResultSet
(
any
(
S
elec
t
.
class
))).
willReturn
(
resultSet
);
given
(
resultSet
.
is
Exhaust
ed
()).
willReturn
(
false
);
given
(
cqlOperations
.
queryForResultSet
(
any
(
S
tatemen
t
.
class
))).
willReturn
(
resultSet
);
given
(
resultSet
.
is
FullyFetch
ed
()).
willReturn
(
false
);
given
(
resultSet
.
one
()).
willReturn
(
row
);
String
expectedVersion
=
"1.0.0"
;
given
(
row
.
getString
(
0
)).
willReturn
(
expectedVersion
);
...
...
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