Search in sources :

Example 1 with CompositeDatabasePopulator

use of org.springframework.r2dbc.connection.init.CompositeDatabasePopulator in project spring-security by spring-projects.

the class R2dbcReactiveOAuth2AuthorizedClientServiceTests method createDb.

private static ConnectionFactoryInitializer createDb(String schema) {
    ConnectionFactoryInitializer initializer = new ConnectionFactoryInitializer();
    CompositeDatabasePopulator populator = new CompositeDatabasePopulator();
    populator.addPopulators(new ResourceDatabasePopulator(new ClassPathResource(schema)));
    initializer.setDatabasePopulator(populator);
    return initializer;
}
Also used : ResourceDatabasePopulator(org.springframework.r2dbc.connection.init.ResourceDatabasePopulator) ConnectionFactoryInitializer(org.springframework.r2dbc.connection.init.ConnectionFactoryInitializer) CompositeDatabasePopulator(org.springframework.r2dbc.connection.init.CompositeDatabasePopulator) ClassPathResource(org.springframework.core.io.ClassPathResource)

Aggregations

ClassPathResource (org.springframework.core.io.ClassPathResource)1 CompositeDatabasePopulator (org.springframework.r2dbc.connection.init.CompositeDatabasePopulator)1 ConnectionFactoryInitializer (org.springframework.r2dbc.connection.init.ConnectionFactoryInitializer)1 ResourceDatabasePopulator (org.springframework.r2dbc.connection.init.ResourceDatabasePopulator)1