From 839e686c9ef290a4183936d11e5ac10a8f7b56ed Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 10 Oct 2018 12:43:06 +0100 Subject: [PATCH] Fix Checkstyle violation --- .../boot/actuate/jms/JmsHealthIndicatorTests.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jms/JmsHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jms/JmsHealthIndicatorTests.java index 3dfed04051..bd70ac34f6 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jms/JmsHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/jms/JmsHealthIndicatorTests.java @@ -30,8 +30,8 @@ import org.springframework.boot.actuate.health.Status; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.BDDMockito.given; +import static org.mockito.BDDMockito.willAnswer; import static org.mockito.BDDMockito.willThrow; -import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -106,11 +106,11 @@ public class JmsHealthIndicatorTests { given(connectionMetaData.getJMSProviderName()).willReturn("JMS test provider"); Connection connection = mock(Connection.class); UnresponsiveStartAnswer unresponsiveStartAnswer = new UnresponsiveStartAnswer(); - doAnswer(unresponsiveStartAnswer).when(connection).start(); - doAnswer((invocation) -> { + willAnswer(unresponsiveStartAnswer).given(connection).start(); + willAnswer((invocation) -> { unresponsiveStartAnswer.connectionClosed(); return null; - }).when(connection).close(); + }).given(connection).close(); ConnectionFactory connectionFactory = mock(ConnectionFactory.class); given(connectionFactory.createConnection()).willReturn(connection); JmsHealthIndicator indicator = new JmsHealthIndicator(connectionFactory);