Search in sources :

Example 1 with MongoOperationsSessionRepository

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

the class SessionAutoConfigurationTests method mongoSessionStoreWithCustomizations.

@Test
public void mongoSessionStoreWithCustomizations() {
    load(Arrays.asList(EmbeddedMongoAutoConfiguration.class, MongoAutoConfiguration.class, MongoDataAutoConfiguration.class), "spring.session.store-type=mongo", "spring.session.mongo.collection-name=foobar");
    MongoOperationsSessionRepository repository = validateSessionRepository(MongoOperationsSessionRepository.class);
    assertThat(new DirectFieldAccessor(repository).getPropertyValue("collectionName")).isEqualTo("foobar");
}
Also used : MongoOperationsSessionRepository(org.springframework.session.data.mongo.MongoOperationsSessionRepository) MongoDataAutoConfiguration(org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) EmbeddedMongoAutoConfiguration(org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration) MongoAutoConfiguration(org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration) EmbeddedMongoAutoConfiguration(org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)1 MongoDataAutoConfiguration (org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration)1 MongoAutoConfiguration (org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration)1 EmbeddedMongoAutoConfiguration (org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoConfiguration)1 MongoOperationsSessionRepository (org.springframework.session.data.mongo.MongoOperationsSessionRepository)1