Skip to content

Commit

Permalink
Fixed EVERYTHING
Browse files Browse the repository at this point in the history
  • Loading branch information
jorge-beauregard committed Oct 27, 2020
1 parent 2c0aa4e commit 3fbde25
Show file tree
Hide file tree
Showing 3 changed files with 251 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -847,10 +847,11 @@ Mono<PhoneNumberSearch>> createSearchFetchResultOperation() {
*/

@ServiceMethod(returns = ReturnType.COLLECTION)
public PollerFlux<PhoneNumberSearch, PhoneNumberSearch> beginPurchaseSearch(String searchId, Duration pollInterval) {
public PollerFlux<PhoneNumberSearch,
PhoneNumberSearch> beginPurchaseSearch(String searchId, Duration pollInterval) {
Objects.requireNonNull(searchId, "'searchId' can not be null.");

if(pollInterval == null){
if (pollInterval == null) {
pollInterval = Duration.ofSeconds(5);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,12 @@ public void beginCreateSearch(HttpClient httpClient) {
@MethodSource("com.azure.core.test.TestBase#getHttpClients")
public void beginPurchaseSearch(HttpClient httpClient) {
Duration pollInterval = Duration.ofSeconds(1);
PhoneNumberAsyncClient client = this.getClient(httpClient);
PollerFlux<PhoneNumberSearch, PhoneNumberSearch> poller =
this.getClient(httpClient).beginPurchaseSearch(SEARCH_ID, pollInterval);
client.beginPurchaseSearch(SEARCH_ID, pollInterval);
AsyncPollResponse<PhoneNumberSearch, PhoneNumberSearch> asyncRes =
poller.takeUntil(apr -> apr.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED).
blockLast();
poller.takeUntil(apr -> apr.getStatus() == LongRunningOperationStatus.SUCCESSFULLY_COMPLETED)
.blockLast();
PhoneNumberSearch testResult = asyncRes.getValue();
assertEquals(SearchStatus.SUCCESS, testResult.getStatus());
}
Expand Down
Loading

0 comments on commit 3fbde25

Please sign in to comment.