use of com.google.api.gax.rpc.testing.FakeStatusCode in project gax-java by googleapis.
the class OpencensusTracerTest method testErrorConversion.
@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());
}
}
Aggregations