88import static io .opentelemetry .sdk .testing .assertj .OpenTelemetryAssertions .assertThat ;
99import static org .assertj .core .api .Assertions .entry ;
1010
11- import io .opentelemetry .api .common .AttributeKey ;
1211import io .opentelemetry .api .common .Attributes ;
1312import io .opentelemetry .api .common .AttributesBuilder ;
1413import io .opentelemetry .context .Context ;
@@ -28,8 +27,7 @@ static final class TestAttributesGetter
2827
2928 @ Override
3029 public String getRawQueryText (Map <String , String > map ) {
31- return map .get (
32- SemconvStabilityUtil .getAttributeKey (AttributeKey .stringKey ("db.statement" )).getKey ());
30+ return map .get ("db.statement" );
3331 }
3432
3533 @ Override
@@ -45,8 +43,7 @@ public String getUser(Map<String, String> map) {
4543
4644 @ Override
4745 public String getDbNamespace (Map <String , String > map ) {
48- return map .get (
49- SemconvStabilityUtil .getAttributeKey (AttributeKey .stringKey ("db.name" )).getKey ());
46+ return map .get ("db.name" );
5047 }
5148
5249 @ Deprecated
@@ -62,15 +59,10 @@ void shouldExtractAllAttributes() {
6259 // given
6360 Map <String , String > request = new HashMap <>();
6461 request .put ("db.system" , "myDb" );
65- if (SemconvStability .emitOldDatabaseSemconv ()) {
66- request .put ("db.user" , "username" );
67- request .put ("db.connection_string" , "mydb:///potatoes" );
68- request .put ("db.name" , "potatoes" );
69- request .put ("db.statement" , "SELECT * FROM potato WHERE id=12345" );
70- } else if (SemconvStability .emitStableDatabaseSemconv ()) {
71- request .put ("db.namespace" , "potatoes" );
72- request .put ("db.query.text" , "SELECT * FROM potato WHERE id=12345" );
73- }
62+ request .put ("db.user" , "username" );
63+ request .put ("db.name" , "potatoes" );
64+ request .put ("db.connection_string" , "mydb:///potatoes" );
65+ request .put ("db.statement" , "SELECT * FROM potato WHERE id=12345" );
7466
7567 Context context = Context .root ();
7668
@@ -119,11 +111,7 @@ void shouldExtractAllAttributes() {
119111 void shouldNotExtractTableIfAttributeIsNotSet () {
120112 // given
121113 Map <String , String > request = new HashMap <>();
122- if (SemconvStability .emitOldDatabaseSemconv ()) {
123- request .put ("db.statement" , "SELECT *" );
124- } else {
125- request .put ("db.query.text" , "SELECT *" );
126- }
114+ request .put ("db.statement" , "SELECT *" );
127115
128116 Context context = Context .root ();
129117
@@ -149,13 +137,7 @@ void shouldNotExtractTableIfAttributeIsNotSet() {
149137 void shouldExtractTableToSpecifiedKey () {
150138 // given
151139 Map <String , String > request = new HashMap <>();
152- if (SemconvStability .emitOldDatabaseSemconv ()) {
153- request .put ("db.statement" , "SELECT * FROM table" );
154- }
155-
156- if (SemconvStability .emitStableDatabaseSemconv ()) {
157- request .put ("db.query.text" , "SELECT * FROM table" );
158- }
140+ request .put ("db.statement" , "SELECT * FROM table" );
159141
160142 Context context = Context .root ();
161143
0 commit comments