@Test
public void testOnResponseError() throws Throwable {

  CountDownLatch latch = new CountDownLatch(1);
  MoneyObserver moneyObserver = new MoneyObserver(true, latch);
  streamingCallable.call(ERROR_REQUEST, moneyObserver);
  latch.await(500, TimeUnit.MILLISECONDS);
  Truth.assertThat(moneyObserver.error).isInstanceOf(ApiException.class);
  Truth.assertThat(((ApiException) moneyObserver.error).getStatusCode().getCode())
      .isEqualTo(StatusCode.Code.INVALID_ARGUMENT);
  Truth.assertThat(moneyObserver.error)
      .hasMessageThat()
      .isEqualTo("io.grpc.StatusRuntimeException: INVALID_ARGUMENT: red must be positive");
}