Example usage for org.springframework.amqp.rabbit.connection RabbitConnectionFactoryBean setTrustStoreType

List of usage examples for org.springframework.amqp.rabbit.connection RabbitConnectionFactoryBean setTrustStoreType

Introduction

In this page you can find the example usage for org.springframework.amqp.rabbit.connection RabbitConnectionFactoryBean setTrustStoreType.

Prototype

public void setTrustStoreType(String trustStoreType) 

Source Link

Document

Set the trust store type - overrides the property in #setSslPropertiesLocation(Resource) .

Usage

From source file:org.springframework.amqp.rabbit.connection.SSLConnectionTests.java

@Test
public void testTypeSettersNoProps() throws Exception {
    RabbitConnectionFactoryBean fb = new RabbitConnectionFactoryBean();
    fb.setKeyStoreType("alice");
    fb.setTrustStoreType("bob");
    assertEquals("alice", fb.getKeyStoreType());
    assertEquals("bob", fb.getTrustStoreType());
}

From source file:org.springframework.amqp.rabbit.connection.SSLConnectionTests.java

@Test
public void testTypeSettersOverrideProps() throws Exception {
    RabbitConnectionFactoryBean fb = new RabbitConnectionFactoryBean();
    fb.setSslPropertiesLocation(new ClassPathResource("ssl.properties"));
    fb.afterPropertiesSet();//w w  w .  j  a va 2s .c om
    fb.setKeyStoreType("alice");
    fb.setTrustStoreType("bob");
    try {
        fb.setUpSSL();
        // Here we make sure the exception is thrown because setUpSSL() will fail.
        //But we only care about having it load the props
        fail("setupSSL should fail");
    } catch (Exception e) {
        assertEquals("alice", fb.getKeyStoreType());
        assertEquals("bob", fb.getTrustStoreType());
    }
}