AdGroupCriterionSimulationServiceClient implements BackgroundResource { public final AdGroupCriterionSimulation getAdGroupCriterionSimulation( AdGroupCriterionSimulationName resourceName) { GetAdGroupCriterionSimulationRequest request = GetAdGroupCriterionSimulationRequest.newBuilder() .setResourceName(resourceName == null ? null : resourceName.toString()) .build(); return getAdGroupCriterionSimulation(request); } protected  AdGroupCriterionSimulationServiceClient(
      AdGroupCriterionSimulationServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdGroupCriterionSimulationServiceClient(AdGroupCriterionSimulationServiceStub stub); static final AdGroupCriterionSimulationServiceClient create(); static final AdGroupCriterionSimulationServiceClient create(
      AdGroupCriterionSimulationServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdGroupCriterionSimulationServiceClient create(
      AdGroupCriterionSimulationServiceStub stub); final AdGroupCriterionSimulationServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdGroupCriterionSimulationServiceStub getStub(); final AdGroupCriterionSimulation getAdGroupCriterionSimulation(
      AdGroupCriterionSimulationName resourceName); final AdGroupCriterionSimulation getAdGroupCriterionSimulation(String resourceName); final AdGroupCriterionSimulation getAdGroupCriterionSimulation(
      GetAdGroupCriterionSimulationRequest request); final UnaryCallable<GetAdGroupCriterionSimulationRequest, AdGroupCriterionSimulation> getAdGroupCriterionSimulationCallable(); @Override final void close(); @Override void shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdownNow(); @Override boolean awaitTermination(long duration, TimeUnit unit);  }
@Test @SuppressWarnings("all") public void getAdGroupCriterionSimulationTest() { com.google.ads.googleads.v5.services.AdGroupCriterionSimulationName resourceName2 = com.google.ads.googleads.v5.services.AdGroupCriterionSimulationName.of( "[CUSTOMER]", "[AD_GROUP_CRITERION_SIMULATION]"); long adGroupId = 85224585L; long criterionId = 326773895L; String startDate = "startDate-1573629589"; String endDate = "endDate1725067410"; AdGroupCriterionSimulation expectedResponse = AdGroupCriterionSimulation.newBuilder() .setResourceName(resourceName2.toString()) .setAdGroupId(adGroupId) .setCriterionId(criterionId) .setStartDate(startDate) .setEndDate(endDate) .build(); mockAdGroupCriterionSimulationService.addResponse(expectedResponse); AdGroupCriterionSimulationName resourceName = AdGroupCriterionSimulationName.of("[CUSTOMER]", "[AD_GROUP_CRITERION_SIMULATION]"); AdGroupCriterionSimulation actualResponse = client.getAdGroupCriterionSimulation(resourceName); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdGroupCriterionSimulationService.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetAdGroupCriterionSimulationRequest actualRequest = (GetAdGroupCriterionSimulationRequest) actualRequests.get(0); Assert.assertEquals( resourceName, AdGroupCriterionSimulationName.parse(actualRequest.getResourceName())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void getAdGroupCriterionSimulationExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdGroupCriterionSimulationService.addException(exception); try { AdGroupCriterionSimulationName resourceName = AdGroupCriterionSimulationName.of("[CUSTOMER]", "[AD_GROUP_CRITERION_SIMULATION]"); client.getAdGroupCriterionSimulation(resourceName); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }