Skip to content

Commit 7a16c8d

Browse files
averikitschkappratiksha
authored andcommitted
fix: add multiple retries to Content Warehouse sample (GoogleCloudPlatform#8158)
## Description Fixes GoogleCloudPlatform#7997 Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google. ## Checklist - [ ] I have followed [Sample Format Guide](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md) - [ ] `pom.xml` parent set to latest `shared-configuration` - [ ] Appropriate changes to README are included in PR - [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones) - [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones) - [ ] **Tests** pass: `mvn clean verify` **required** - [ ] **Lint** passes: `mvn -P lint checkstyle:check` **required** - [ ] **Static Analysis**: `mvn -P lint clean compile pmd:cpd-check spotbugs:check` **advisory only** - [ ] This sample adds a new sample directory, and I updated the [CODEOWNERS file](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/.github/CODEOWNERS) with the codeowners for this sample - [ ] This sample adds a new **Product API**, and I updated the [Blunderbuss issue/PR auto-assigner](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/.github/blunderbuss.yml) with the codeowners for this sample - [ ] Please **merge** this PR for me once it is approved
1 parent d982264 commit 7a16c8d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

content-warehouse/src/test/java/contentwarehouse/v1/QuickStartTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,23 @@
1919
import static com.google.common.truth.Truth.assertThat;
2020
import static org.junit.Assert.assertNotNull;
2121

22+
import com.google.cloud.testing.junit4.MultipleAttemptsRule;
2223
import java.io.ByteArrayOutputStream;
2324
import java.io.IOException;
2425
import java.io.PrintStream;
2526
import java.util.concurrent.ExecutionException;
2627
import java.util.concurrent.TimeoutException;
2728
import org.junit.After;
2829
import org.junit.Before;
30+
import org.junit.Rule;
2931
import org.junit.Test;
3032

3133
public class QuickStartTest {
34+
@Rule public final MultipleAttemptsRule multipleAttemptsRule = new MultipleAttemptsRule(3);
35+
3236
private static final String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT");
33-
private static final String LOCATION = "us";
34-
private static final String USER_ID = "user:[email protected]";
37+
private static final String LOCATION = "us";
38+
private static final String USER_ID = "user:[email protected]";
3539

3640
private ByteArrayOutputStream bout;
3741
private PrintStream out;

0 commit comments

Comments
 (0)