@Test public void mongoSessionStore() { load(Arrays.asList(EmbeddedMongoAutoConfiguration.class, MongoAutoConfiguration.class, MongoDataAutoConfiguration.class), "spring.session.store-type=mongo", "spring.data.mongodb.port=0"); validateSessionRepository(MongoOperationsSessionRepository.class); }
@Test public void mongoSessionStoreWithCustomizations() { load(Arrays.asList(EmbeddedMongoAutoConfiguration.class, MongoAutoConfiguration.class, MongoDataAutoConfiguration.class), "spring.session.store-type=mongo", "spring.data.mongodb.port=0", "spring.session.mongo.collection-name=foobar"); MongoOperationsSessionRepository repository = validateSessionRepository( MongoOperationsSessionRepository.class); assertThat(new DirectFieldAccessor(repository).getPropertyValue("collectionName")) .isEqualTo("foobar"); }