use of com.google.cloud.aiplatform.v1.ModelServiceClient.ListModelEvaluationSlicesPagedResponse in project java-aiplatform by googleapis.
the class ModelServiceClientTest method listModelEvaluationSlicesTest2.
@Test
public void listModelEvaluationSlicesTest2() throws Exception {
ModelEvaluationSlice responsesElement = ModelEvaluationSlice.newBuilder().build();
ListModelEvaluationSlicesResponse expectedResponse = ListModelEvaluationSlicesResponse.newBuilder().setNextPageToken("").addAllModelEvaluationSlices(Arrays.asList(responsesElement)).build();
mockModelService.addResponse(expectedResponse);
String parent = "parent-995424086";
ListModelEvaluationSlicesPagedResponse pagedListResponse = client.listModelEvaluationSlices(parent);
List<ModelEvaluationSlice> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getModelEvaluationSlicesList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockModelService.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListModelEvaluationSlicesRequest actualRequest = ((ListModelEvaluationSlicesRequest) actualRequests.get(0));
Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.aiplatform.v1.ModelServiceClient.ListModelEvaluationSlicesPagedResponse in project java-aiplatform by googleapis.
the class ModelServiceClientTest method listModelEvaluationSlicesTest.
@Test
public void listModelEvaluationSlicesTest() throws Exception {
ModelEvaluationSlice responsesElement = ModelEvaluationSlice.newBuilder().build();
ListModelEvaluationSlicesResponse expectedResponse = ListModelEvaluationSlicesResponse.newBuilder().setNextPageToken("").addAllModelEvaluationSlices(Arrays.asList(responsesElement)).build();
mockModelService.addResponse(expectedResponse);
ModelEvaluationName parent = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
ListModelEvaluationSlicesPagedResponse pagedListResponse = client.listModelEvaluationSlices(parent);
List<ModelEvaluationSlice> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getModelEvaluationSlicesList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockModelService.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListModelEvaluationSlicesRequest actualRequest = ((ListModelEvaluationSlicesRequest) actualRequests.get(0));
Assert.assertEquals(parent.toString(), actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.aiplatform.v1.ModelServiceClient.ListModelEvaluationSlicesPagedResponse in project java-aiplatform by googleapis.
the class ModelServiceClientTest method listModelEvaluationSlicesTest2.
@Test
public void listModelEvaluationSlicesTest2() throws Exception {
ModelEvaluationSlice responsesElement = ModelEvaluationSlice.newBuilder().build();
ListModelEvaluationSlicesResponse expectedResponse = ListModelEvaluationSlicesResponse.newBuilder().setNextPageToken("").addAllModelEvaluationSlices(Arrays.asList(responsesElement)).build();
mockModelService.addResponse(expectedResponse);
String parent = "parent-995424086";
ListModelEvaluationSlicesPagedResponse pagedListResponse = client.listModelEvaluationSlices(parent);
List<ModelEvaluationSlice> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getModelEvaluationSlicesList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockModelService.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListModelEvaluationSlicesRequest actualRequest = ((ListModelEvaluationSlicesRequest) actualRequests.get(0));
Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.aiplatform.v1.ModelServiceClient.ListModelEvaluationSlicesPagedResponse in project java-aiplatform by googleapis.
the class ModelServiceClientTest method listModelEvaluationSlicesTest.
@Test
public void listModelEvaluationSlicesTest() throws Exception {
ModelEvaluationSlice responsesElement = ModelEvaluationSlice.newBuilder().build();
ListModelEvaluationSlicesResponse expectedResponse = ListModelEvaluationSlicesResponse.newBuilder().setNextPageToken("").addAllModelEvaluationSlices(Arrays.asList(responsesElement)).build();
mockModelService.addResponse(expectedResponse);
ModelEvaluationName parent = ModelEvaluationName.of("[PROJECT]", "[LOCATION]", "[MODEL]", "[EVALUATION]");
ListModelEvaluationSlicesPagedResponse pagedListResponse = client.listModelEvaluationSlices(parent);
List<ModelEvaluationSlice> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getModelEvaluationSlicesList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockModelService.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListModelEvaluationSlicesRequest actualRequest = ((ListModelEvaluationSlicesRequest) actualRequests.get(0));
Assert.assertEquals(parent.toString(), actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations