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
359
359
}
360
360
}
361
361
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
+
362
374
static class DisabledIfAddressV1PermittedCondition implements ExecutionCondition {
363
375
364
376
private static final String KEY = "addressV1Permitted" ;
@@ -500,6 +512,12 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con
500
512
@ ExtendWith (DisabledIfTlsNotEnabledCondition .class )
501
513
public @interface DisabledIfTlsNotEnabled {}
502
514
515
+ @ Target ({ElementType .TYPE , ElementType .METHOD })
516
+ @ Retention (RetentionPolicy .RUNTIME )
517
+ @ Documented
518
+ @ ExtendWith (DisabledIfWebSocketCondition .class )
519
+ public @interface DisabledIfWebSocket {}
520
+
503
521
@ Target ({ElementType .TYPE , ElementType .METHOD })
504
522
@ Retention (RetentionPolicy .RUNTIME )
505
523
@ Documented
Original file line number Diff line number Diff line change 27
27
import com .rabbitmq .client .amqp .AmqpException .AmqpSecurityException ;
28
28
import com .rabbitmq .client .amqp .impl .TestUtils .DisabledIfAuthMechanismSslNotEnabled ;
29
29
import com .rabbitmq .client .amqp .impl .TestUtils .DisabledIfTlsNotEnabled ;
30
+ import com .rabbitmq .client .amqp .impl .TestUtils .DisabledIfWebSocket ;
30
31
import java .security .cert .X509Certificate ;
31
32
import java .util .UUID ;
32
33
import java .util .concurrent .CountDownLatch ;
@@ -214,12 +215,13 @@ void hostnameVerificationShouldFailWhenSettingHostToLoopbackInterface() throws E
214
215
}
215
216
216
217
@ Test
218
+ @ DisabledIfWebSocket
217
219
void connectToLoopbackInterfaceShouldWorkIfNoHostnameVerification () throws Exception {
218
220
SSLContext sslContext = sslContext (trustManagerFactory (caCertificate ()));
219
221
try (Connection ignored =
220
222
environment
221
223
.connectionBuilder ()
222
- .host ("127.0.01 " )
224
+ .host ("127.0.0.1 " )
223
225
.tls ()
224
226
.sslContext (sslContext )
225
227
.hostnameVerification (false )
You can’t perform that action at this time.
0 commit comments