File tree 2 files changed +19
-3
lines changed
main/java/com/netflix/iep/atlas
test/java/com/netflix/iep/atlas
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 26
26
class NoSbnCondition implements Condition {
27
27
@ Override
28
28
public boolean matches (ConditionContext context , AnnotatedTypeMetadata metadata ) {
29
- String v = context .getEnvironment ().getProperty ("management.metrics.export.atlas.enabled" );
30
- return v == null ;
29
+ String sbn2 = context .getEnvironment ().getProperty ("management.metrics.export.atlas.enabled" );
30
+ String sbn3 = context .getEnvironment ().getProperty ("management.atlas.metrics.export.enabled" );
31
+ return sbn2 == null && sbn3 == null ;
31
32
}
32
33
}
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public void registryIsBound() {
43
43
}
44
44
45
45
@ Test (expected = NoSuchBeanDefinitionException .class )
46
- public void registryIsNotBoundIfSbnIsPresent () {
46
+ public void registryIsNotBoundIfSbn2IsPresent () {
47
47
Map <String , Object > props = new HashMap <>();
48
48
props .put ("management.metrics.export.atlas.enabled" , "true" );
49
49
try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext ()) {
@@ -56,4 +56,19 @@ public void registryIsNotBoundIfSbnIsPresent() {
56
56
context .getBean (Registry .class );
57
57
}
58
58
}
59
+
60
+ @ Test (expected = NoSuchBeanDefinitionException .class )
61
+ public void registryIsNotBoundIfSbn3IsPresent () {
62
+ Map <String , Object > props = new HashMap <>();
63
+ props .put ("management.atlas.metrics.export.enabled" , "true" );
64
+ try (AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext ()) {
65
+ context .getEnvironment ()
66
+ .getPropertySources ()
67
+ .addFirst (new MapPropertySource ("test" , props ));
68
+ context .register (AtlasConfiguration .class );
69
+ context .refresh ();
70
+ context .start ();
71
+ context .getBean (Registry .class );
72
+ }
73
+ }
59
74
}
You can’t perform that action at this time.
0 commit comments