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
6eb0449a
Commit
6eb0449a
authored
Sep 12, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use BDD mockito
See gh-6869
parent
b88cb35e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
JmsHealthIndicatorTests.java
...ramework/boot/actuate/health/JmsHealthIndicatorTests.java
+3
-3
No files found.
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/JmsHealthIndicatorTests.java
View file @
6eb0449a
...
...
@@ -22,10 +22,10 @@ import javax.jms.ConnectionMetaData;
import
javax.jms.JMSException
;
import
org.junit.Test
;
import
org.mockito.Mockito
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
mockito
.
BDDMockito
.
given
;
import
static
org
.
mockito
.
BDDMockito
.
willThrow
;
import
static
org
.
mockito
.
Mockito
.
mock
;
import
static
org
.
mockito
.
Mockito
.
times
;
import
static
org
.
mockito
.
Mockito
.
verify
;
...
...
@@ -86,8 +86,8 @@ public class JmsHealthIndicatorTests {
given
(
connectionMetaData
.
getJMSProviderName
()).
willReturn
(
"JMS test provider"
);
Connection
connection
=
mock
(
Connection
.
class
);
given
(
connection
.
getMetaData
()).
willReturn
(
connectionMetaData
);
Mockito
.
do
Throw
(
new
JMSException
(
"Could not start"
,
"123"
))
.
wh
en
(
connection
).
start
();
will
Throw
(
new
JMSException
(
"Could not start"
,
"123"
))
.
giv
en
(
connection
).
start
();
given
(
connectionFactory
.
createConnection
())
.
willReturn
(
connection
);
JmsHealthIndicator
indicator
=
new
JmsHealthIndicator
(
connectionFactory
);
...
...
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