Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
surbhigarg92 committed Sep 16, 2024
1 parent f1b9833 commit 370f20d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.google.api.gax.rpc.StatusCode.Code;
import com.google.api.gax.rpc.testing.FakeStatusCode;
import com.google.common.collect.ImmutableMap;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -228,6 +229,16 @@ void testAddAttributes_recordsAttributes() {
assertThat(metricsTracer.getAttributes().get("FakeTableId")).isEqualTo("12345");
}

@Test
void testAddAttributes_recordsAttributesWithMap() {
Map<String, String> attributes = new HashMap<>();
attributes.put("FakeTableId", "12345");
attributes.put("FakeInstanceId", "67890");
metricsTracer.addAttributes(attributes);
assertThat(metricsTracer.getAttributes().get("FakeTableId")).isEqualTo("12345");
assertThat(metricsTracer.getAttributes().get("FakeInstanceId")).isEqualTo("67890");
}

@Test
void testExtractStatus_errorConversion_apiExceptions() {
ApiException error =
Expand Down

0 comments on commit 370f20d

Please sign in to comment.