Skip to content

Commit 1a8ee07

Browse files
Fix failing remote config test
1 parent 9df1e99 commit 1a8ee07

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

dd-smoke-tests/dynamic-config/src/test/groovy/datadog/smoketest/AppSecActivationSmokeTest.groovy

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class AppSecActivationSmokeTest extends AbstractSmokeTest {
1212
'-Ddd.remote_config.enabled=true',
1313
"-Ddd.remote_config.url=http://localhost:${server.address.port}/v0.7/config".toString(),
1414
'-Ddd.remote_config.poll_interval.seconds=1',
15+
'-Ddd.profiling.enabled=false',
1516
'-cp',
1617
System.getProperty('datadog.smoketest.shadowJar.path'),
1718
AppSecApplication.name
@@ -30,10 +31,12 @@ class AppSecActivationSmokeTest extends AbstractSmokeTest {
3031
if (it['request_type'] != 'app-client-configuration-change') {
3132
return false
3233
}
33-
final payload = (Map<String, Object>) it['payload']
34-
final configurations = (List<Map<String, Object>>) payload['configuration']
35-
final enabled = configurations.find { it['name'] == 'appsec_enabled' }
36-
return enabled['value'] == 'true' && enabled['origin'] == 'remote_config'
34+
final configurations = (List<Map<String, Object>>) it?.payload?.configuration ?: []
35+
final enabledConfig = configurations.find { it.name == 'appsec_enabled' }
36+
if (!enabledConfig) {
37+
return false
38+
}
39+
return enabledConfig.value == 'true' && enabledConfig .origin == 'remote_config'
3740
}
3841
}
3942
}

0 commit comments

Comments
 (0)