From 6eb0449aa9566a4952c8c187af35d543f2694752 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 12 Sep 2016 16:30:07 +0200 Subject: [PATCH] Use BDD mockito See gh-6869 --- .../boot/actuate/health/JmsHealthIndicatorTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/JmsHealthIndicatorTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/JmsHealthIndicatorTests.java index 84f8f5b38f..76f2beffea 100644 --- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/JmsHealthIndicatorTests.java +++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/JmsHealthIndicatorTests.java @@ -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.doThrow(new JMSException("Could not start", "123")) - .when(connection).start(); + willThrow(new JMSException("Could not start", "123")) + .given(connection).start(); given(connectionFactory.createConnection()) .willReturn(connection); JmsHealthIndicator indicator = new JmsHealthIndicator(connectionFactory);