Skip to content

Commit 370f20d

Browse files
committed
test
1 parent f1b9833 commit 370f20d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

gax-java/gax/src/test/java/com/google/api/gax/tracing/MetricsTracerTest.java

+11
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import com.google.api.gax.rpc.StatusCode.Code;
4444
import com.google.api.gax.rpc.testing.FakeStatusCode;
4545
import com.google.common.collect.ImmutableMap;
46+
import java.util.HashMap;
4647
import java.util.Map;
4748
import org.junit.jupiter.api.BeforeEach;
4849
import org.junit.jupiter.api.Test;
@@ -228,6 +229,16 @@ void testAddAttributes_recordsAttributes() {
228229
assertThat(metricsTracer.getAttributes().get("FakeTableId")).isEqualTo("12345");
229230
}
230231

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+
231242
@Test
232243
void testExtractStatus_errorConversion_apiExceptions() {
233244
ApiException error =

0 commit comments

Comments
 (0)