@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest)) { return super.equals(obj); } com.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest other = (com.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest) obj; boolean result = true; result = result && getRequestsList().equals(other.getRequestsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getRequestsCount() > 0) { hash = (37 * hash) + REQUESTS_FIELD_NUMBER; hash = (53 * hash) + getRequestsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@Test @SuppressWarnings("all") public void asyncBatchAnnotateFilesTest() throws Exception { AsyncBatchAnnotateFilesResponse expectedResponse = AsyncBatchAnnotateFilesResponse.newBuilder().build(); Operation resultOperation = Operation.newBuilder() .setName("asyncBatchAnnotateFilesTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockImageAnnotator.addResponse(resultOperation); List<AsyncAnnotateFileRequest> requests = new ArrayList<>(); AsyncBatchAnnotateFilesResponse actualResponse = client.asyncBatchAnnotateFilesAsync(requests).get(); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockImageAnnotator.getRequests(); Assert.assertEquals(1, actualRequests.size()); AsyncBatchAnnotateFilesRequest actualRequest = (AsyncBatchAnnotateFilesRequest) actualRequests.get(0); Assert.assertEquals(requests, actualRequest.getRequestsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest)) { return super.equals(obj); } com.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest other = (com.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest) obj; boolean result = true; result = result && getRequestsList().equals(other.getRequestsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getRequestsCount() > 0) { hash = (37 * hash) + REQUESTS_FIELD_NUMBER; hash = (53 * hash) + getRequestsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }