Search in sources :

Example 1 with ReactiveMongoSessionRepository

use of org.springframework.session.data.mongo.ReactiveMongoSessionRepository in project spring-boot by spring-projects.

the class ReactiveSessionAutoConfigurationMongoTests method defaultConfigWithCustomTimeout.

@Test
void defaultConfigWithCustomTimeout() {
    this.contextRunner.withPropertyValues("spring.session.store-type=mongodb", "spring.session.timeout=1m", "spring.data.mongodb.uri=" + mongoDb.getReplicaSetUrl()).withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class, MongoReactiveAutoConfiguration.class, MongoReactiveDataAutoConfiguration.class)).run((context) -> {
        ReactiveMongoSessionRepository repository = validateSessionRepository(context, ReactiveMongoSessionRepository.class);
        assertThat(repository).hasFieldOrPropertyWithValue("maxInactiveIntervalInSeconds", 60);
    });
}
Also used : ReactiveMongoSessionRepository(org.springframework.session.data.mongo.ReactiveMongoSessionRepository) Test(org.junit.jupiter.api.Test)

Example 2 with ReactiveMongoSessionRepository

use of org.springframework.session.data.mongo.ReactiveMongoSessionRepository in project spring-boot by spring-projects.

the class ReactiveSessionAutoConfigurationMongoTests method defaultConfigWithCustomSessionTimeout.

@Test
void defaultConfigWithCustomSessionTimeout() {
    this.contextRunner.withPropertyValues("spring.session.store-type=mongodb", "server.reactive.session.timeout=1m", "spring.data.mongodb.uri=" + mongoDb.getReplicaSetUrl()).withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class, MongoReactiveAutoConfiguration.class, MongoReactiveDataAutoConfiguration.class)).run((context) -> {
        ReactiveMongoSessionRepository repository = validateSessionRepository(context, ReactiveMongoSessionRepository.class);
        assertThat(repository).hasFieldOrPropertyWithValue("maxInactiveIntervalInSeconds", 60);
    });
}
Also used : ReactiveMongoSessionRepository(org.springframework.session.data.mongo.ReactiveMongoSessionRepository) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)2 ReactiveMongoSessionRepository (org.springframework.session.data.mongo.ReactiveMongoSessionRepository)2