@@ -861,7 +861,7 @@ TEST_CASE("128-bit trace ID injection") {
861861 REQUIRE (found->second == " deadbeefdeadbeefcafebabecafebabe" );
862862}
863863
864- TEST_CASE (" injection with has_appsec_matches option" ) {
864+ TEST_CASE (" injection with trace_source option" ) {
865865 TracerConfig config;
866866 config.service = " testsvc" ;
867867 config.collector = std::make_shared<MockCollector>();
@@ -872,16 +872,16 @@ TEST_CASE("injection with has_appsec_matches option") {
872872 REQUIRE (finalized_config);
873873 Tracer tracer{*finalized_config};
874874
875- SECTION (" has_appsec_matches = false (default)" ) {
875+ SECTION (" trace_source is not set (default)" ) {
876876 auto span = tracer.create_span ();
877877 InjectionOptions options;
878- options.has_appsec_matches = false ;
878+ options.trace_source = std:: nullopt ;
879879
880880 MockDictWriter writer;
881881 span.inject (writer, options);
882882
883883 const auto & headers = writer.items ;
884- // When has_appsec_matches is false , there should be no x-datadog-tags
884+ // When there is no trace source , there should be no x-datadog-tags
885885 // header or if there is one, it should not contain _dd.p.ts
886886 if (headers.count (" x-datadog-tags" ) > 0 ) {
887887 const auto decoded_tags = decode_tags (headers.at (" x-datadog-tags" ));
@@ -893,10 +893,10 @@ TEST_CASE("injection with has_appsec_matches option") {
893893 }
894894 }
895895
896- SECTION (" has_appsec_matches = true " ) {
896+ SECTION (" trace_source is 02 (appsec) " ) {
897897 auto span = tracer.create_span ();
898898 InjectionOptions options;
899- options.has_appsec_matches = true ;
899+ options.trace_source = { ' 0 ' , ' 2 ' } ;
900900
901901 MockDictWriter writer;
902902 span.inject (writer, options);
@@ -918,7 +918,7 @@ TEST_CASE("injection with has_appsec_matches option") {
918918 REQUIRE (found_trace_source);
919919 }
920920
921- SECTION (" has_appsec_matches with existing trace tags" ) {
921+ SECTION (" trace source is 02 (appsec) with existing trace tags" ) {
922922 // Extract a span with existing trace tags
923923 const std::unordered_map<std::string, std::string> headers{
924924 {" x-datadog-trace-id" , " 123" },
@@ -930,7 +930,7 @@ TEST_CASE("injection with has_appsec_matches option") {
930930 REQUIRE (span);
931931
932932 InjectionOptions options;
933- options.has_appsec_matches = true ;
933+ options.trace_source = { ' 0 ' , ' 2 ' } ;
934934
935935 MockDictWriter writer;
936936 span->inject (writer, options);
@@ -961,7 +961,7 @@ TEST_CASE("injection with has_appsec_matches option") {
961961 REQUIRE (found_another);
962962 }
963963
964- SECTION (" has_appsec_matches with APM tracing disabled" ) {
964+ SECTION (" trace_source with APM tracing disabled" ) {
965965 // Test the scenario where APM tracing is disabled
966966 TracerConfig apm_disabled_config;
967967 apm_disabled_config.service = " testsvc" ;
@@ -983,7 +983,7 @@ TEST_CASE("injection with has_appsec_matches option") {
983983 span.trace_segment ().override_sampling_priority (1 );
984984
985985 InjectionOptions options;
986- options.has_appsec_matches = true ;
986+ options.trace_source = { ' 0 ' , ' 2 ' } ;
987987
988988 MockDictWriter writer;
989989 span.inject (writer, options);
0 commit comments