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

  String nextPageToken = "";
  com.google.rpc.Status errorsElement = com.google.rpc.Status.newBuilder().build();
  List<com.google.rpc.Status> errors = Arrays.asList(errorsElement);
  ListCampaignExperimentAsyncErrorsResponse expectedResponse =
      ListCampaignExperimentAsyncErrorsResponse.newBuilder()
          .setNextPageToken(nextPageToken)
          .addAllErrors(errors)
          .build();
  mockCampaignExperimentService.addResponse(expectedResponse);
  CampaignExperimentName resourceName =
      CampaignExperimentName.of("[CUSTOMER]", "[CAMPAIGN_EXPERIMENT]");
  ListCampaignExperimentAsyncErrorsPagedResponse pagedListResponse =
      client.listCampaignExperimentAsyncErrors(resourceName);
  List<com.google.rpc.Status> resources = Lists.newArrayList(pagedListResponse.iterateAll());
  Assert.assertEquals(1, resources.size());
  Assert.assertEquals(expectedResponse.getErrorsList().get(0), resources.get(0));
  List<AbstractMessage> actualRequests = mockCampaignExperimentService.getRequests();
  Assert.assertEquals(1, actualRequests.size());
  ListCampaignExperimentAsyncErrorsRequest actualRequest =
      (ListCampaignExperimentAsyncErrorsRequest) actualRequests.get(0);
  Assert.assertEquals(
      resourceName, CampaignExperimentName.parse(actualRequest.getResourceName()));
  Assert.assertTrue(
      channelProvider.isHeaderSent(
          ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
          GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}