@@ -1032,9 +1032,7 @@ private void validateHttpStatusForNonLocalRootWithThrowableForClient(
1032
1032
1033
1033
@ Test
1034
1034
public void testDBUserAttribute () {
1035
- mockAttribute (DB_SYSTEM , "db_system" );
1036
1035
mockAttribute (DB_OPERATION , "db_operation" );
1037
- mockAttribute (DB_STATEMENT , "db_statement" );
1038
1036
mockAttribute (DB_USER , "db_user" );
1039
1037
when (spanDataMock .getKind ()).thenReturn (SpanKind .CLIENT );
1040
1038
@@ -1046,6 +1044,7 @@ public void testDBUserAttribute() {
1046
1044
1047
1045
@ Test
1048
1046
public void testDBUserAttributeAbsent () {
1047
+ mockAttribute (DB_SYSTEM , "db_system" );
1049
1048
when (spanDataMock .getKind ()).thenReturn (SpanKind .CLIENT );
1050
1049
1051
1050
Attributes actualAttributes =
@@ -1055,9 +1054,7 @@ public void testDBUserAttributeAbsent() {
1055
1054
1056
1055
@ Test
1057
1056
public void testDBUserAttributeWithDifferentValues () {
1058
- mockAttribute (DB_SYSTEM , "db_system" );
1059
1057
mockAttribute (DB_OPERATION , "db_operation" );
1060
- mockAttribute (DB_STATEMENT , "db_statement" );
1061
1058
mockAttribute (DB_USER , "non_db_user" );
1062
1059
when (spanDataMock .getKind ()).thenReturn (SpanKind .CLIENT );
1063
1060
@@ -1068,8 +1065,8 @@ public void testDBUserAttributeWithDifferentValues() {
1068
1065
1069
1066
@ Test
1070
1067
public void testDBUserAttributeNotPresentInServiceMetricForServerSpan () {
1071
- String dbUser = "db_user" ;
1072
- mockAttribute (DB_USER , dbUser );
1068
+ mockAttribute ( DB_USER , "db_user" ) ;
1069
+ mockAttribute (DB_SYSTEM , "db_system" );
1073
1070
when (spanDataMock .getKind ()).thenReturn (SpanKind .SERVER );
1074
1071
1075
1072
Attributes actualAttributes =
@@ -1078,34 +1075,13 @@ public void testDBUserAttributeNotPresentInServiceMetricForServerSpan() {
1078
1075
}
1079
1076
1080
1077
@ Test
1081
- public void testIsDbSpanTrueWhenDbSystemKeyIsPresent () {
1082
- mockAttribute (DB_SYSTEM , "DB system" );
1083
- when (spanDataMock .getKind ()).thenReturn (SpanKind .CLIENT );
1084
-
1085
- assertThat (AwsSpanProcessingUtil .isDBSpan (spanDataMock )).isTrue ();
1086
- }
1087
-
1088
- @ Test
1089
- public void testIsDbSpanTrueWhenDbOperationKeyIsPresent () {
1090
- mockAttribute (DB_OPERATION , "DB operation" );
1091
- when (spanDataMock .getKind ()).thenReturn (SpanKind .CLIENT );
1092
-
1093
- assertThat (AwsSpanProcessingUtil .isDBSpan (spanDataMock )).isTrue ();
1094
- }
1095
-
1096
- @ Test
1097
- public void testIsDbSpanFalseWhenOnlyDbUserKeyIsPresent () {
1078
+ public void testDbUserPresentAndIsDbSpanFalse () {
1098
1079
mockAttribute (DB_USER , "DB user" );
1099
1080
when (spanDataMock .getKind ()).thenReturn (SpanKind .CLIENT );
1100
1081
1101
- assertThat (AwsSpanProcessingUtil .isDBSpan (spanDataMock )).isFalse ();
1102
- }
1103
-
1104
- @ Test
1105
- public void testIsDbSpanFalse () {
1106
- when (spanDataMock .getKind ()).thenReturn (SpanKind .CLIENT );
1107
-
1108
- assertThat (AwsSpanProcessingUtil .isDBSpan (spanDataMock )).isFalse ();
1082
+ Attributes actualAttributes =
1083
+ GENERATOR .generateMetricAttributeMapFromSpan (spanDataMock , resource ).get (DEPENDENCY_METRIC );
1084
+ assertThat (actualAttributes .get (AWS_REMOTE_DB_USER )).isNull ();
1109
1085
}
1110
1086
1111
1087
@ Test
0 commit comments