Unit tests for custom profile annotations on configuration classes

Issue: SPR-11808
This commit is contained in:
Juergen Hoeller 2014-05-30 22:04:40 +02:00
parent 31f2f20307
commit 5eecb138f6
1 changed files with 13 additions and 3 deletions

View File

@ -42,7 +42,7 @@ public @interface MetaContextHierarchyConfig {
}
@Configuration
@Profile("dev")
@DevProfile
class DevConfig {
@Bean
@ -52,11 +52,21 @@ class DevConfig {
}
@Configuration
@Profile("prod")
@ProdProfile
class ProductionConfig {
@Bean
public String foo() {
return "Production Foo";
}
}
}
@Profile("dev")
@Retention(RetentionPolicy.RUNTIME)
@interface DevProfile {
}
@Profile("prod")
@Retention(RetentionPolicy.RUNTIME)
@interface ProdProfile {
}