File tree 1 file changed +11
-0
lines changed
gax-java/gax/src/test/java/com/google/api/gax/tracing
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 43
43
import com .google .api .gax .rpc .StatusCode .Code ;
44
44
import com .google .api .gax .rpc .testing .FakeStatusCode ;
45
45
import com .google .common .collect .ImmutableMap ;
46
+ import java .util .HashMap ;
46
47
import java .util .Map ;
47
48
import org .junit .jupiter .api .BeforeEach ;
48
49
import org .junit .jupiter .api .Test ;
@@ -228,6 +229,16 @@ void testAddAttributes_recordsAttributes() {
228
229
assertThat (metricsTracer .getAttributes ().get ("FakeTableId" )).isEqualTo ("12345" );
229
230
}
230
231
232
+ @ Test
233
+ void testAddAttributes_recordsAttributesWithMap () {
234
+ Map <String , String > attributes = new HashMap <>();
235
+ attributes .put ("FakeTableId" , "12345" );
236
+ attributes .put ("FakeInstanceId" , "67890" );
237
+ metricsTracer .addAttributes (attributes );
238
+ assertThat (metricsTracer .getAttributes ().get ("FakeTableId" )).isEqualTo ("12345" );
239
+ assertThat (metricsTracer .getAttributes ().get ("FakeInstanceId" )).isEqualTo ("67890" );
240
+ }
241
+
231
242
@ Test
232
243
void testExtractStatus_errorConversion_apiExceptions () {
233
244
ApiException error =
You can’t perform that action at this time.
0 commit comments