File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/amqp Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -67,14 +67,6 @@ void healthWhenConnectionSucceedsShouldReturnUpWithVersion() {
6767 assertThat (health .getDetails ()).containsEntry ("version" , "123" );
6868 }
6969
70- @ Test
71- void healthWhenConnectionFailsShouldReturnDown () {
72- givenTemplateExecutionWillInvokeCallback ();
73- given (this .channel .getConnection ()).willThrow (new RuntimeException ());
74- Health health = new RabbitHealthIndicator (this .rabbitTemplate ).health ();
75- assertThat (health .getStatus ()).isEqualTo (Status .DOWN );
76- }
77-
7870 @ Test
7971 void healthWhenVersionIsMissingShouldReturnUpWithUnknownVersion () {
8072 givenTemplateExecutionWillInvokeCallback ();
@@ -86,6 +78,14 @@ void healthWhenVersionIsMissingShouldReturnUpWithUnknownVersion() {
8678 assertThat (health .getDetails ()).containsEntry ("version" , "unknown" );
8779 }
8880
81+ @ Test
82+ void healthWhenConnectionFailsShouldReturnDown () {
83+ givenTemplateExecutionWillInvokeCallback ();
84+ given (this .channel .getConnection ()).willThrow (new RuntimeException ());
85+ Health health = new RabbitHealthIndicator (this .rabbitTemplate ).health ();
86+ assertThat (health .getStatus ()).isEqualTo (Status .DOWN );
87+ }
88+
8989 private void givenTemplateExecutionWillInvokeCallback () {
9090 given (this .rabbitTemplate .execute (any ())).willAnswer ((invocation ) -> {
9191 ChannelCallback <?> callback = invocation .getArgument (0 );
You can’t perform that action at this time.
0 commit comments