@Test
public void testErrorConversion() {

  for (Code code : Code.values()) {
    ApiException error = new ApiException("fake message", null, new FakeStatusCode(code), false);
    Status opencensusStatus = OpencensusTracer.convertErrorToStatus(error);
    assertThat(opencensusStatus.getDescription()).isEqualTo("fake message");
    assertThat(opencensusStatus.getCanonicalCode().toString()).isEqualTo(code.toString());
  }
}