@Override public Iterable<LogExclusion> extractResources(ListExclusionsResponse payload) { return payload.getExclusionsList() != null ? payload.getExclusionsList() : ImmutableList.<LogExclusion>of(); } };
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.logging.v2.ListExclusionsResponse)) { return super.equals(obj); } com.google.logging.v2.ListExclusionsResponse other = (com.google.logging.v2.ListExclusionsResponse) obj; boolean result = true; result = result && getExclusionsList().equals(other.getExclusionsList()); result = result && getNextPageToken().equals(other.getNextPageToken()); 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 (getExclusionsCount() > 0) { hash = (37 * hash) + EXCLUSIONS_FIELD_NUMBER; hash = (53 * hash) + getExclusionsList().hashCode(); } hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; hash = (53 * hash) + getNextPageToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@Test @SuppressWarnings("all") public void listExclusionsTest() { String nextPageToken = ""; LogExclusion exclusionsElement = LogExclusion.newBuilder().build(); List<LogExclusion> exclusions = Arrays.asList(exclusionsElement); ListExclusionsResponse expectedResponse = ListExclusionsResponse.newBuilder() .setNextPageToken(nextPageToken) .addAllExclusions(exclusions) .build(); mockConfigServiceV2.addResponse(expectedResponse); ParentName parent = ProjectName.of("[PROJECT]"); ListExclusionsPagedResponse pagedListResponse = client.listExclusions(parent); List<LogExclusion> resources = Lists.newArrayList(pagedListResponse.iterateAll()); Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getExclusionsList().get(0), resources.get(0)); List<GeneratedMessageV3> actualRequests = mockConfigServiceV2.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListExclusionsRequest actualRequest = (ListExclusionsRequest) actualRequests.get(0); Assert.assertEquals(parent, ParentNames.parse(actualRequest.getParent())); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Override public Iterable<LogExclusion> extractResources(ListExclusionsResponse payload) { return payload.getExclusionsList() != null ? payload.getExclusionsList() : ImmutableList.<LogExclusion>of(); } };