@Test
@SuppressWarnings("all")
public void searchStreamExceptionTest() throws Exception {

  StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT);
  mockGoogleAdsService.addException(exception);
  String customerId = "customerId-1772061412";
  String query = "query107944136";
  SearchGoogleAdsStreamRequest request =
      SearchGoogleAdsStreamRequest.newBuilder().setCustomerId(customerId).setQuery(query).build();
  MockStreamObserver<SearchGoogleAdsStreamResponse> responseObserver = new MockStreamObserver<>();
  ServerStreamingCallable<SearchGoogleAdsStreamRequest, SearchGoogleAdsStreamResponse> callable =
      client.searchStreamCallable();
  callable.serverStreamingCall(request, responseObserver);
  try {
    List<SearchGoogleAdsStreamResponse> actualResponses = responseObserver.future().get();
    Assert.fail("No exception thrown");
  } catch (ExecutionException e) {
    Assert.assertTrue(e.getCause() instanceof InvalidArgumentException);
    InvalidArgumentException apiException = (InvalidArgumentException) e.getCause();
    Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode());
  }
}