@Test
@SuppressWarnings("all")
public void searchTest() {

  String nextPageToken = "";
  long totalResultsCount = 43694645L;
  GoogleAdsRow resultsElement = GoogleAdsRow.newBuilder().build();
  List<GoogleAdsRow> results = Arrays.asList(resultsElement);
  SearchGoogleAdsResponse expectedResponse =
      SearchGoogleAdsResponse.newBuilder()
          .setNextPageToken(nextPageToken)
          .setTotalResultsCount(totalResultsCount)
          .addAllResults(results)
          .build();
  mockGoogleAdsService.addResponse(expectedResponse);
  String customerId = "customerId-1772061412";
  String query = "query107944136";
  SearchPagedResponse pagedListResponse = client.search(customerId, query);
  List<GoogleAdsRow> resources = Lists.newArrayList(pagedListResponse.iterateAll());
  Assert.assertEquals(1, resources.size());
  Assert.assertEquals(expectedResponse.getResultsList().get(0), resources.get(0));
  List<AbstractMessage> actualRequests = mockGoogleAdsService.getRequests();
  Assert.assertEquals(1, actualRequests.size());
  SearchGoogleAdsRequest actualRequest = (SearchGoogleAdsRequest) actualRequests.get(0);
  Assert.assertEquals(customerId, actualRequest.getCustomerId());
  Assert.assertEquals(query, actualRequest.getQuery());
  Assert.assertTrue(
      channelProvider.isHeaderSent(
          ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
          GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}