Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Adding BatchingSettings getter to BatchingCallSettings.Builder #779

Merged
merged 1 commit into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ public Builder<ElementT, ElementResultT, RequestT, ResponseT> setBatchingSetting
return this;
}

/** Returns the {@link BatchingSettings}. */
public BatchingSettings getBatchingSettings() {
return batchingSettings;
}

/** Sets the rpc failure {@link StatusCode.Code code}, for which retries should be performed. */
@Override
public Builder<ElementT, ElementResultT, RequestT, ResponseT> setRetryableCodes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public class BatchingCallSettingsTest {
public void testEmptyBuilder() {
BatchingCallSettings.Builder<Integer, Integer, LabeledIntList, List<Integer>> builder =
BatchingCallSettings.newBuilder(SQUARER_BATCHING_DESC_V2);
assertThat(builder.getBatchingSettings()).isNull();
assertThat(builder.getRetryableCodes()).isEmpty();
assertThat(builder.getRetrySettings()).isNotNull();
}
Expand Down Expand Up @@ -99,6 +100,7 @@ public void testBuilderFromSettings() {
BatchingCallSettings settings = builder.build();
BatchingCallSettings.Builder newBuilder = settings.toBuilder();

assertThat(newBuilder.getBatchingSettings()).isEqualTo(BATCHING_SETTINGS);
assertThat(newBuilder.getRetryableCodes())
.containsExactly(StatusCode.Code.UNAVAILABLE, StatusCode.Code.UNAUTHENTICATED);
assertThat(newBuilder.getRetrySettings()).isEqualTo(retrySettings);
Expand Down