@Test
public void testConfigureFactory_withSslEnabled() throws Exception {

	int port = 18547;
	ConnectionFactory factory = Mockito.mock( ConnectionFactory.class );
	String keyPassPhrase = "key store";
	File keyStore = generateKeyStore( keyPassPhrase, RabbitMqConstants.DEFAULT_SSL_KEY_STORE_TYPE );
	String trustPassPhrase = "trust store";
	File trustStore = generateKeyStore( trustPassPhrase, RabbitMqConstants.DEFAULT_SSL_TRUST_STORE_TYPE );
	Map<String,String> configuration = new HashMap<> ();
	configuration.put( RABBITMQ_SERVER_IP, "http://roboconf.net:" + port );
	configuration.put( RABBITMQ_SERVER_USERNAME, "toto" );
	configuration.put( RABBITMQ_SERVER_PASSWORD, "123456789" );
	configuration.put( RABBITMQ_SSL_KEY_STORE_PATH, keyStore.getAbsolutePath());
	configuration.put( RABBITMQ_SSL_KEY_STORE_PASSPHRASE, keyPassPhrase );
	configuration.put( RABBITMQ_SSL_TRUST_STORE_PATH, trustStore.getAbsolutePath());
	configuration.put( RABBITMQ_SSL_TRUST_STORE_PASSPHRASE, trustPassPhrase );
	configuration.put( RABBITMQ_SSL_AS_USER_DATA, "true" );
	configuration.put( RABBITMQ_USE_SSL, "true" );
	RabbitMqUtils.configureFactory( factory, configuration );
	Mockito.verify( factory ).setUsername( "toto" );
	Mockito.verify( factory ).setPassword( "123456789" );
	Mockito.verify( factory ).setHost( "http://roboconf.net" );
	Mockito.verify( factory ).setPort( port );
	Mockito.verify( factory ).setConnectionTimeout( Mockito.anyInt());
	Mockito.verify( factory ).setAutomaticRecoveryEnabled( true );
	Mockito.verify( factory ).setNetworkRecoveryInterval( Mockito.anyInt());
	Mockito.verify( factory ).setTopologyRecoveryEnabled( true );
	Mockito.verify( factory ).useSslProtocol( Mockito.any( SSLContext.class ));
	Mockito.verifyZeroInteractions( factory );
}