11package datadog .smoketest .loginjection ;
22
3- import static datadog .trace .api .config .TraceInstrumentationConfig .LOGS_INJECTION_ENABLED ;
4-
5- import datadog .trace .api .ConfigCollector ;
6- import datadog .trace .api .ConfigSetting ;
3+ import datadog .trace .api .Config ;
74import datadog .trace .api .CorrelationIdentifier ;
85import datadog .trace .api .Trace ;
96import java .util .concurrent .TimeUnit ;
@@ -23,13 +20,13 @@ public void run() throws InterruptedException {
2320
2421 secondTracedMethod ();
2522
26- if (!waitForCondition (() -> Boolean . FALSE . equals ( getLogInjectionEnabled () ))) {
23+ if (!waitForCondition (() -> ! getLogInjectionEnabled ())) {
2724 throw new RuntimeException ("Logs injection config was never updated" );
2825 }
2926
3027 thirdTracedMethod ();
3128
32- if (!waitForCondition (() -> Boolean . TRUE . equals ( getLogInjectionEnabled () ))) {
29+ if (!waitForCondition (() -> getLogInjectionEnabled ())) {
3330 throw new RuntimeException ("Logs injection config was never updated a second time" );
3431 }
3532
@@ -43,14 +40,8 @@ public void run() throws InterruptedException {
4340 Thread .sleep (400 );
4441 }
4542
46- private static Object getLogInjectionEnabled () {
47- ConfigSetting configSetting =
48- ConfigCollector .getAppliedConfigSetting (
49- LOGS_INJECTION_ENABLED , ConfigCollector .get ().collect ());
50- if (configSetting == null ) {
51- return null ;
52- }
53- return configSetting .value ;
43+ private static Boolean getLogInjectionEnabled () {
44+ return Config .get ().isLogsInjectionEnabled ();
5445 }
5546
5647 @ Trace
0 commit comments