Search in sources :

Example 1 with RedisServiceInfo

use of org.springframework.cloud.service.common.RedisServiceInfo in project spring-cloud-connectors by spring-cloud.

the class RedisServiceConnectorCreatorTest method cloudRedisCreationSecureConnection.

@Test
public void cloudRedisCreationSecureConnection() {
    RedisServiceInfo serviceInfo = createServiceInfo(RedisServiceInfo.REDISS_SCHEME);
    RedisConnectionFactory dataSource = testCreator.create(serviceInfo, null);
    assertConnectorProperties(serviceInfo, dataSource, true);
}
Also used : RedisServiceInfo(org.springframework.cloud.service.common.RedisServiceInfo) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) Test(org.junit.Test)

Example 2 with RedisServiceInfo

use of org.springframework.cloud.service.common.RedisServiceInfo in project spring-cloud-connectors by spring-cloud.

the class SpringData1RedisServiceConnectorCreatorTest method cloudRedisCreationNoConfig.

@Test
public void cloudRedisCreationNoConfig() throws Exception {
    RedisServiceInfo serviceInfo = createServiceInfo();
    RedisConnectionFactory dataSource = testCreator.create(serviceInfo, null);
    assertConnectorProperties(serviceInfo, dataSource);
}
Also used : RedisServiceInfo(org.springframework.cloud.service.common.RedisServiceInfo) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) Test(org.junit.Test)

Example 3 with RedisServiceInfo

use of org.springframework.cloud.service.common.RedisServiceInfo in project spring-cloud-connectors by spring-cloud.

the class LocalConfigConnectorRedisServiceTest method serviceCreation.

@Test
public void serviceCreation() {
    List<ServiceInfo> services = connector.getServiceInfos();
    ServiceInfo service = getServiceInfo(services, "blue");
    assertNotNull(service);
    assertTrue(service instanceof RedisServiceInfo);
    assertUriParameters((RedisServiceInfo) service);
}
Also used : ServiceInfo(org.springframework.cloud.service.ServiceInfo) RedisServiceInfo(org.springframework.cloud.service.common.RedisServiceInfo) RedisServiceInfo(org.springframework.cloud.service.common.RedisServiceInfo) Test(org.junit.Test)

Example 4 with RedisServiceInfo

use of org.springframework.cloud.service.common.RedisServiceInfo in project spring-cloud-connectors by spring-cloud.

the class HerokuConnectorRedisServiceTest method redisServiceCreation.

@Test
public void redisServiceCreation() {
    for (String redisEnv : new String[] { "REDISTOGO_URL", "REDISCLOUD_URL", "OPENREDIS_URL", "REDISGREEN_URL", "REDIS_URL" }) {
        Map<String, String> env = new HashMap<String, String>();
        String redisUrl = getRedisServiceUrl();
        env.put(redisEnv, redisUrl);
        when(mockEnvironment.getEnv()).thenReturn(env);
        List<ServiceInfo> serviceInfos = testCloudConnector.getServiceInfos();
        ServiceInfo serviceInfo = getServiceInfo(serviceInfos, redisEnv.substring(0, redisEnv.length() - 4));
        assertNotNull(serviceInfo);
        assertTrue(serviceInfo instanceof RedisServiceInfo);
        assertRedisServiceInfo((RedisServiceInfo) serviceInfo);
    }
}
Also used : ServiceInfo(org.springframework.cloud.service.ServiceInfo) RedisServiceInfo(org.springframework.cloud.service.common.RedisServiceInfo) RedisServiceInfo(org.springframework.cloud.service.common.RedisServiceInfo) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 5 with RedisServiceInfo

use of org.springframework.cloud.service.common.RedisServiceInfo in project spring-cloud-connectors by spring-cloud.

the class RedisServiceConnectorCreatorTest method cloudRedisCreationNoConfig.

@Test
public void cloudRedisCreationNoConfig() {
    RedisServiceInfo serviceInfo = createServiceInfo(RedisServiceInfo.REDIS_SCHEME);
    RedisConnectionFactory dataSource = testCreator.create(serviceInfo, null);
    assertConnectorProperties(serviceInfo, dataSource, false);
}
Also used : RedisServiceInfo(org.springframework.cloud.service.common.RedisServiceInfo) RedisConnectionFactory(org.springframework.data.redis.connection.RedisConnectionFactory) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 RedisServiceInfo (org.springframework.cloud.service.common.RedisServiceInfo)6 RedisConnectionFactory (org.springframework.data.redis.connection.RedisConnectionFactory)3 ServiceInfo (org.springframework.cloud.service.ServiceInfo)2 HashMap (java.util.HashMap)1 Properties (java.util.Properties)1 CloudTestUtil.getTestCloudConnector (org.springframework.cloud.CloudTestUtil.getTestCloudConnector)1