use of org.springframework.context.annotation.Profile in project tutorials by eugenp.
the class H2TestProfileJPAConfig method dataSource.
@Bean
@Profile("test")
public DataSource dataSource() {
final DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("org.h2.Driver");
dataSource.setUrl("jdbc:h2:mem:db;DB_CLOSE_DELAY=-1");
dataSource.setUsername("sa");
dataSource.setPassword("sa");
return dataSource;
}
use of org.springframework.context.annotation.Profile in project nakadi by zalando.
the class RepositoriesConfig method featureToggleServiceLocal.
@Profile({ "acceptanceTest", "local" })
@Bean
public FeatureToggleService featureToggleServiceLocal(final ZooKeeperHolder zooKeeperHolder, final FeaturesConfig featuresConfig) {
final FeatureToggleService featureToggleService = new FeatureToggleServiceZk(zooKeeperHolder);
if (featuresConfig.containsDefaults()) {
final Set<String> features = featuresConfig.getFeaturesWithDefaultState();
for (final String feature : features) {
LOG.info("Setting feature {} to {}", feature, featuresConfig.getDefaultState(feature));
featureToggleService.setFeature(new FeatureToggleService.FeatureWrapper(FeatureToggleService.Feature.valueOf(feature), featuresConfig.getDefaultState(feature)));
}
}
return featureToggleService;
}
use of org.springframework.context.annotation.Profile in project pivotal-cla by pivotalsoftware.
the class SessionConfig method cloudRedisConnectionFactory.
@Profile(GitHubClaProfiles.CLOUDFOUNDRY)
@Bean
public RedisConnectionFactory cloudRedisConnectionFactory() {
CloudFactory cloudFactory = new CloudFactory();
Cloud cloud = cloudFactory.getCloud();
RedisConnectionFactory connectionFactory = cloud.getSingletonServiceConnector(RedisConnectionFactory.class, null);
if (connectionFactory instanceof LettuceConnectionFactory) {
((LettuceConnectionFactory) connectionFactory).setShutdownTimeout(0);
}
return connectionFactory;
}
use of org.springframework.context.annotation.Profile in project alien4cloud by alien4cloud.
the class SecurityConfiguration method demoAuthenticationProvider.
@Bean
@Profile("security-demo")
public DaoAuthenticationProvider demoAuthenticationProvider() {
log.warn("ALIEN 4 CLOUD is Running in DEMO mode. This includes demo users and MUST NOT BE USED in PRODUCTION");
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
List<UserDetails> users = getUsers(new String[] { "user", "componentManager", "componentBrowser", "applicationManager", "appManager", "admin", "architect" }, new String[] { "COMPONENTS_BROWSER", "COMPONENTS_BROWSER, COMPONENTS_MANAGER", "COMPONENTS_BROWSER", "APPLICATIONS_MANAGER, COMPONENTS_BROWSER, COMPONENTS_MANAGER", "APPLICATIONS_MANAGER, COMPONENTS_BROWSER, COMPONENTS_MANAGER", "ADMIN", "ARCHITECT, COMPONENTS_BROWSER" });
InMemoryUserDetailsManager detailsManager = new InMemoryUserDetailsManager(users);
provider.setUserDetailsService(detailsManager);
return provider;
}
use of org.springframework.context.annotation.Profile in project av-service by dvoraka.
the class CoreConfig method mbeanExporter.
/**
* Special MBeanExporter bean for integration tests.
*
* @return MBeanExporter with a different registration strategy
*/
@Bean
@Profile("itest")
public MBeanExporter mbeanExporter() {
MBeanExporter exporter = new MBeanExporter();
exporter.setRegistrationPolicy(RegistrationPolicy.REPLACE_EXISTING);
return exporter;
}
Aggregations