Skip to content

Commit 3da5232

Browse files
algolia-botmillotp
andcommitted
fix(cts): add waitForTask helpers tests [skip-bc] (generated)
algolia/api-clients-automation#3618 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent d114bf4 commit 3da5232

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

algoliasearch/src/main/java/com/algolia/api/SearchClient.java

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5837,8 +5837,14 @@ public CompletableFuture<UpdateApiKeyResponse> updateApiKeyAsync(@Nonnull String
58375837
* @param requestOptions The requestOptions to send along with the query, they will be merged with
58385838
* the transporter requestOptions. (optional)
58395839
*/
5840-
public void waitForTask(String indexName, Long taskID, int maxRetries, IntUnaryOperator timeout, RequestOptions requestOptions) {
5841-
TaskUtils.retryUntil(
5840+
public GetTaskResponse waitForTask(
5841+
String indexName,
5842+
Long taskID,
5843+
int maxRetries,
5844+
IntUnaryOperator timeout,
5845+
RequestOptions requestOptions
5846+
) {
5847+
return TaskUtils.retryUntil(
58425848
() -> this.getTask(indexName, taskID, requestOptions),
58435849
(GetTaskResponse task) -> task.getStatus() == TaskStatus.PUBLISHED,
58445850
maxRetries,
@@ -5854,8 +5860,8 @@ public void waitForTask(String indexName, Long taskID, int maxRetries, IntUnaryO
58545860
* @param requestOptions The requestOptions to send along with the query, they will be merged with
58555861
* the transporter requestOptions. (optional)
58565862
*/
5857-
public void waitForTask(String indexName, Long taskID, RequestOptions requestOptions) {
5858-
this.waitForTask(indexName, taskID, TaskUtils.DEFAULT_MAX_RETRIES, TaskUtils.DEFAULT_TIMEOUT, requestOptions);
5863+
public GetTaskResponse waitForTask(String indexName, Long taskID, RequestOptions requestOptions) {
5864+
return this.waitForTask(indexName, taskID, TaskUtils.DEFAULT_MAX_RETRIES, TaskUtils.DEFAULT_TIMEOUT, requestOptions);
58595865
}
58605866

58615867
/**
@@ -5867,8 +5873,8 @@ public void waitForTask(String indexName, Long taskID, RequestOptions requestOpt
58675873
* @param timeout The function to decide how long to wait between retries. min(retries * 200,
58685874
* 5000) by default. (optional)
58695875
*/
5870-
public void waitForTask(String indexName, Long taskID, int maxRetries, IntUnaryOperator timeout) {
5871-
this.waitForTask(indexName, taskID, maxRetries, timeout, null);
5876+
public GetTaskResponse waitForTask(String indexName, Long taskID, int maxRetries, IntUnaryOperator timeout) {
5877+
return this.waitForTask(indexName, taskID, maxRetries, timeout, null);
58725878
}
58735879

58745880
/**
@@ -5877,8 +5883,8 @@ public void waitForTask(String indexName, Long taskID, int maxRetries, IntUnaryO
58775883
* @param indexName The `indexName` where the operation was performed.
58785884
* @param taskID The `taskID` returned in the method response.
58795885
*/
5880-
public void waitForTask(String indexName, Long taskID) {
5881-
this.waitForTask(indexName, taskID, TaskUtils.DEFAULT_MAX_RETRIES, TaskUtils.DEFAULT_TIMEOUT, null);
5886+
public GetTaskResponse waitForTask(String indexName, Long taskID) {
5887+
return this.waitForTask(indexName, taskID, TaskUtils.DEFAULT_MAX_RETRIES, TaskUtils.DEFAULT_TIMEOUT, null);
58825888
}
58835889

58845890
/**
@@ -5891,8 +5897,8 @@ public void waitForTask(String indexName, Long taskID) {
58915897
* @param requestOptions The requestOptions to send along with the query, they will be merged with
58925898
* the transporter requestOptions. (optional)
58935899
*/
5894-
public void waitForAppTask(Long taskID, int maxRetries, IntUnaryOperator timeout, RequestOptions requestOptions) {
5895-
TaskUtils.retryUntil(
5900+
public GetTaskResponse waitForAppTask(Long taskID, int maxRetries, IntUnaryOperator timeout, RequestOptions requestOptions) {
5901+
return TaskUtils.retryUntil(
58965902
() -> this.getAppTask(taskID, requestOptions),
58975903
(GetTaskResponse task) -> task.getStatus() == TaskStatus.PUBLISHED,
58985904
maxRetries,
@@ -5907,8 +5913,8 @@ public void waitForAppTask(Long taskID, int maxRetries, IntUnaryOperator timeout
59075913
* @param requestOptions The requestOptions to send along with the query, they will be merged with
59085914
* the transporter requestOptions. (optional)
59095915
*/
5910-
public void waitForAppTask(Long taskID, RequestOptions requestOptions) {
5911-
this.waitForAppTask(taskID, TaskUtils.DEFAULT_MAX_RETRIES, TaskUtils.DEFAULT_TIMEOUT, requestOptions);
5916+
public GetTaskResponse waitForAppTask(Long taskID, RequestOptions requestOptions) {
5917+
return this.waitForAppTask(taskID, TaskUtils.DEFAULT_MAX_RETRIES, TaskUtils.DEFAULT_TIMEOUT, requestOptions);
59125918
}
59135919

59145920
/**
@@ -5919,17 +5925,17 @@ public void waitForAppTask(Long taskID, RequestOptions requestOptions) {
59195925
* @param timeout The function to decide how long to wait between retries. min(retries * 200,
59205926
* 5000) by default. (optional)
59215927
*/
5922-
public void waitForAppTask(Long taskID, int maxRetries, IntUnaryOperator timeout) {
5923-
this.waitForAppTask(taskID, maxRetries, timeout, null);
5928+
public GetTaskResponse waitForAppTask(Long taskID, int maxRetries, IntUnaryOperator timeout) {
5929+
return this.waitForAppTask(taskID, maxRetries, timeout, null);
59245930
}
59255931

59265932
/**
59275933
* Helper: Wait for an application-level task to complete with `taskID`.
59285934
*
59295935
* @param taskID The `taskID` returned in the method response.
59305936
*/
5931-
public void waitForAppTask(Long taskID) {
5932-
this.waitForAppTask(taskID, TaskUtils.DEFAULT_MAX_RETRIES, TaskUtils.DEFAULT_TIMEOUT, null);
5937+
public GetTaskResponse waitForAppTask(Long taskID) {
5938+
return this.waitForAppTask(taskID, TaskUtils.DEFAULT_MAX_RETRIES, TaskUtils.DEFAULT_TIMEOUT, null);
59335939
}
59345940

59355941
/**

0 commit comments

Comments
 (0)