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
d8a05090
Commit
d8a05090
authored
Dec 05, 2020
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix checkstyle BDD Mockito violations
See gh-24337
parent
837fc835
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
HazelcastHealthIndicatorTests.java
...boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java
+6
-6
No files found.
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/hazelcast/HazelcastHealthIndicatorTests.java
View file @
d8a05090
...
@@ -27,7 +27,7 @@ import org.springframework.boot.actuate.health.Status;
...
@@ -27,7 +27,7 @@ import org.springframework.boot.actuate.health.Status;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
BDDMockito
.
wh
en
;
import
static
org
.
mockito
.
BDDMockito
.
giv
en
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
/**
...
@@ -43,10 +43,10 @@ class HazelcastHealthIndicatorTests {
...
@@ -43,10 +43,10 @@ class HazelcastHealthIndicatorTests {
@Test
@Test
void
hazelcastUp
()
{
void
hazelcastUp
()
{
Endpoint
endpoint
=
mock
(
Endpoint
.
class
);
Endpoint
endpoint
=
mock
(
Endpoint
.
class
);
when
(
this
.
hazelcast
.
getName
()).
then
Return
(
"hz0-instance"
);
given
(
this
.
hazelcast
.
getName
()).
will
Return
(
"hz0-instance"
);
when
(
this
.
hazelcast
.
getLocalEndpoint
()).
then
Return
(
endpoint
);
given
(
this
.
hazelcast
.
getLocalEndpoint
()).
will
Return
(
endpoint
);
when
(
endpoint
.
getUuid
()).
then
Return
(
"7581bb2f-879f-413f-b574-0071d7519eb0"
);
given
(
endpoint
.
getUuid
()).
will
Return
(
"7581bb2f-879f-413f-b574-0071d7519eb0"
);
when
(
this
.
hazelcast
.
executeTransaction
(
any
())).
then
Answer
((
invocation
)
->
{
given
(
this
.
hazelcast
.
executeTransaction
(
any
())).
will
Answer
((
invocation
)
->
{
TransactionalTask
<?>
task
=
invocation
.
getArgument
(
0
);
TransactionalTask
<?>
task
=
invocation
.
getArgument
(
0
);
return
task
.
execute
(
null
);
return
task
.
execute
(
null
);
});
});
...
@@ -58,7 +58,7 @@ class HazelcastHealthIndicatorTests {
...
@@ -58,7 +58,7 @@ class HazelcastHealthIndicatorTests {
@Test
@Test
void
hazelcastDown
()
{
void
hazelcastDown
()
{
when
(
this
.
hazelcast
.
executeTransaction
(
any
())).
thenThrow
(
new
HazelcastException
());
given
(
this
.
hazelcast
.
executeTransaction
(
any
())).
willReturn
(
new
HazelcastException
());
Health
health
=
new
HazelcastHealthIndicator
(
this
.
hazelcast
).
health
();
Health
health
=
new
HazelcastHealthIndicator
(
this
.
hazelcast
).
health
();
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
DOWN
);
assertThat
(
health
.
getStatus
()).
isEqualTo
(
Status
.
DOWN
);
}
}
...
...
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