@@ -25,16 +25,14 @@ class AgentConfigTest {
25
25
@ ArgumentsSource (InstrumentationEnabledParams .class )
26
26
void testIsInstrumentationEnabled (
27
27
@ SuppressWarnings ("unused" ) String description ,
28
- boolean firstEnabled ,
29
- boolean secondEnabled ,
28
+ Boolean firstEnabled ,
29
+ Boolean secondEnabled ,
30
30
boolean defaultEnabled ,
31
31
boolean expected ) {
32
32
33
33
ConfigProperties config = mock (ConfigProperties .class );
34
- when (config .getBoolean ("otel.instrumentation.first.enabled" , defaultEnabled ))
35
- .thenReturn (firstEnabled );
36
- when (config .getBoolean ("otel.instrumentation.second.enabled" , defaultEnabled ))
37
- .thenReturn (secondEnabled );
34
+ when (config .getBoolean ("otel.instrumentation.first.enabled" )).thenReturn (firstEnabled );
35
+ when (config .getBoolean ("otel.instrumentation.second.enabled" )).thenReturn (secondEnabled );
38
36
39
37
assertEquals (
40
38
expected ,
@@ -49,13 +47,41 @@ public Stream<? extends Arguments> provideArguments(ExtensionContext context) {
49
47
return Stream .of (
50
48
Arguments .of (
51
49
"enabled by default, both instrumentations are off" , false , false , true , false ),
52
- Arguments .of ("enabled by default, one instrumentation is on" , true , false , true , false ),
50
+ Arguments .of ("enabled by default, first instrumentation is on" , true , null , true , true ),
51
+ Arguments .of ("enabled by default, second instrumentation is on" , null , true , true , true ),
53
52
Arguments .of ("enabled by default, both instrumentations are on" , true , true , true , true ),
53
+ Arguments .of (
54
+ "enabled by default, first instrumentation is off, second is on" ,
55
+ false ,
56
+ true ,
57
+ true ,
58
+ false ),
59
+ Arguments .of (
60
+ "enabled by default, first instrumentation is on, second is off" ,
61
+ true ,
62
+ false ,
63
+ true ,
64
+ true ),
65
+ Arguments .of ("enabled by default" , null , null , true , true ),
54
66
Arguments .of (
55
67
"disabled by default, both instrumentations are off" , false , false , false , false ),
56
- Arguments .of ("disabled by default, one instrumentation is on" , true , false , false , true ),
68
+ Arguments .of ("disabled by default, first instrumentation is on" , true , null , false , true ),
69
+ Arguments .of (
70
+ "disabled by default, second instrumentation is on" , null , true , false , true ),
71
+ Arguments .of ("disabled by default, both instrumentation are on" , true , true , false , true ),
72
+ Arguments .of (
73
+ "disabled by default, first instrumentation is off, second is on" ,
74
+ false ,
75
+ true ,
76
+ false ,
77
+ false ),
57
78
Arguments .of (
58
- "disabled by default, both instrumentation are on" , true , true , false , true ));
79
+ "disabled by default, first instrumentation is on, second is off" ,
80
+ true ,
81
+ false ,
82
+ false ,
83
+ true ),
84
+ Arguments .of ("disabled by default" , null , null , false , false ));
59
85
}
60
86
}
61
87
}
0 commit comments