Java 类org.springframework.data.redis.core.ReactiveRedisOperations 实例源码

项目:spring-session    文件:RedisWebSessionConfigurationTests.java   
@Test
public void qualifiedConnectionFactoryRedisConfig() {
    registerAndRefresh(RedisConfig.class,
            QualifiedConnectionFactoryRedisConfig.class);

    ReactiveRedisOperationsSessionRepository repository = this.context
            .getBean(ReactiveRedisOperationsSessionRepository.class);
    ReactiveRedisConnectionFactory redisConnectionFactory = this.context.getBean(
            "qualifiedRedisConnectionFactory", ReactiveRedisConnectionFactory.class);
    assertThat(repository).isNotNull();
    assertThat(redisConnectionFactory).isNotNull();
    ReactiveRedisOperations redisOperations = (ReactiveRedisOperations) ReflectionTestUtils
            .getField(repository, "sessionRedisOperations");
    assertThat(redisOperations).isNotNull();
    assertThat(ReflectionTestUtils.getField(redisOperations, "connectionFactory"))
            .isEqualTo(redisConnectionFactory);
}
项目:spring-session    文件:RedisWebSessionConfigurationTests.java   
@Test
public void primaryConnectionFactoryRedisConfig() {
    registerAndRefresh(RedisConfig.class, PrimaryConnectionFactoryRedisConfig.class);

    ReactiveRedisOperationsSessionRepository repository = this.context
            .getBean(ReactiveRedisOperationsSessionRepository.class);
    ReactiveRedisConnectionFactory redisConnectionFactory = this.context.getBean(
            "primaryRedisConnectionFactory", ReactiveRedisConnectionFactory.class);
    assertThat(repository).isNotNull();
    assertThat(redisConnectionFactory).isNotNull();
    ReactiveRedisOperations redisOperations = (ReactiveRedisOperations) ReflectionTestUtils
            .getField(repository, "sessionRedisOperations");
    assertThat(redisOperations).isNotNull();
    assertThat(ReflectionTestUtils.getField(redisOperations, "connectionFactory"))
            .isEqualTo(redisConnectionFactory);
}
项目:spring-session    文件:RedisWebSessionConfigurationTests.java   
@Test
public void qualifiedAndPrimaryConnectionFactoryRedisConfig() {
    registerAndRefresh(RedisConfig.class,
            QualifiedAndPrimaryConnectionFactoryRedisConfig.class);

    ReactiveRedisOperationsSessionRepository repository = this.context
            .getBean(ReactiveRedisOperationsSessionRepository.class);
    ReactiveRedisConnectionFactory redisConnectionFactory = this.context.getBean(
            "qualifiedRedisConnectionFactory", ReactiveRedisConnectionFactory.class);
    assertThat(repository).isNotNull();
    assertThat(redisConnectionFactory).isNotNull();
    ReactiveRedisOperations redisOperations = (ReactiveRedisOperations) ReflectionTestUtils
            .getField(repository, "sessionRedisOperations");
    assertThat(redisOperations).isNotNull();
    assertThat(ReflectionTestUtils.getField(redisOperations, "connectionFactory"))
            .isEqualTo(redisConnectionFactory);
}
项目:spring-session    文件:RedisWebSessionConfigurationTests.java   
@Test
public void namedConnectionFactoryRedisConfig() {
    registerAndRefresh(RedisConfig.class, NamedConnectionFactoryRedisConfig.class);

    ReactiveRedisOperationsSessionRepository repository = this.context
            .getBean(ReactiveRedisOperationsSessionRepository.class);
    ReactiveRedisConnectionFactory redisConnectionFactory = this.context
            .getBean("redisConnectionFactory", ReactiveRedisConnectionFactory.class);
    assertThat(repository).isNotNull();
    assertThat(redisConnectionFactory).isNotNull();
    ReactiveRedisOperations redisOperations = (ReactiveRedisOperations) ReflectionTestUtils
            .getField(repository, "sessionRedisOperations");
    assertThat(redisOperations).isNotNull();
    assertThat(ReflectionTestUtils.getField(redisOperations, "connectionFactory"))
            .isEqualTo(redisConnectionFactory);
}
项目:spring-reactive-sample    文件:DemoApplication.java   
public PostRepository(ReactiveRedisOperations<String, Post> template) {
    this.template = template;
}
项目:spring-session    文件:ReactiveRedisOperationsSessionRepository.java   
public ReactiveRedisOperationsSessionRepository(
        ReactiveRedisOperations<String, Object> sessionRedisOperations) {
    Assert.notNull(sessionRedisOperations, "sessionRedisOperations cannot be null");
    this.sessionRedisOperations = sessionRedisOperations;
}