22
22
23
23
import com .rabbitmq .client .Address ;
24
24
import com .rabbitmq .client .NullTrustManager ;
25
+ import com .rabbitmq .client .TrustEverythingTrustManager ;
25
26
import org .aopalliance .aop .Advice ;
26
27
import org .junit .After ;
27
28
import org .junit .Rule ;
66
67
*
67
68
* @author Greg Turnquist
68
69
* @author Stephane Nicoll
69
- * @author Gary Russell
70
- * @author Stephane Nicoll
71
70
*/
72
71
public class RabbitAutoConfigurationTests {
73
72
@@ -438,7 +437,7 @@ public void enableSslWithValidateServerCertificateFalse() throws Exception {
438
437
"spring.rabbitmq.ssl.validateServerCertificate=false" );
439
438
com .rabbitmq .client .ConnectionFactory rabbitConnectionFactory = getTargetConnectionFactory ();
440
439
TrustManager trustManager = getTrustManager (rabbitConnectionFactory );
441
- assertThat (trustManager ).isInstanceOf (NullTrustManager .class );
440
+ assertThat (trustManager ).isInstanceOf (TrustEverythingTrustManager .class );
442
441
}
443
442
444
443
@ Test
@@ -449,7 +448,7 @@ public void enableSslWithValidateServerCertificateDefault() throws Exception {
449
448
assertThat (trustManager ).isNotInstanceOf (NullTrustManager .class );
450
449
}
451
450
452
- private TrustManager getTrustManager (
451
+ protected TrustManager getTrustManager (
453
452
com .rabbitmq .client .ConnectionFactory rabbitConnectionFactory ) {
454
453
Object sslContext = ReflectionTestUtils .getField (rabbitConnectionFactory ,
455
454
"sslContext" );
@@ -461,7 +460,7 @@ private TrustManager getTrustManager(
461
460
return (TrustManager ) trustManager ;
462
461
}
463
462
464
- private com .rabbitmq .client .ConnectionFactory getTargetConnectionFactory () {
463
+ protected com .rabbitmq .client .ConnectionFactory getTargetConnectionFactory () {
465
464
CachingConnectionFactory connectionFactory = this .context
466
465
.getBean (CachingConnectionFactory .class );
467
466
return (com .rabbitmq .client .ConnectionFactory ) new DirectFieldAccessor (
@@ -475,7 +474,7 @@ private boolean getMandatory(RabbitTemplate rabbitTemplate) {
475
474
return expression .getValue ();
476
475
}
477
476
478
- private void load (Class <?> config , String ... environment ) {
477
+ protected void load (Class <?> config , String ... environment ) {
479
478
load (new Class <?>[] { config }, environment );
480
479
}
481
480
0 commit comments