@Test
public void testGetSpanName() {

  Map<String, SpanName> validNames =
      ImmutableMap.of(
          "compute.projects.disableXpnHost", SpanName.of("compute.projects", "disableXpnHost"),
          "client.method", SpanName.of("client", "method"));
  for (Entry<String, SpanName> entry : validNames.entrySet()) {
    @SuppressWarnings("unchecked")
    ApiMethodDescriptor descriptor =
        ApiMethodDescriptor.newBuilder()
            .setFullMethodName(entry.getKey())
            .setHttpMethod(HttpMethods.POST)
            .setRequestFormatter(Mockito.mock(HttpRequestFormatter.class))
            .setResponseParser(Mockito.mock(HttpResponseParser.class))
            .build();
    SpanName actualSpanName = HttpJsonCallableFactory.getSpanName(descriptor);
    assertThat(actualSpanName).isEqualTo(entry.getValue());
  }
}