File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
algoliasearch-tests/src/test/java/com/algolia/search/integration/common Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 22
33import static java .util .concurrent .TimeUnit .SECONDS ;
44import static org .assertj .core .api .Assertions .assertThat ;
5+ import static org .junit .Assume .assumeTrue ;
56
67import com .algolia .search .AlgoliaObject ;
78import com .algolia .search .AsyncAlgoliaIntegrationTest ;
1112import java .util .List ;
1213import java .util .concurrent .CompletableFuture ;
1314import javax .annotation .Nonnull ;
15+ import org .junit .Before ;
1416import org .junit .Test ;
1517
1618public abstract class AsyncApiKeysTest extends AsyncAlgoliaIntegrationTest {
1719
20+ /**
21+ * If the tests are run on Travis from a pull request of a contributor we need to bypass key
22+ * management tests since they require the Admin API key
23+ */
24+ @ Before
25+ public void skipIfIsCommunity () {
26+ String isCommunity = System .getenv ("IS_COMMUNITY" );
27+ if (isCommunity != null && !isCommunity .isEmpty ()) {
28+ assumeTrue (false );
29+ }
30+ }
31+
1832 private void waitForKeyPresent (AsyncIndex <AlgoliaObject > index , @ Nonnull String description )
1933 throws Exception {
2034 for (int i = 0 ; i < 100 ; i ++) {
Original file line number Diff line number Diff line change 11package com .algolia .search .integration .common .sync ;
22
33import static org .assertj .core .api .Assertions .assertThat ;
4+ import static org .junit .Assume .assumeTrue ;
45
56import com .algolia .search .AlgoliaObject ;
67import com .algolia .search .Index ;
910import com .algolia .search .objects .ApiKey ;
1011import java .util .Collections ;
1112import java .util .List ;
13+ import org .junit .Before ;
1214import org .junit .Test ;
1315
1416@ SuppressWarnings ("ConstantConditions" )
1517public abstract class SyncApiKeysTest extends SyncAlgoliaIntegrationTest {
1618
19+ /**
20+ * If the tests are run on Travis from a pull request of a contributor we need to bypass key
21+ * management tests since they require the Admin API key
22+ */
23+ @ Before
24+ public void skipIfIsCommunity () {
25+ String isCommunity = System .getenv ("IS_COMMUNITY" );
26+ if (isCommunity != null && !isCommunity .isEmpty ()) {
27+ assumeTrue (false );
28+ }
29+ }
30+
1731 private void waitForKeyPresent (Index <AlgoliaObject > index , String description )
1832 throws AlgoliaException , InterruptedException {
1933 for (int i = 0 ; i < 100 ; i ++) {
You can’t perform that action at this time.
0 commit comments