File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
src/test/java/com/rabbitmq/client/amqp/impl Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,18 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con
359359 }
360360 }
361361
362+ static class DisabledIfWebSocketCondition implements ExecutionCondition {
363+
364+ @ Override
365+ public ConditionEvaluationResult evaluateExecutionCondition (ExtensionContext context ) {
366+ if (useWebSocket ()) {
367+ return ConditionEvaluationResult .disabled ("Testing against WebSocket" );
368+ } else {
369+ return ConditionEvaluationResult .enabled ("Not testing against WebSocket" );
370+ }
371+ }
372+ }
373+
362374 static class DisabledIfAddressV1PermittedCondition implements ExecutionCondition {
363375
364376 private static final String KEY = "addressV1Permitted" ;
@@ -500,6 +512,12 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con
500512 @ ExtendWith (DisabledIfTlsNotEnabledCondition .class )
501513 public @interface DisabledIfTlsNotEnabled {}
502514
515+ @ Target ({ElementType .TYPE , ElementType .METHOD })
516+ @ Retention (RetentionPolicy .RUNTIME )
517+ @ Documented
518+ @ ExtendWith (DisabledIfWebSocketCondition .class )
519+ public @interface DisabledIfWebSocket {}
520+
503521 @ Target ({ElementType .TYPE , ElementType .METHOD })
504522 @ Retention (RetentionPolicy .RUNTIME )
505523 @ Documented
Original file line number Diff line number Diff line change 2727import com .rabbitmq .client .amqp .AmqpException .AmqpSecurityException ;
2828import com .rabbitmq .client .amqp .impl .TestUtils .DisabledIfAuthMechanismSslNotEnabled ;
2929import com .rabbitmq .client .amqp .impl .TestUtils .DisabledIfTlsNotEnabled ;
30+ import com .rabbitmq .client .amqp .impl .TestUtils .DisabledIfWebSocket ;
3031import java .security .cert .X509Certificate ;
3132import java .util .UUID ;
3233import java .util .concurrent .CountDownLatch ;
@@ -214,12 +215,13 @@ void hostnameVerificationShouldFailWhenSettingHostToLoopbackInterface() throws E
214215 }
215216
216217 @ Test
218+ @ DisabledIfWebSocket
217219 void connectToLoopbackInterfaceShouldWorkIfNoHostnameVerification () throws Exception {
218220 SSLContext sslContext = sslContext (trustManagerFactory (caCertificate ()));
219221 try (Connection ignored =
220222 environment
221223 .connectionBuilder ()
222- .host ("127.0.01 " )
224+ .host ("127.0.0.1 " )
223225 .tls ()
224226 .sslContext (sslContext )
225227 .hostnameVerification (false )
You can’t perform that action at this time.
0 commit comments