@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.grafeas.v1beta1.BatchCreateOccurrencesRequest)) { return super.equals(obj); } io.grafeas.v1beta1.BatchCreateOccurrencesRequest other = (io.grafeas.v1beta1.BatchCreateOccurrencesRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getOccurrencesList().equals(other.getOccurrencesList()); 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(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); if (getOccurrencesCount() > 0) { hash = (37 * hash) + OCCURRENCES_FIELD_NUMBER; hash = (53 * hash) + getOccurrencesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@Test @SuppressWarnings("all") public void batchCreateOccurrencesTest() { BatchCreateOccurrencesResponse expectedResponse = BatchCreateOccurrencesResponse.newBuilder().build(); mockGrafeasV1Beta1.addResponse(expectedResponse); ProjectName parent = ProjectName.of("[PROJECT]"); List<Occurrence> occurrences = new ArrayList<>(); BatchCreateOccurrencesResponse actualResponse = client.batchCreateOccurrences(parent, occurrences); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockGrafeasV1Beta1.getRequests(); Assert.assertEquals(1, actualRequests.size()); BatchCreateOccurrencesRequest actualRequest = (BatchCreateOccurrencesRequest) actualRequests.get(0); Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); Assert.assertEquals(occurrences, actualRequest.getOccurrencesList()); 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 io.grafeas.v1beta1.BatchCreateOccurrencesRequest)) { return super.equals(obj); } io.grafeas.v1beta1.BatchCreateOccurrencesRequest other = (io.grafeas.v1beta1.BatchCreateOccurrencesRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getOccurrencesList().equals(other.getOccurrencesList()); 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(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); if (getOccurrencesCount() > 0) { hash = (37 * hash) + OCCURRENCES_FIELD_NUMBER; hash = (53 * hash) + getOccurrencesList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }