diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 410a09dd0..369e37745 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: docker-img: - - docker.io/arangodb/enterprise:3.11.6 + - docker.io/arangodb/enterprise:3.11.7 topology: - single module: @@ -42,7 +42,7 @@ jobs: run: mvn --no-transfer-progress install -DskipTests=true -Dgpg.skip=true -Dmaven.javadoc.skip=true - name: Test Native working-directory: ${{matrix.module}} - run: mvn --no-transfer-progress -Pnative -P'!arch-test' test + run: mvn --no-transfer-progress -Pnative -P'!arch-test' -DenableSlowTests=true test test-native-ssl: timeout-minutes: 20 @@ -52,7 +52,7 @@ jobs: fail-fast: false matrix: docker-img: - - docker.io/arangodb/enterprise:3.11.6 + - docker.io/arangodb/enterprise:3.11.7 topology: - single module: @@ -81,4 +81,4 @@ jobs: run: mvn --no-transfer-progress install -DskipTests=true -Dgpg.skip=true -Dmaven.javadoc.skip=true - name: Test Native working-directory: ${{matrix.module}} - run: mvn --no-transfer-progress -Pnative -P'!arch-test' -Dgroups=ssl -DSslTest=true test + run: mvn --no-transfer-progress -Pnative -P'!arch-test' -Dgroups=ssl -DSslTest=true -DenableSlowTests=true test diff --git a/.github/workflows/resilience.yml b/.github/workflows/resilience.yml index 5972cf031..d5b37fe42 100644 --- a/.github/workflows/resilience.yml +++ b/.github/workflows/resilience.yml @@ -46,4 +46,4 @@ jobs: run: mvn --no-transfer-progress install -DskipTests=true -Dgpg.skip=true -Dmaven.javadoc.skip=true - name: Test working-directory: resilience-tests - run: mvn --no-transfer-progress test + run: mvn --no-transfer-progress -DenableSlowTests=true test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72ac706ad..44e1be13a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,10 +28,12 @@ jobs: fail-fast: false matrix: docker-img: - - docker.io/arangodb/arangodb:3.10.11 - - docker.io/arangodb/arangodb:3.11.6 - - docker.io/arangodb/enterprise:3.10.11 - - docker.io/arangodb/enterprise:3.11.6 + - docker.io/arangodb/arangodb:3.10.13 + - docker.io/arangodb/arangodb:3.11.7 + - docker.io/arangodb/arangodb-preview:devel-nightly + - docker.io/arangodb/enterprise:3.10.13 + - docker.io/arangodb/enterprise:3.11.7 + - docker.io/arangodb/enterprise-preview:devel-nightly topology: - single - cluster @@ -42,6 +44,11 @@ jobs: - 21 user-language: - en + exclude: + - docker-img: docker.io/arangodb/arangodb-preview:devel-nightly + topology: activefailover + - docker-img: docker.io/arangodb/enterprise-preview:devel-nightly + topology: activefailover steps: - uses: actions/checkout@v2 @@ -57,11 +64,10 @@ jobs: ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }} STARTER_MODE: ${{matrix.topology}} DOCKER_IMAGE: ${{matrix.docker-img}} - EXTENDED_NAMES: ${{matrix.db-ext-names}} - name: Info run: mvn -version - name: Test - run: mvn --no-transfer-progress -am -pl driver test -DargLine="-Duser.language=${{matrix.user-language}}" + run: mvn --no-transfer-progress -am -pl driver test -DargLine="-Duser.language=${{matrix.user-language}}" -DenableSlowTests=true test-ssl: if: '! github.event.pull_request.draft' @@ -72,7 +78,7 @@ jobs: fail-fast: false matrix: docker-img: - - docker.io/arangodb/arangodb:3.11.6 + - docker.io/arangodb/arangodb:3.11.7 topology: - single java-version: @@ -96,7 +102,7 @@ jobs: - name: Info run: mvn -version - name: Test - run: mvn --no-transfer-progress -Dgroups=ssl -DSslTest=true -am -pl driver test + run: mvn --no-transfer-progress -Dgroups=ssl -DSslTest=true -DenableSlowTests=true -am -pl driver test # test encodeURIComponent() and normalize('NFC') comparing to Javascript behavior test-graalvm: @@ -113,7 +119,7 @@ jobs: - name: Info run: mvn -version - name: Test - run: mvn -e --no-transfer-progress -am -pl driver test -Dtest=graalvm.UnicodeUtilsTest -Dsurefire.failIfNoSpecifiedTests=false + run: mvn -e --no-transfer-progress -am -pl driver test -Dtest=graalvm.UnicodeUtilsTest -Dsurefire.failIfNoSpecifiedTests=false -DenableSlowTests=true test-jwt: if: '! github.event.pull_request.draft' @@ -124,7 +130,7 @@ jobs: fail-fast: false matrix: docker-img: - - docker.io/arangodb/enterprise:3.11.6 + - docker.io/arangodb/enterprise:3.11.7 topology: - single - cluster @@ -150,7 +156,6 @@ jobs: ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }} STARTER_MODE: ${{matrix.topology}} DOCKER_IMAGE: ${{matrix.docker-img}} - EXTENDED_NAMES: ${{matrix.db-ext-names}} - name: Set JWT run: | ENDPOINT=$(./docker/find_active_endpoint.sh) @@ -161,7 +166,7 @@ jobs: - name: Info run: mvn -version - name: Test - run: mvn --no-transfer-progress -am -pl driver test -DargLine="-Duser.language=${{matrix.user-language}}" + run: mvn --no-transfer-progress -am -pl driver test -DargLine="-Duser.language=${{matrix.user-language}}" -DenableSlowTests=true jackson-test: if: '! github.event.pull_request.draft' @@ -180,7 +185,7 @@ jobs: - 2.11.4 - 2.10.5 docker-img: - - docker.io/arangodb/arangodb:3.11.6 + - docker.io/arangodb/arangodb:3.11.7 topology: - single db-ext-names: @@ -204,11 +209,10 @@ jobs: ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }} STARTER_MODE: ${{matrix.topology}} DOCKER_IMAGE: ${{matrix.docker-img}} - EXTENDED_NAMES: ${{matrix.db-ext-names}} - name: Info run: mvn -version - name: Test - run: mvn --no-transfer-progress -am -pl driver test -Dadb.jackson.version=${{matrix.jackson-version}} + run: mvn --no-transfer-progress -am -pl driver test -Dadb.jackson.version=${{matrix.jackson-version}} -DenableSlowTests=true integration-tests: if: '! github.event.pull_request.draft' @@ -219,7 +223,7 @@ jobs: fail-fast: false matrix: docker-img: - - docker.io/arangodb/arangodb:3.11.6 + - docker.io/arangodb/arangodb:3.11.7 topology: - single - cluster @@ -245,16 +249,16 @@ jobs: run: mvn --no-transfer-progress install -DskipTests=true -Dgpg.skip=true -Dmaven.javadoc.skip=true - name: Test internal-serde working-directory: integration-tests - run: mvn --no-transfer-progress -Pinternal-serde test + run: mvn --no-transfer-progress -Pinternal-serde -DenableSlowTests=true test - name: Test jackson-serde working-directory: integration-tests - run: mvn --no-transfer-progress -Pjackson-serde test + run: mvn --no-transfer-progress -Pjackson-serde -DenableSlowTests=true test - name: Test jsonb-serde working-directory: integration-tests - run: mvn --no-transfer-progress -Pjsonb-serde test + run: mvn --no-transfer-progress -Pjsonb-serde -DenableSlowTests=true test - name: Test plain working-directory: integration-tests - run: mvn --no-transfer-progress -Pplain test + run: mvn --no-transfer-progress -Pplain -DenableSlowTests=true test sonar: if: '! github.event.pull_request.draft' @@ -265,7 +269,7 @@ jobs: fail-fast: false matrix: docker-img: - - docker.io/arangodb/enterprise:3.11.6 + - docker.io/arangodb/enterprise:3.11.7 topology: - cluster db-ext-names: @@ -289,7 +293,6 @@ jobs: ARANGO_LICENSE_KEY: ${{ secrets.ARANGO_LICENSE_KEY }} STARTER_MODE: ${{matrix.topology}} DOCKER_IMAGE: ${{matrix.docker-img}} - EXTENDED_NAMES: ${{matrix.db-ext-names}} - name: Info run: mvn -version - name: Cache SonarCloud packages @@ -302,4 +305,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn --no-transfer-progress -Pstatic-code-analysis -B -Dgpg.skip=true -am -pl driver verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=arangodb_arangodb-java-driver -Dmaven.javadoc.skip=true + run: mvn --no-transfer-progress -Pstatic-code-analysis -B -Dgpg.skip=true -am -pl driver verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=arangodb_arangodb-java-driver -Dmaven.javadoc.skip=true -DenableSlowTests=true diff --git a/docker/start_db.sh b/docker/start_db.sh index 225533590..5d537ec6d 100755 --- a/docker/start_db.sh +++ b/docker/start_db.sh @@ -4,7 +4,6 @@ # STARTER_MODE: (single|cluster|activefailover), default single # DOCKER_IMAGE: ArangoDB docker image, default docker.io/arangodb/arangodb:latest # SSL: (true|false), default false -# EXTENDED_NAMES: (true|false), default false # ARANGO_LICENSE_KEY: only required for ArangoDB Enterprise # EXAMPLE: @@ -13,7 +12,6 @@ STARTER_MODE=${STARTER_MODE:=single} DOCKER_IMAGE=${DOCKER_IMAGE:=docker.io/arangodb/arangodb:latest} SSL=${SSL:=false} -EXTENDED_NAMES=${EXTENDED_NAMES:=false} STARTER_DOCKER_IMAGE=docker.io/arangodb/arangodb-starter:latest GW=172.28.0.1 @@ -46,10 +44,6 @@ if [ "$SSL" == "true" ]; then ARANGOSH_SCHEME=http+ssl fi -if [ "$EXTENDED_NAMES" == "true" ]; then - STARTER_ARGS="${STARTER_ARGS} --all.database.extended-names=true" -fi - if [ "$USE_MOUNTED_DATA" == "true" ]; then STARTER_ARGS="${STARTER_ARGS} --starter.data-dir=/data" MOUNT_DATA="-v $LOCATION/data:/data" diff --git a/driver/src/test/java/CommunicationTest.java b/driver/src/test/java/CommunicationTest.java index c24ace7e6..8cd265501 100644 --- a/driver/src/test/java/CommunicationTest.java +++ b/driver/src/test/java/CommunicationTest.java @@ -1,5 +1,6 @@ import com.arangodb.*; import com.arangodb.config.ArangoConfigProperties; +import com.arangodb.util.SlowTest; import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; @@ -10,13 +11,17 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; +import static org.junit.jupiter.api.Assumptions.assumeTrue; public class CommunicationTest { + @SlowTest @ParameterizedTest @EnumSource(Protocol.class) @Timeout(5) void disconnectAsync(Protocol protocol) throws InterruptedException, ExecutionException { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ArangoDBAsync arangoDB = new ArangoDB.Builder() .loadProperties(ArangoConfigProperties.fromFile()) .protocol(protocol) @@ -36,10 +41,13 @@ void disconnectAsync(Protocol protocol) throws InterruptedException, ExecutionEx .hasMessageContaining("closed"); } + @SlowTest @ParameterizedTest @EnumSource(Protocol.class) @Timeout(5) void disconnect(Protocol protocol) { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ArangoDB arangoDB = new ArangoDB.Builder() .loadProperties(ArangoConfigProperties.fromFile()) .protocol(protocol) diff --git a/driver/src/test/java/com/arangodb/ArangoCollectionAsyncTest.java b/driver/src/test/java/com/arangodb/ArangoCollectionAsyncTest.java index 170901318..e2c3ca18d 100644 --- a/driver/src/test/java/com/arangodb/ArangoCollectionAsyncTest.java +++ b/driver/src/test/java/com/arangodb/ArangoCollectionAsyncTest.java @@ -28,10 +28,7 @@ import com.arangodb.serde.jackson.JacksonSerde; import com.arangodb.serde.jackson.Key; import com.arangodb.serde.jackson.Rev; -import com.arangodb.util.MapBuilder; -import com.arangodb.util.RawBytes; -import com.arangodb.util.RawData; -import com.arangodb.util.RawJson; +import com.arangodb.util.*; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.core.JsonProcessingException; @@ -64,11 +61,11 @@ class ArangoCollectionAsyncTest extends BaseJunit5 { private final ObjectMapper mapper = new ObjectMapper(); private static Stream asyncCols() { - return asyncDbsStream().map(db -> db.collection(COLLECTION_NAME)).map(Arguments::of); + return asyncDbsStream().map(mapNamedPayload(db -> db.collection(COLLECTION_NAME))).map(Arguments::of); } private static Stream edges() { - return dbsStream().map(db -> db.collection(EDGE_COLLECTION_NAME)).map(Arguments::of); + return dbsStream().map(mapNamedPayload(db -> db.collection(EDGE_COLLECTION_NAME))).map(Arguments::of); } @BeforeAll @@ -77,7 +74,7 @@ static void init() { initEdgeCollections(EDGE_COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocument(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateEntity doc = collection.insertDocument(new BaseDocument(), null).get(); @@ -89,7 +86,7 @@ void insertDocument(ArangoCollectionAsync collection) throws ExecutionException, assertThat(doc.getId()).isEqualTo(COLLECTION_NAME + "/" + doc.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentWithArrayWithNullValues(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { List arr = Arrays.asList("a", null); @@ -107,7 +104,7 @@ void insertDocumentWithArrayWithNullValues(ArangoCollectionAsync collection) thr assertThat((List) insertedDoc.getNew().getAttribute("arr")).containsAll(Arrays.asList("a", null)); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentWithNullValues(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -123,7 +120,7 @@ void insertDocumentWithNullValues(ArangoCollectionAsync collection) throws Execu assertThat(insertedDoc.getNew().getProperties()).containsKey("null"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentUpdateRev(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -132,7 +129,7 @@ void insertDocumentUpdateRev(ArangoCollectionAsync collection) throws ExecutionE assertThat(createResult.getRev()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentReturnNew(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateOptions options = new DocumentCreateOptions().returnNew(true); @@ -144,7 +141,7 @@ void insertDocumentReturnNew(ArangoCollectionAsync collection) throws ExecutionE assertThat(doc.getNew()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentWithTypeOverwriteModeReplace(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -179,7 +176,7 @@ void insertDocumentWithTypeOverwriteModeReplace(ArangoCollectionAsync collection assertThat(doc.getNew().getName()).isEqualTo("Luna"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeIgnore(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -198,7 +195,7 @@ void insertDocumentOverwriteModeIgnore(ArangoCollectionAsync collection) throws assertThat(insertIgnore.getRev()).isEqualTo(meta.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeConflict(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -217,7 +214,7 @@ void insertDocumentOverwriteModeConflict(ArangoCollectionAsync collection) throw assertThat(e.getErrorNum()).isEqualTo(1210); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeReplace(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -238,7 +235,7 @@ void insertDocumentOverwriteModeReplace(ArangoCollectionAsync collection) throws assertThat(repsert.getNew().getAttribute("bar")).isEqualTo("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeUpdate(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -257,7 +254,7 @@ void insertDocumentOverwriteModeUpdate(ArangoCollectionAsync collection) throws assertThat(updated.getNew().getAttribute("bar")).isEqualTo("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeUpdateMergeObjectsFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -277,7 +274,7 @@ void insertDocumentOverwriteModeUpdateMergeObjectsFalse(ArangoCollectionAsync co assertThat(updated.getNew().getAttribute("foo")).isEqualTo(fieldB); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeUpdateKeepNullTrue(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -295,7 +292,7 @@ void insertDocumentOverwriteModeUpdateKeepNullTrue(ArangoCollectionAsync collect assertThat(updated.getProperties()).containsEntry("foo", null); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentOverwriteModeUpdateKeepNullFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -313,7 +310,7 @@ void insertDocumentOverwriteModeUpdateKeepNullFalse(ArangoCollectionAsync collec assertThat(updated.getProperties()).doesNotContainKey("foo"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentWaitForSync(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateOptions options = new DocumentCreateOptions().waitForSync(true); @@ -325,7 +322,7 @@ void insertDocumentWaitForSync(ArangoCollectionAsync collection) throws Executio assertThat(doc.getNew()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentRefillIndexCaches(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateOptions options = new DocumentCreateOptions().refillIndexCaches(true); @@ -337,7 +334,7 @@ void insertDocumentRefillIndexCaches(ArangoCollectionAsync collection) throws Ex assertThat(doc.getNew()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentAsJson(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String key = "doc-" + UUID.randomUUID(); @@ -349,7 +346,7 @@ void insertDocumentAsJson(ArangoCollectionAsync collection) throws ExecutionExce assertThat(doc.getRev()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentAsBytes(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String key = "doc-" + UUID.randomUUID(); @@ -370,7 +367,7 @@ void insertDocumentAsBytes(ArangoCollectionAsync collection) throws ExecutionExc assertThat(newDoc).containsAllEntriesOf(doc); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentSilent(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -382,7 +379,7 @@ void insertDocumentSilent(ArangoCollectionAsync collection) throws ExecutionExce assertThat(meta.getRev()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentSilentDontTouchInstance(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -396,7 +393,7 @@ void insertDocumentSilentDontTouchInstance(ArangoCollectionAsync collection) thr assertThat(doc.getKey()).isEqualTo(key); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsSilent(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -409,7 +406,7 @@ void insertDocumentsSilent(ArangoCollectionAsync collection) throws ExecutionExc assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsRefillIndexCaches(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final MultiDocumentEntity> info = @@ -418,7 +415,7 @@ void insertDocumentsRefillIndexCaches(ArangoCollectionAsync collection) throws E assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocument(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument(), null).get(); @@ -428,7 +425,7 @@ void getDocument(ArangoCollectionAsync collection) throws ExecutionException, In assertThat(readResult.getId()).isEqualTo(COLLECTION_NAME + "/" + createResult.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentIfMatch(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument(), null).get(); @@ -439,7 +436,7 @@ void getDocumentIfMatch(ArangoCollectionAsync collection) throws ExecutionExcept assertThat(readResult.getId()).isEqualTo(COLLECTION_NAME + "/" + createResult.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentIfMatchFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument(), null).get(); @@ -449,7 +446,7 @@ void getDocumentIfMatchFail(ArangoCollectionAsync collection) throws ExecutionEx assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentIfNoneMatch(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument(), null).get(); @@ -460,7 +457,7 @@ void getDocumentIfNoneMatch(ArangoCollectionAsync collection) throws ExecutionEx assertThat(readResult.getId()).isEqualTo(COLLECTION_NAME + "/" + createResult.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentIfNoneMatchFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument(), null).get(); @@ -470,7 +467,7 @@ void getDocumentIfNoneMatchFail(ArangoCollectionAsync collection) throws Executi assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentAsJson(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String key = rnd(); @@ -480,35 +477,36 @@ void getDocumentAsJson(ArangoCollectionAsync collection) throws ExecutionExcepti assertThat(readResult.get()).contains("\"_key\":\"" + key + "\"").contains("\"_id\":\"" + COLLECTION_NAME + "/" + key + "\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentNotFound(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument document = collection.getDocument("no", BaseDocument.class).get(); assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentNotFoundOptionsDefault(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument document = collection.getDocument("no", BaseDocument.class, new DocumentReadOptions()).get(); assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentNotFoundOptionsNull(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument document = collection.getDocument("no", BaseDocument.class, null).get(); assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentWrongKey(ArangoCollectionAsync collection) { Throwable thrown = catchThrowable(() -> collection.getDocument("no/no", BaseDocument.class).get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncCols") void getDocumentDirtyRead(ArangoCollectionAsync collection) throws InterruptedException, ExecutionException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -519,7 +517,7 @@ void getDocumentDirtyRead(ArangoCollectionAsync collection) throws InterruptedEx assertThat(document).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocuments(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -537,7 +535,7 @@ void getDocuments(ArangoCollectionAsync collection) throws ExecutionException, I } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentsWithCustomShardingKey(ArangoCollectionAsync c) throws ExecutionException, InterruptedException { ArangoCollectionAsync collection = c.db().collection("customShardingKeyCollection"); @@ -559,7 +557,7 @@ void getDocumentsWithCustomShardingKey(ArangoCollectionAsync c) throws Execution assertThat(documents).hasSize(10); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentsDirtyRead(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -580,7 +578,7 @@ void getDocumentsDirtyRead(ArangoCollectionAsync collection) throws ExecutionExc } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentsNotFound(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final MultiDocumentEntity readResult = collection.getDocuments(Collections.singleton("no"), @@ -590,7 +588,7 @@ void getDocumentsNotFound(ArangoCollectionAsync collection) throws ExecutionExce assertThat(readResult.getErrors()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getDocumentsWrongKey(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final MultiDocumentEntity readResult = collection.getDocuments(Collections.singleton("no/no"), @@ -600,7 +598,7 @@ void getDocumentsWrongKey(ArangoCollectionAsync collection) throws ExecutionExce assertThat(readResult.getErrors()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocument(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -629,7 +627,7 @@ void updateDocument(ArangoCollectionAsync collection) throws ExecutionException, assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentWithDifferentReturnType(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final String key = "key-" + UUID.randomUUID(); @@ -647,7 +645,7 @@ void updateDocumentWithDifferentReturnType(ArangoCollectionAsync collection) thr assertThat(updated.getAttribute("b")).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentUpdateRev(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -662,7 +660,7 @@ void updateDocumentUpdateRev(ArangoCollectionAsync collection) throws ExecutionE .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentIfMatch(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -690,7 +688,7 @@ void updateDocumentIfMatch(ArangoCollectionAsync collection) throws ExecutionExc assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentIfMatchFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -706,7 +704,7 @@ void updateDocumentIfMatchFail(ArangoCollectionAsync collection) throws Executio assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentReturnNew(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -729,7 +727,7 @@ void updateDocumentReturnNew(ArangoCollectionAsync collection) throws ExecutionE assertThat(String.valueOf(updateResult.getNew().getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentReturnOld(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -751,7 +749,7 @@ void updateDocumentReturnOld(ArangoCollectionAsync collection) throws ExecutionE assertThat(updateResult.getOld().getProperties().keySet()).doesNotContain("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentKeepNullTrue(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -771,7 +769,7 @@ void updateDocumentKeepNullTrue(ArangoCollectionAsync collection) throws Executi assertThat(readResult.getProperties()).containsKey("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentKeepNullFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -793,7 +791,7 @@ void updateDocumentKeepNullFalse(ArangoCollectionAsync collection) throws Execut assertThat(readResult.getProperties().keySet()).doesNotContain("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentSerializeNullTrue(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final TestUpdateEntity doc = new TestUpdateEntity(); @@ -812,7 +810,7 @@ void updateDocumentSerializeNullTrue(ArangoCollectionAsync collection) throws Ex assertThat(readResult.getAttribute("a")).isEqualTo("bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentSerializeNullFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final TestUpdateEntitySerializeNullFalse doc = new TestUpdateEntitySerializeNullFalse(); @@ -832,7 +830,7 @@ void updateDocumentSerializeNullFalse(ArangoCollectionAsync collection) throws E assertThat(readResult.getAttribute("b")).isEqualTo("foo"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentMergeObjectsTrue(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -859,7 +857,7 @@ void updateDocumentMergeObjectsTrue(ArangoCollectionAsync collection) throws Exe assertThat(aMap).containsKeys("a", "b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentMergeObjectsFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -887,7 +885,7 @@ void updateDocumentMergeObjectsFalse(ArangoCollectionAsync collection) throws Ex assertThat(aMap).containsKey("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentIgnoreRevsFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -901,7 +899,7 @@ void updateDocumentIgnoreRevsFalse(ArangoCollectionAsync collection) throws Exec assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentSilent(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -914,7 +912,7 @@ void updateDocumentSilent(ArangoCollectionAsync collection) throws ExecutionExce assertThat(meta.getRev()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsSilent(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -928,7 +926,7 @@ void updateDocumentsSilent(ArangoCollectionAsync collection) throws ExecutionExc assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateNonExistingDocument(ArangoCollectionAsync collection) { final BaseDocument doc = new BaseDocument("test-" + rnd()); @@ -942,7 +940,7 @@ void updateNonExistingDocument(ArangoCollectionAsync collection) { assertThat(e.getErrorNum()).isEqualTo(1202); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentPreconditionFailed(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument("test-" + rnd()); @@ -963,7 +961,7 @@ void updateDocumentPreconditionFailed(ArangoCollectionAsync collection) throws E assertThat(readDocument.getAttribute("foo")).isEqualTo("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentRefillIndexCaches(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { BaseDocument doc = new BaseDocument(); @@ -976,7 +974,7 @@ void updateDocumentRefillIndexCaches(ArangoCollectionAsync collection) throws Ex .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsRefillIndexCaches(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument()).get(); @@ -986,7 +984,7 @@ void updateDocumentsRefillIndexCaches(ArangoCollectionAsync collection) throws E assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocument(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1011,7 +1009,7 @@ void replaceDocument(ArangoCollectionAsync collection) throws ExecutionException assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentUpdateRev(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1025,7 +1023,7 @@ void replaceDocumentUpdateRev(ArangoCollectionAsync collection) throws Execution .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentIfMatch(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1049,7 +1047,7 @@ void replaceDocumentIfMatch(ArangoCollectionAsync collection) throws ExecutionEx assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentIfMatchFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1064,7 +1062,7 @@ void replaceDocumentIfMatchFail(ArangoCollectionAsync collection) throws Executi } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentIgnoreRevsFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1079,7 +1077,7 @@ void replaceDocumentIgnoreRevsFalse(ArangoCollectionAsync collection) throws Exe assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentReturnNew(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1101,7 +1099,7 @@ void replaceDocumentReturnNew(ArangoCollectionAsync collection) throws Execution assertThat(String.valueOf(replaceResult.getNew().getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentReturnOld(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1123,7 +1121,7 @@ void replaceDocumentReturnOld(ArangoCollectionAsync collection) throws Execution assertThat(replaceResult.getOld().getProperties().keySet()).doesNotContain("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentSilent(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -1136,7 +1134,7 @@ void replaceDocumentSilent(ArangoCollectionAsync collection) throws ExecutionExc assertThat(meta.getRev()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentSilentDontTouchInstance(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -1149,7 +1147,7 @@ void replaceDocumentSilentDontTouchInstance(ArangoCollectionAsync collection) th assertThat(createResult.getRev()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentsSilent(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -1163,7 +1161,7 @@ void replaceDocumentsSilent(ArangoCollectionAsync collection) throws ExecutionEx assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentRefillIndexCaches(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1175,7 +1173,7 @@ void replaceDocumentRefillIndexCaches(ArangoCollectionAsync collection) throws E .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentsRefillIndexCaches(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument()).get(); @@ -1185,7 +1183,7 @@ void replaceDocumentsRefillIndexCaches(ArangoCollectionAsync collection) throws assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocument(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1195,7 +1193,7 @@ void deleteDocument(ArangoCollectionAsync collection) throws ExecutionException, assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentReturnOld(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1210,7 +1208,7 @@ void deleteDocumentReturnOld(ArangoCollectionAsync collection) throws ExecutionE assertThat(String.valueOf(deleteResult.getOld().getAttribute("a"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentIfMatch(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1221,7 +1219,7 @@ void deleteDocumentIfMatch(ArangoCollectionAsync collection) throws ExecutionExc assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentIfMatchFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1231,7 +1229,7 @@ void deleteDocumentIfMatchFail(ArangoCollectionAsync collection) throws Executio assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentSilent(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -1244,7 +1242,7 @@ void deleteDocumentSilent(ArangoCollectionAsync collection) throws ExecutionExce assertThat(meta.getRev()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentsSilent(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -1259,7 +1257,7 @@ void deleteDocumentsSilent(ArangoCollectionAsync collection) throws ExecutionExc assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentRefillIndexCaches(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument()).get(); @@ -1270,7 +1268,7 @@ void deleteDocumentRefillIndexCaches(ArangoCollectionAsync collection) throws Ex .isEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentsRefillIndexCaches(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -1282,7 +1280,7 @@ void deleteDocumentsRefillIndexCaches(ArangoCollectionAsync collection) throws E assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getIndex(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection fields = new ArrayList<>(); @@ -1293,7 +1291,7 @@ void getIndex(ArangoCollectionAsync collection) throws ExecutionException, Inter assertThat(readResult.getType()).isEqualTo(createResult.getType()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getIndexByKey(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection fields = new ArrayList<>(); @@ -1304,7 +1302,7 @@ void getIndexByKey(ArangoCollectionAsync collection) throws ExecutionException, assertThat(readResult.getType()).isEqualTo(createResult.getType()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteIndex(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection fields = new ArrayList<>(); @@ -1316,7 +1314,7 @@ void deleteIndex(ArangoCollectionAsync collection) throws ExecutionException, In assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteIndexByKey(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection fields = new ArrayList<>(); @@ -1328,7 +1326,7 @@ void deleteIndexByKey(ArangoCollectionAsync collection) throws ExecutionExceptio assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createGeoIndex(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String f1 = "field-" + rnd(); @@ -1351,7 +1349,7 @@ void createGeoIndex(ArangoCollectionAsync collection) throws ExecutionException, } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createGeoIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -1381,7 +1379,7 @@ void createGeoIndexWithOptions(ArangoCollectionAsync collection) throws Executio } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createGeoIndexLegacyPolygons(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -1412,7 +1410,7 @@ void createGeoIndexLegacyPolygons(ArangoCollectionAsync collection) throws Execu } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createGeo2Index(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String f1 = "field-" + rnd(); @@ -1435,7 +1433,7 @@ void createGeo2Index(ArangoCollectionAsync collection) throws ExecutionException } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createGeo2IndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -1465,7 +1463,7 @@ void createGeo2IndexWithOptions(ArangoCollectionAsync collection) throws Executi assertThat(indexResult.getName()).isEqualTo(name); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createPersistentIndex(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String f1 = "field-" + rnd(); @@ -1489,7 +1487,7 @@ void createPersistentIndex(ArangoCollectionAsync collection) throws ExecutionExc } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createPersistentIndexCacheEnabled(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -1513,7 +1511,7 @@ void createPersistentIndexCacheEnabled(ArangoCollectionAsync collection) throws assertThat(indexResult.getCacheEnabled()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createPersistentIndexStoredValues(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -1540,7 +1538,7 @@ void createPersistentIndexStoredValues(ArangoCollectionAsync collection) throws .contains("v1", "v2"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createPersistentIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -1567,7 +1565,7 @@ void createPersistentIndexWithOptions(ArangoCollectionAsync collection) throws E assertThat(indexResult.getName()).isEqualTo(name); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createZKDIndex(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 9)); @@ -1589,7 +1587,7 @@ void createZKDIndex(ArangoCollectionAsync collection) throws ExecutionException, collection.deleteIndex(indexResult.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createZKDIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 9)); @@ -1617,7 +1615,7 @@ void createZKDIndexWithOptions(ArangoCollectionAsync collection) throws Executio collection.deleteIndex(indexResult.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void indexEstimates(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -1638,7 +1636,7 @@ void indexEstimates(ArangoCollectionAsync collection) throws ExecutionException, assertThat(indexResult.getSelectivityEstimate()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void indexEstimatesFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -1659,7 +1657,7 @@ void indexEstimatesFalse(ArangoCollectionAsync collection) throws ExecutionExcep assertThat(indexResult.getSelectivityEstimate()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void indexDeduplicate(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -1678,7 +1676,7 @@ void indexDeduplicate(ArangoCollectionAsync collection) throws ExecutionExceptio assertThat(indexResult.getDeduplicate()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void indexDeduplicateFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -1697,7 +1695,7 @@ void indexDeduplicateFalse(ArangoCollectionAsync collection) throws ExecutionExc assertThat(indexResult.getDeduplicate()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createFulltextIndex(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String f1 = "field-" + rnd(); @@ -1713,7 +1711,7 @@ void createFulltextIndex(ArangoCollectionAsync collection) throws ExecutionExcep assertThat(indexResult.getUnique()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createFulltextIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -1736,7 +1734,7 @@ void createFulltextIndexWithOptions(ArangoCollectionAsync collection) throws Exe assertThat(indexResult.getName()).isEqualTo(name); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createTtlIndexWithoutOptions(ArangoCollectionAsync collection) { assumeTrue(isAtLeastVersion(3, 5)); @@ -1751,7 +1749,7 @@ void createTtlIndexWithoutOptions(ArangoCollectionAsync collection) { assertThat(e.getMessage()).contains("expireAfter attribute must be a number"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createTtlIndexWithOptions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -1777,7 +1775,7 @@ void createTtlIndexWithOptions(ArangoCollectionAsync collection) throws Executio collection.deleteIndex(indexResult.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getIndexes(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String f1 = "field-" + rnd(); @@ -1788,7 +1786,7 @@ void getIndexes(ArangoCollectionAsync collection) throws ExecutionException, Int assertThat(matchingIndexes).isEqualTo(1L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void getEdgeIndex(ArangoCollection edgeCollection) { Collection indexes = edgeCollection.getIndexes(); @@ -1798,14 +1796,14 @@ void getEdgeIndex(ArangoCollection edgeCollection) { assertThat(edgeIndexes).isEqualTo(1L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void exists(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assertThat(collection.exists().get()).isTrue(); assertThat(collection.db().collection(COLLECTION_NAME + "no").exists().get()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void truncate(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1819,7 +1817,7 @@ void truncate(ArangoCollectionAsync collection) throws ExecutionException, Inter assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getCount(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { Long initialCount = collection.count().get().getCount(); @@ -1828,7 +1826,7 @@ void getCount(ArangoCollectionAsync collection) throws ExecutionException, Inter assertThat(count.getCount()).isEqualTo(initialCount + 1L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void documentExists(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Boolean existsNot = collection.documentExists(rnd(), null).get(); @@ -1841,7 +1839,7 @@ void documentExists(ArangoCollectionAsync collection) throws ExecutionException, assertThat(exists).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void documentExistsIfMatch(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String key = rnd(); @@ -1852,7 +1850,7 @@ void documentExistsIfMatch(ArangoCollectionAsync collection) throws ExecutionExc assertThat(exists).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void documentExistsIfMatchFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String key = rnd(); @@ -1863,7 +1861,7 @@ void documentExistsIfMatchFail(ArangoCollectionAsync collection) throws Executio assertThat(exists).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void documentExistsIfNoneMatch(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String key = rnd(); @@ -1874,7 +1872,7 @@ void documentExistsIfNoneMatch(ArangoCollectionAsync collection) throws Executio assertThat(exists).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void documentExistsIfNoneMatchFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String key = rnd(); @@ -1885,7 +1883,7 @@ void documentExistsIfNoneMatchFail(ArangoCollectionAsync collection) throws Exec assertThat(exists).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocuments(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = Arrays.asList(new BaseDocument(), new BaseDocument(), @@ -1899,7 +1897,7 @@ void insertDocuments(ArangoCollectionAsync collection) throws ExecutionException assertThat(docs.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsOverwriteModeUpdate(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -1929,7 +1927,7 @@ void insertDocumentsOverwriteModeUpdate(ArangoCollectionAsync collection) throws } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsJson(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -1944,7 +1942,7 @@ void insertDocumentsJson(ArangoCollectionAsync collection) throws ExecutionExcep assertThat(docs.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsRawData(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final RawData values = RawJson.of("[{},{},{}]"); @@ -1956,7 +1954,7 @@ void insertDocumentsRawData(ArangoCollectionAsync collection) throws ExecutionEx assertThat(docs.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsRawDataReturnNew(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final RawData values = RawJson.of("[{\"aaa\":33},{\"aaa\":33},{\"aaa\":33}]"); @@ -1980,7 +1978,7 @@ void insertDocumentsRawDataReturnNew(ArangoCollectionAsync collection) throws Ex } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsOne(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -1993,7 +1991,7 @@ void insertDocumentsOne(ArangoCollectionAsync collection) throws ExecutionExcept assertThat(docs.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsEmpty(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2005,7 +2003,7 @@ void insertDocumentsEmpty(ArangoCollectionAsync collection) throws ExecutionExce assertThat(docs.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsReturnNew(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2028,7 +2026,7 @@ void insertDocumentsReturnNew(ArangoCollectionAsync collection) throws Execution } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void insertDocumentsFail(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String k1 = rnd(); @@ -2045,7 +2043,7 @@ void insertDocumentsFail(ArangoCollectionAsync collection) throws ExecutionExcep assertThat(docs.getErrors().iterator().next().getErrorNum()).isEqualTo(1210); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocuments(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = Arrays.asList(new BaseDocument(), new BaseDocument(), @@ -2061,7 +2059,7 @@ void importDocuments(ArangoCollectionAsync collection) throws ExecutionException assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJsonList(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = Arrays.asList( @@ -2080,7 +2078,7 @@ void importDocumentsJsonList(ArangoCollectionAsync collection) throws ExecutionE assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsDuplicateDefaultError(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String k1 = rnd(); @@ -2099,7 +2097,7 @@ void importDocumentsDuplicateDefaultError(ArangoCollectionAsync collection) thro assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsDuplicateError(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String k1 = rnd(); @@ -2119,7 +2117,7 @@ void importDocumentsDuplicateError(ArangoCollectionAsync collection) throws Exec assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsDuplicateIgnore(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String k1 = rnd(); @@ -2139,7 +2137,7 @@ void importDocumentsDuplicateIgnore(ArangoCollectionAsync collection) throws Exe assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsDuplicateReplace(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String k1 = rnd(); @@ -2159,7 +2157,7 @@ void importDocumentsDuplicateReplace(ArangoCollectionAsync collection) throws Ex assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsDuplicateUpdate(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String k1 = rnd(); @@ -2179,7 +2177,7 @@ void importDocumentsDuplicateUpdate(ArangoCollectionAsync collection) throws Exe assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsCompleteFail(ArangoCollectionAsync collection) { String k1 = rnd(); @@ -2195,7 +2193,7 @@ void importDocumentsCompleteFail(ArangoCollectionAsync collection) { assertThat(e.getErrorNum()).isEqualTo(1210); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsDetails(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { String k1 = rnd(); @@ -2215,7 +2213,7 @@ void importDocumentsDetails(ArangoCollectionAsync collection) throws ExecutionEx assertThat(docs.getDetails().iterator().next()).contains("unique constraint violated"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsOverwriteFalse(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { collection.insertDocument(new BaseDocument()).get(); @@ -2228,7 +2226,7 @@ void importDocumentsOverwriteFalse(ArangoCollectionAsync collection) throws Exec assertThat(collection.count().get().getCount()).isEqualTo(initialCount + 2L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsOverwriteTrue(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { collection.insertDocument(new BaseDocument()).get(); @@ -2240,7 +2238,7 @@ void importDocumentsOverwriteTrue(ArangoCollectionAsync collection) throws Execu assertThat(collection.count().get().getCount()).isEqualTo(2L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void importDocumentsFromToPrefix(ArangoCollection edgeCollection) { final Collection values = new ArrayList<>(); @@ -2262,7 +2260,7 @@ void importDocumentsFromToPrefix(ArangoCollection edgeCollection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJson(ArangoCollectionAsync collection) throws JsonProcessingException, ExecutionException, InterruptedException { final String values = mapper.writeValueAsString(Arrays.asList(Collections.singletonMap("_key", rnd()), @@ -2278,7 +2276,7 @@ void importDocumentsJson(ArangoCollectionAsync collection) throws JsonProcessing assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJsonDuplicateDefaultError(ArangoCollectionAsync collection) throws JsonProcessingException, ExecutionException, InterruptedException { String k1 = rnd(); @@ -2297,7 +2295,7 @@ void importDocumentsJsonDuplicateDefaultError(ArangoCollectionAsync collection) assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJsonDuplicateError(ArangoCollectionAsync collection) throws JsonProcessingException, ExecutionException, InterruptedException { String k1 = rnd(); @@ -2317,7 +2315,7 @@ void importDocumentsJsonDuplicateError(ArangoCollectionAsync collection) throws assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJsonDuplicateIgnore(ArangoCollectionAsync collection) throws JsonProcessingException, ExecutionException, InterruptedException { String k1 = rnd(); @@ -2336,7 +2334,7 @@ void importDocumentsJsonDuplicateIgnore(ArangoCollectionAsync collection) throws assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJsonDuplicateReplace(ArangoCollectionAsync collection) throws JsonProcessingException, ExecutionException, InterruptedException { String k1 = rnd(); @@ -2356,7 +2354,7 @@ void importDocumentsJsonDuplicateReplace(ArangoCollectionAsync collection) throw assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJsonDuplicateUpdate(ArangoCollectionAsync collection) throws JsonProcessingException, ExecutionException, InterruptedException { String k1 = rnd(); @@ -2376,7 +2374,7 @@ void importDocumentsJsonDuplicateUpdate(ArangoCollectionAsync collection) throws assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJsonCompleteFail(ArangoCollectionAsync collection) { final String values = "[{\"_key\":\"1\"},{\"_key\":\"2\"},{\"_key\":\"2\"}]"; @@ -2387,7 +2385,7 @@ void importDocumentsJsonCompleteFail(ArangoCollectionAsync collection) { assertThat(e.getErrorNum()).isEqualTo(1210); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJsonDetails(ArangoCollectionAsync collection) throws JsonProcessingException, ExecutionException, InterruptedException { String k1 = rnd(); @@ -2408,7 +2406,7 @@ void importDocumentsJsonDetails(ArangoCollectionAsync collection) throws JsonPro assertThat(docs.getDetails().iterator().next()).contains("unique constraint violated"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJsonOverwriteFalse(ArangoCollectionAsync collection) throws JsonProcessingException, ExecutionException, InterruptedException { collection.insertDocument(new BaseDocument()).get(); @@ -2420,7 +2418,7 @@ void importDocumentsJsonOverwriteFalse(ArangoCollectionAsync collection) throws assertThat(collection.count().get().getCount()).isEqualTo(initialCount + 2L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void importDocumentsJsonOverwriteTrue(ArangoCollectionAsync collection) throws JsonProcessingException, ExecutionException, InterruptedException { collection.insertDocument(new BaseDocument()).get(); @@ -2431,7 +2429,7 @@ void importDocumentsJsonOverwriteTrue(ArangoCollectionAsync collection) throws J assertThat(collection.count().get().getCount()).isEqualTo(2L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void importDocumentsJsonFromToPrefix(ArangoCollection edgeCollection) throws JsonProcessingException { String k1 = UUID.randomUUID().toString(); @@ -2454,7 +2452,7 @@ void importDocumentsJsonFromToPrefix(ArangoCollection edgeCollection) throws Jso } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentsByKey(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2481,7 +2479,7 @@ void deleteDocumentsByKey(ArangoCollectionAsync collection) throws ExecutionExce assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentsRawDataByKeyReturnOld(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final RawData values = RawJson.of("[{\"_key\":\"1\"},{\"_key\":\"2\"}]"); @@ -2500,7 +2498,7 @@ void deleteDocumentsRawDataByKeyReturnOld(ArangoCollectionAsync collection) thro assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentsByDocuments(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2524,7 +2522,7 @@ void deleteDocumentsByDocuments(ArangoCollectionAsync collection) throws Executi assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentsByKeyOne(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2545,7 +2543,7 @@ void deleteDocumentsByKeyOne(ArangoCollectionAsync collection) throws ExecutionE assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentsByDocumentOne(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2564,7 +2562,7 @@ void deleteDocumentsByDocumentOne(ArangoCollectionAsync collection) throws Execu assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentsEmpty(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2576,7 +2574,7 @@ void deleteDocumentsEmpty(ArangoCollectionAsync collection) throws ExecutionExce assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentsByKeyNotExisting(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2589,7 +2587,7 @@ void deleteDocumentsByKeyNotExisting(ArangoCollectionAsync collection) throws Ex assertThat(deleteResult.getErrors()).hasSize(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void deleteDocumentsByDocumentsNotExisting(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2609,7 +2607,7 @@ void deleteDocumentsByDocumentsNotExisting(ArangoCollectionAsync collection) thr assertThat(deleteResult.getErrors()).hasSize(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocuments(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = Arrays.asList(new BaseDocument(rnd()), new BaseDocument(rnd())); @@ -2621,7 +2619,7 @@ void updateDocuments(ArangoCollectionAsync collection) throws ExecutionException assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsWithDifferentReturnType(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { List keys = @@ -2646,7 +2644,7 @@ void updateDocumentsWithDifferentReturnType(ArangoCollectionAsync collection) th assertThat(updateResult.getDocuments().stream()).map(DocumentUpdateEntity::getNew).allMatch(it -> it.getAttribute("a").equals("test")).allMatch(it -> it.getAttribute("b").equals("test")); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsOne(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2665,7 +2663,7 @@ void updateDocumentsOne(ArangoCollectionAsync collection) throws ExecutionExcept assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsEmpty(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2674,7 +2672,7 @@ void updateDocumentsEmpty(ArangoCollectionAsync collection) throws ExecutionExce assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsWithoutKey(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2693,7 +2691,7 @@ void updateDocumentsWithoutKey(ArangoCollectionAsync collection) throws Executio assertThat(updateResult.getErrors()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsJson(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2709,7 +2707,7 @@ void updateDocumentsJson(ArangoCollectionAsync collection) throws ExecutionExcep assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsRawData(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final RawData values = RawJson.of("[{\"_key\":\"1\"}, {\"_key\":\"2\"}]"); @@ -2722,7 +2720,7 @@ void updateDocumentsRawData(ArangoCollectionAsync collection) throws ExecutionEx assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void updateDocumentsRawDataReturnNew(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final RawData values = RawJson.of("[{\"_key\":\"1\"}, {\"_key\":\"2\"}]"); @@ -2746,7 +2744,7 @@ void updateDocumentsRawDataReturnNew(ArangoCollectionAsync collection) throws Ex } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocuments(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2765,7 +2763,7 @@ void replaceDocuments(ArangoCollectionAsync collection) throws ExecutionExceptio assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentsOne(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2784,7 +2782,7 @@ void replaceDocumentsOne(ArangoCollectionAsync collection) throws ExecutionExcep assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentsEmpty(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2793,7 +2791,7 @@ void replaceDocumentsEmpty(ArangoCollectionAsync collection) throws ExecutionExc assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentsWithoutKey(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2812,7 +2810,7 @@ void replaceDocumentsWithoutKey(ArangoCollectionAsync collection) throws Executi assertThat(updateResult.getErrors()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentsJson(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final Collection values = new ArrayList<>(); @@ -2828,7 +2826,7 @@ void replaceDocumentsJson(ArangoCollectionAsync collection) throws ExecutionExce assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentsRawData(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final RawData values = RawJson.of("[{\"_key\":\"1\"}, {\"_key\":\"2\"}]"); @@ -2841,7 +2839,7 @@ void replaceDocumentsRawData(ArangoCollectionAsync collection) throws ExecutionE assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void replaceDocumentsRawDataReturnNew(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final RawData values = RawJson.of("[{\"_key\":\"1\"}, {\"_key\":\"2\"}]"); @@ -2865,14 +2863,14 @@ void replaceDocumentsRawDataReturnNew(ArangoCollectionAsync collection) throws E } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getInfo(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final CollectionEntity result = collection.getInfo().get(); assertThat(result.getName()).isEqualTo(COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getPropeties(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final CollectionPropertiesEntity result = collection.getProperties().get(); @@ -2880,7 +2878,7 @@ void getPropeties(ArangoCollectionAsync collection) throws ExecutionException, I assertThat(result.getCount()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void changeProperties(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final CollectionPropertiesEntity properties = collection.getProperties().get(); @@ -2915,7 +2913,7 @@ void changeProperties(ArangoCollectionAsync collection) throws ExecutionExceptio } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void rename(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -2942,7 +2940,7 @@ void rename(ArangoCollectionAsync collection) throws ExecutionException, Interru assertThat(e.getResponseCode()).isEqualTo(404); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void responsibleShard(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); @@ -2952,7 +2950,7 @@ void responsibleShard(ArangoCollectionAsync collection) throws ExecutionExceptio assertThat(shard.getShardId()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getRevision(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final CollectionRevisionEntity result = collection.getRevision().get(); @@ -2961,7 +2959,7 @@ void getRevision(ArangoCollectionAsync collection) throws ExecutionException, In assertThat(result.getRevision()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void keyWithSpecialCharacter(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final String key = "myKey_-:.@()+,=;$!*'%-" + UUID.randomUUID(); @@ -2971,7 +2969,7 @@ void keyWithSpecialCharacter(ArangoCollectionAsync collection) throws ExecutionE assertThat(doc.getKey()).isEqualTo(key); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void alreadyUrlEncodedkey(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { final String key = "http%3A%2F%2Fexample.com%2F-" + UUID.randomUUID(); @@ -2981,7 +2979,7 @@ void alreadyUrlEncodedkey(ArangoCollectionAsync collection) throws ExecutionExce assertThat(doc.getKey()).isEqualTo(key); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void grantAccessRW(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { ArangoDBAsync arangoDB = collection.db().arango(); @@ -2993,7 +2991,7 @@ void grantAccessRW(ArangoCollectionAsync collection) throws ExecutionException, } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void grantAccessRO(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { ArangoDBAsync arangoDB = collection.db().arango(); @@ -3005,7 +3003,7 @@ void grantAccessRO(ArangoCollectionAsync collection) throws ExecutionException, } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void grantAccessNONE(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { ArangoDBAsync arangoDB = collection.db().arango(); @@ -3017,14 +3015,14 @@ void grantAccessNONE(ArangoCollectionAsync collection) throws ExecutionException } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void grantAccessUserNotFound(ArangoCollectionAsync collection) { Throwable thrown = catchThrowable(() -> collection.grantAccess("user1", Permissions.RW).get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void revokeAccess(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { ArangoDBAsync arangoDB = collection.db().arango(); @@ -3036,14 +3034,14 @@ void revokeAccess(ArangoCollectionAsync collection) throws ExecutionException, I } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void revokeAccessUserNotFound(ArangoCollectionAsync collection) { Throwable thrown = catchThrowable(() -> collection.grantAccess("user1", Permissions.NONE).get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void resetAccess(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { ArangoDBAsync arangoDB = collection.db().arango(); @@ -3055,20 +3053,20 @@ void resetAccess(ArangoCollectionAsync collection) throws ExecutionException, In } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void resetAccessUserNotFound(ArangoCollectionAsync collection) { Throwable thrown = catchThrowable(() -> collection.resetAccess("user1").get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getPermissions(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assertThat(collection.getPermissions("root").get()).isEqualTo(Permissions.RW); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void annotationsInParamsAndMethods(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(collection.getSerde().getUserSerde() instanceof JacksonSerde, "JacksonSerde only"); diff --git a/driver/src/test/java/com/arangodb/ArangoCollectionTest.java b/driver/src/test/java/com/arangodb/ArangoCollectionTest.java index 6d4ba1c20..8d1087992 100644 --- a/driver/src/test/java/com/arangodb/ArangoCollectionTest.java +++ b/driver/src/test/java/com/arangodb/ArangoCollectionTest.java @@ -28,10 +28,7 @@ import com.arangodb.serde.jackson.JacksonSerde; import com.arangodb.serde.jackson.Key; import com.arangodb.serde.jackson.Rev; -import com.arangodb.util.MapBuilder; -import com.arangodb.util.RawBytes; -import com.arangodb.util.RawData; -import com.arangodb.util.RawJson; +import com.arangodb.util.*; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.core.JsonProcessingException; @@ -63,11 +60,15 @@ class ArangoCollectionTest extends BaseJunit5 { private final ObjectMapper mapper = new ObjectMapper(); private static Stream cols() { - return dbsStream().map(db -> db.collection(COLLECTION_NAME)).map(Arguments::of); + return dbsStream() + .map(mapNamedPayload(db -> db.collection(COLLECTION_NAME))) + .map(Arguments::of); } private static Stream edges() { - return dbsStream().map(db -> db.collection(EDGE_COLLECTION_NAME)).map(Arguments::of); + return dbsStream() + .map(mapNamedPayload(db -> db.collection(EDGE_COLLECTION_NAME))) + .map(Arguments::of); } @BeforeAll @@ -76,7 +77,7 @@ static void init() { initEdgeCollections(EDGE_COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocument(ArangoCollection collection) { final DocumentCreateEntity doc = collection.insertDocument(new BaseDocument(), null); @@ -88,7 +89,7 @@ void insertDocument(ArangoCollection collection) { assertThat(doc.getId()).isEqualTo(COLLECTION_NAME + "/" + doc.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentWithArrayWithNullValues(ArangoCollection collection) { List arr = Arrays.asList("a", null); @@ -106,7 +107,7 @@ void insertDocumentWithArrayWithNullValues(ArangoCollection collection) { assertThat((List) insertedDoc.getNew().getAttribute("arr")).containsAll(Arrays.asList("a", null)); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentWithNullValues(ArangoCollection collection) { BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -122,7 +123,7 @@ void insertDocumentWithNullValues(ArangoCollection collection) { assertThat(insertedDoc.getNew().getProperties()).containsKey("null"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentUpdateRev(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -131,7 +132,7 @@ void insertDocumentUpdateRev(ArangoCollection collection) { assertThat(createResult.getRev()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentReturnNew(ArangoCollection collection) { final DocumentCreateOptions options = new DocumentCreateOptions().returnNew(true); @@ -143,7 +144,7 @@ void insertDocumentReturnNew(ArangoCollection collection) { assertThat(doc.getNew()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentWithTypeOverwriteModeReplace(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 7)); @@ -178,7 +179,7 @@ void insertDocumentWithTypeOverwriteModeReplace(ArangoCollection collection) { assertThat(doc.getNew().getName()).isEqualTo("Luna"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeIgnore(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 7)); @@ -197,7 +198,7 @@ void insertDocumentOverwriteModeIgnore(ArangoCollection collection) { assertThat(insertIgnore.getRev()).isEqualTo(meta.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeConflict(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 7)); @@ -216,7 +217,7 @@ void insertDocumentOverwriteModeConflict(ArangoCollection collection) { assertThat(e.getErrorNum()).isEqualTo(1210); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeReplace(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 7)); @@ -237,7 +238,7 @@ void insertDocumentOverwriteModeReplace(ArangoCollection collection) { assertThat(repsert.getNew().getAttribute("bar")).isEqualTo("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeUpdate(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 7)); @@ -256,7 +257,7 @@ void insertDocumentOverwriteModeUpdate(ArangoCollection collection) { assertThat(updated.getNew().getAttribute("bar")).isEqualTo("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeUpdateMergeObjectsFalse(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 7)); @@ -276,7 +277,7 @@ void insertDocumentOverwriteModeUpdateMergeObjectsFalse(ArangoCollection collect assertThat(updated.getNew().getAttribute("foo")).isEqualTo(fieldB); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeUpdateKeepNullTrue(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 7)); @@ -294,7 +295,7 @@ void insertDocumentOverwriteModeUpdateKeepNullTrue(ArangoCollection collection) assertThat(updated.getProperties()).containsEntry("foo", null); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentOverwriteModeUpdateKeepNullFalse(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 7)); @@ -312,7 +313,7 @@ void insertDocumentOverwriteModeUpdateKeepNullFalse(ArangoCollection collection) assertThat(updated.getProperties()).doesNotContainKey("foo"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentWaitForSync(ArangoCollection collection) { final DocumentCreateOptions options = new DocumentCreateOptions().waitForSync(true); @@ -324,7 +325,7 @@ void insertDocumentWaitForSync(ArangoCollection collection) { assertThat(doc.getNew()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentRefillIndexCaches(ArangoCollection collection) { final DocumentCreateOptions options = new DocumentCreateOptions().refillIndexCaches(true); @@ -336,7 +337,7 @@ void insertDocumentRefillIndexCaches(ArangoCollection collection) { assertThat(doc.getNew()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentAsJson(ArangoCollection collection) { String key = "doc-" + UUID.randomUUID(); @@ -348,7 +349,7 @@ void insertDocumentAsJson(ArangoCollection collection) { assertThat(doc.getRev()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentAsBytes(ArangoCollection collection) { String key = "doc-" + UUID.randomUUID(); @@ -369,7 +370,7 @@ void insertDocumentAsBytes(ArangoCollection collection) { assertThat(newDoc).containsAllEntriesOf(doc); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentSilent(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -381,7 +382,7 @@ void insertDocumentSilent(ArangoCollection collection) { assertThat(meta.getRev()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentSilentDontTouchInstance(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -395,7 +396,7 @@ void insertDocumentSilentDontTouchInstance(ArangoCollection collection) { assertThat(doc.getKey()).isEqualTo(key); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsSilent(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -408,7 +409,7 @@ void insertDocumentsSilent(ArangoCollection collection) { assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsWithErrors(ArangoCollection collection) { // BTS-615 @@ -430,7 +431,7 @@ void insertDocumentsWithErrors(ArangoCollection collection) { assertThat(res.getDocumentsAndErrors().get(2)).isSameAs(res.getDocuments().get(1)); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsRefillIndexCaches(ArangoCollection collection) { final MultiDocumentEntity> info = @@ -439,7 +440,7 @@ void insertDocumentsRefillIndexCaches(ArangoCollection collection) { assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocument(ArangoCollection collection) { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument(), null); @@ -449,7 +450,7 @@ void getDocument(ArangoCollection collection) { assertThat(readResult.getId()).isEqualTo(COLLECTION_NAME + "/" + createResult.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentIfMatch(ArangoCollection collection) { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument(), null); @@ -460,7 +461,7 @@ void getDocumentIfMatch(ArangoCollection collection) { assertThat(readResult.getId()).isEqualTo(COLLECTION_NAME + "/" + createResult.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentIfMatchFail(ArangoCollection collection) { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument(), null); @@ -470,7 +471,7 @@ void getDocumentIfMatchFail(ArangoCollection collection) { assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentIfNoneMatch(ArangoCollection collection) { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument(), null); @@ -481,7 +482,7 @@ void getDocumentIfNoneMatch(ArangoCollection collection) { assertThat(readResult.getId()).isEqualTo(COLLECTION_NAME + "/" + createResult.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentIfNoneMatchFail(ArangoCollection collection) { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument(), null); @@ -491,7 +492,7 @@ void getDocumentIfNoneMatchFail(ArangoCollection collection) { assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentAsJson(ArangoCollection collection) { String key = rnd(); @@ -501,35 +502,36 @@ void getDocumentAsJson(ArangoCollection collection) { assertThat(readResult.get()).contains("\"_key\":\"" + key + "\"").contains("\"_id\":\"" + COLLECTION_NAME + "/" + key + "\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentNotFound(ArangoCollection collection) { final BaseDocument document = collection.getDocument("no", BaseDocument.class); assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentNotFoundOptionsDefault(ArangoCollection collection) { final BaseDocument document = collection.getDocument("no", BaseDocument.class, new DocumentReadOptions()); assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentNotFoundOptionsNull(ArangoCollection collection) { final BaseDocument document = collection.getDocument("no", BaseDocument.class, null); assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentWrongKey(ArangoCollection collection) { Throwable thrown = catchThrowable(() -> collection.getDocument("no/no", BaseDocument.class)); assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("cols") void getDocumentDirtyRead(ArangoCollection collection) throws InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -540,7 +542,7 @@ void getDocumentDirtyRead(ArangoCollection collection) throws InterruptedExcepti assertThat(document).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocuments(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -558,7 +560,7 @@ void getDocuments(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentsWithCustomShardingKey(ArangoCollection c) { ArangoCollection collection = c.db().collection("customShardingKeyCollection"); @@ -580,7 +582,7 @@ void getDocumentsWithCustomShardingKey(ArangoCollection c) { assertThat(documents).hasSize(10); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentsDirtyRead(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -601,7 +603,7 @@ void getDocumentsDirtyRead(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentsNotFound(ArangoCollection collection) { final MultiDocumentEntity readResult = collection.getDocuments(Collections.singleton("no"), @@ -611,7 +613,7 @@ void getDocumentsNotFound(ArangoCollection collection) { assertThat(readResult.getErrors()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getDocumentsWrongKey(ArangoCollection collection) { final MultiDocumentEntity readResult = collection.getDocuments(Collections.singleton("no/no"), @@ -621,7 +623,7 @@ void getDocumentsWrongKey(ArangoCollection collection) { assertThat(readResult.getErrors()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocument(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -650,7 +652,7 @@ void updateDocument(ArangoCollection collection) { assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentWithDifferentReturnType(ArangoCollection collection) { final String key = "key-" + UUID.randomUUID(); @@ -668,7 +670,7 @@ void updateDocumentWithDifferentReturnType(ArangoCollection collection) { assertThat(updated.getAttribute("b")).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentUpdateRev(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -683,7 +685,7 @@ void updateDocumentUpdateRev(ArangoCollection collection) { .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentIfMatch(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -711,7 +713,7 @@ void updateDocumentIfMatch(ArangoCollection collection) { assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentIfMatchFail(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -727,7 +729,7 @@ void updateDocumentIfMatchFail(ArangoCollection collection) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentReturnNew(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -750,7 +752,7 @@ void updateDocumentReturnNew(ArangoCollection collection) { assertThat(String.valueOf(updateResult.getNew().getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentReturnOld(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -772,7 +774,7 @@ void updateDocumentReturnOld(ArangoCollection collection) { assertThat(updateResult.getOld().getProperties().keySet()).doesNotContain("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentKeepNullTrue(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -792,7 +794,7 @@ void updateDocumentKeepNullTrue(ArangoCollection collection) { assertThat(readResult.getProperties()).containsKey("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentKeepNullFalse(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -814,7 +816,7 @@ void updateDocumentKeepNullFalse(ArangoCollection collection) { assertThat(readResult.getProperties().keySet()).doesNotContain("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentSerializeNullTrue(ArangoCollection collection) { final TestUpdateEntity doc = new TestUpdateEntity(); @@ -833,7 +835,7 @@ void updateDocumentSerializeNullTrue(ArangoCollection collection) { assertThat(readResult.getAttribute("a")).isEqualTo("bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentSerializeNullFalse(ArangoCollection collection) { final TestUpdateEntitySerializeNullFalse doc = new TestUpdateEntitySerializeNullFalse(); @@ -853,7 +855,7 @@ void updateDocumentSerializeNullFalse(ArangoCollection collection) { assertThat(readResult.getAttribute("b")).isEqualTo("foo"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentMergeObjectsTrue(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -880,7 +882,7 @@ void updateDocumentMergeObjectsTrue(ArangoCollection collection) { assertThat(aMap).containsKeys("a", "b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentMergeObjectsFalse(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -908,7 +910,7 @@ void updateDocumentMergeObjectsFalse(ArangoCollection collection) { assertThat(aMap).containsKey("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentIgnoreRevsFalse(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -922,7 +924,7 @@ void updateDocumentIgnoreRevsFalse(ArangoCollection collection) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentSilent(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -935,7 +937,7 @@ void updateDocumentSilent(ArangoCollection collection) { assertThat(meta.getRev()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentsSilent(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -949,7 +951,7 @@ void updateDocumentsSilent(ArangoCollection collection) { assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateNonExistingDocument(ArangoCollection collection) { final BaseDocument doc = new BaseDocument("test-" + rnd()); @@ -963,7 +965,7 @@ void updateNonExistingDocument(ArangoCollection collection) { assertThat(e.getErrorNum()).isEqualTo(1202); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentPreconditionFailed(ArangoCollection collection) { final BaseDocument doc = new BaseDocument("test-" + rnd()); @@ -984,7 +986,7 @@ void updateDocumentPreconditionFailed(ArangoCollection collection) { assertThat(readDocument.getAttribute("foo")).isEqualTo("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentRefillIndexCaches(ArangoCollection collection) { BaseDocument doc = new BaseDocument(); @@ -997,7 +999,7 @@ void updateDocumentRefillIndexCaches(ArangoCollection collection) { .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentsRefillIndexCaches(ArangoCollection collection) { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument()); @@ -1007,7 +1009,7 @@ void updateDocumentsRefillIndexCaches(ArangoCollection collection) { assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocument(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1032,7 +1034,7 @@ void replaceDocument(ArangoCollection collection) { assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentUpdateRev(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1046,7 +1048,7 @@ void replaceDocumentUpdateRev(ArangoCollection collection) { .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentIfMatch(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1070,7 +1072,7 @@ void replaceDocumentIfMatch(ArangoCollection collection) { assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentIfMatchFail(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1085,7 +1087,7 @@ void replaceDocumentIfMatchFail(ArangoCollection collection) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentIgnoreRevsFalse(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1100,7 +1102,7 @@ void replaceDocumentIgnoreRevsFalse(ArangoCollection collection) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentReturnNew(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1122,7 +1124,7 @@ void replaceDocumentReturnNew(ArangoCollection collection) { assertThat(String.valueOf(replaceResult.getNew().getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentReturnOld(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1144,7 +1146,7 @@ void replaceDocumentReturnOld(ArangoCollection collection) { assertThat(replaceResult.getOld().getProperties().keySet()).doesNotContain("b"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentSilent(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -1157,7 +1159,7 @@ void replaceDocumentSilent(ArangoCollection collection) { assertThat(meta.getRev()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentSilentDontTouchInstance(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -1170,7 +1172,7 @@ void replaceDocumentSilentDontTouchInstance(ArangoCollection collection) { assertThat(createResult.getRev()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentsSilent(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -1184,7 +1186,7 @@ void replaceDocumentsSilent(ArangoCollection collection) { assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentRefillIndexCaches(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1196,7 +1198,7 @@ void replaceDocumentRefillIndexCaches(ArangoCollection collection) { .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentsRefillIndexCaches(ArangoCollection collection) { final DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument()); @@ -1206,7 +1208,7 @@ void replaceDocumentsRefillIndexCaches(ArangoCollection collection) { assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocument(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1216,7 +1218,7 @@ void deleteDocument(ArangoCollection collection) { assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentReturnOld(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1231,7 +1233,7 @@ void deleteDocumentReturnOld(ArangoCollection collection) { assertThat(String.valueOf(deleteResult.getOld().getAttribute("a"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentIfMatch(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1242,7 +1244,7 @@ void deleteDocumentIfMatch(ArangoCollection collection) { assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentIfMatchFail(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1252,7 +1254,7 @@ void deleteDocumentIfMatchFail(ArangoCollection collection) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentSilent(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -1265,7 +1267,7 @@ void deleteDocumentSilent(ArangoCollection collection) { assertThat(meta.getRev()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentsSilent(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -1280,7 +1282,7 @@ void deleteDocumentsSilent(ArangoCollection collection) { assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentRefillIndexCaches(ArangoCollection collection) { DocumentCreateEntity createResult = collection.insertDocument(new BaseDocument()); @@ -1291,7 +1293,7 @@ void deleteDocumentRefillIndexCaches(ArangoCollection collection) { .isEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentsRefillIndexCaches(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -1303,7 +1305,7 @@ void deleteDocumentsRefillIndexCaches(ArangoCollection collection) { assertThat(info.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getIndex(ArangoCollection collection) { final Collection fields = new ArrayList<>(); @@ -1314,7 +1316,7 @@ void getIndex(ArangoCollection collection) { assertThat(readResult.getType()).isEqualTo(createResult.getType()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getIndexByKey(ArangoCollection collection) { final Collection fields = new ArrayList<>(); @@ -1325,7 +1327,7 @@ void getIndexByKey(ArangoCollection collection) { assertThat(readResult.getType()).isEqualTo(createResult.getType()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteIndex(ArangoCollection collection) { final Collection fields = new ArrayList<>(); @@ -1337,7 +1339,7 @@ void deleteIndex(ArangoCollection collection) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteIndexByKey(ArangoCollection collection) { final Collection fields = new ArrayList<>(); @@ -1349,7 +1351,7 @@ void deleteIndexByKey(ArangoCollection collection) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createGeoIndex(ArangoCollection collection) { String f1 = "field-" + rnd(); @@ -1372,7 +1374,7 @@ void createGeoIndex(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createGeoIndexWithOptions(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 5)); @@ -1402,7 +1404,7 @@ void createGeoIndexWithOptions(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createGeoIndexLegacyPolygons(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 10)); @@ -1433,7 +1435,7 @@ void createGeoIndexLegacyPolygons(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createGeo2Index(ArangoCollection collection) { String f1 = "field-" + rnd(); @@ -1456,7 +1458,7 @@ void createGeo2Index(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createGeo2IndexWithOptions(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 5)); @@ -1486,7 +1488,7 @@ void createGeo2IndexWithOptions(ArangoCollection collection) { assertThat(indexResult.getName()).isEqualTo(name); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createPersistentIndex(ArangoCollection collection) { String f1 = "field-" + rnd(); @@ -1510,7 +1512,7 @@ void createPersistentIndex(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createPersistentIndexCacheEnabled(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 10)); @@ -1534,7 +1536,7 @@ void createPersistentIndexCacheEnabled(ArangoCollection collection) { assertThat(indexResult.getCacheEnabled()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createPersistentIndexStoredValues(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 10)); @@ -1561,7 +1563,7 @@ void createPersistentIndexStoredValues(ArangoCollection collection) { .contains("v1", "v2"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createPersistentIndexWithOptions(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 5)); @@ -1588,7 +1590,7 @@ void createPersistentIndexWithOptions(ArangoCollection collection) { assertThat(indexResult.getName()).isEqualTo(name); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createZKDIndex(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 9)); @@ -1610,7 +1612,7 @@ void createZKDIndex(ArangoCollection collection) { collection.deleteIndex(indexResult.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createZKDIndexWithOptions(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 9)); @@ -1638,7 +1640,7 @@ void createZKDIndexWithOptions(ArangoCollection collection) { collection.deleteIndex(indexResult.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void indexEstimates(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 8)); @@ -1659,7 +1661,7 @@ void indexEstimates(ArangoCollection collection) { assertThat(indexResult.getSelectivityEstimate()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void indexEstimatesFalse(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 8)); @@ -1680,7 +1682,7 @@ void indexEstimatesFalse(ArangoCollection collection) { assertThat(indexResult.getSelectivityEstimate()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void indexDeduplicate(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 8)); @@ -1699,7 +1701,7 @@ void indexDeduplicate(ArangoCollection collection) { assertThat(indexResult.getDeduplicate()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void indexDeduplicateFalse(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 8)); @@ -1718,7 +1720,7 @@ void indexDeduplicateFalse(ArangoCollection collection) { assertThat(indexResult.getDeduplicate()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createFulltextIndex(ArangoCollection collection) { String f1 = "field-" + rnd(); @@ -1734,7 +1736,7 @@ void createFulltextIndex(ArangoCollection collection) { assertThat(indexResult.getUnique()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createFulltextIndexWithOptions(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 5)); @@ -1757,7 +1759,7 @@ void createFulltextIndexWithOptions(ArangoCollection collection) { assertThat(indexResult.getName()).isEqualTo(name); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createTtlIndexWithoutOptions(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 5)); @@ -1772,7 +1774,7 @@ void createTtlIndexWithoutOptions(ArangoCollection collection) { assertThat(e.getMessage()).contains("expireAfter attribute must be a number"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createTtlIndexWithOptions(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 5)); @@ -1798,7 +1800,7 @@ void createTtlIndexWithOptions(ArangoCollection collection) { collection.deleteIndex(indexResult.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getIndexes(ArangoCollection collection) { String f1 = "field-" + rnd(); @@ -1809,7 +1811,7 @@ void getIndexes(ArangoCollection collection) { assertThat(matchingIndexes).isEqualTo(1L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void getEdgeIndex(ArangoCollection edgeCollection) { Collection indexes = edgeCollection.getIndexes(); @@ -1819,14 +1821,14 @@ void getEdgeIndex(ArangoCollection edgeCollection) { assertThat(edgeIndexes).isEqualTo(1L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void exists(ArangoCollection collection) { assertThat(collection.exists()).isTrue(); assertThat(collection.db().collection(COLLECTION_NAME + "no").exists()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void truncate(ArangoCollection collection) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -1840,7 +1842,7 @@ void truncate(ArangoCollection collection) { assertThat(document).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getCount(ArangoCollection collection) { Long initialCount = collection.count().getCount(); @@ -1849,7 +1851,7 @@ void getCount(ArangoCollection collection) { assertThat(count.getCount()).isEqualTo(initialCount + 1L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void documentExists(ArangoCollection collection) { final Boolean existsNot = collection.documentExists(rnd(), null); @@ -1862,7 +1864,7 @@ void documentExists(ArangoCollection collection) { assertThat(exists).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void documentExistsIfMatch(ArangoCollection collection) { String key = rnd(); @@ -1873,7 +1875,7 @@ void documentExistsIfMatch(ArangoCollection collection) { assertThat(exists).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void documentExistsIfMatchFail(ArangoCollection collection) { String key = rnd(); @@ -1884,7 +1886,7 @@ void documentExistsIfMatchFail(ArangoCollection collection) { assertThat(exists).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void documentExistsIfNoneMatch(ArangoCollection collection) { String key = rnd(); @@ -1895,7 +1897,7 @@ void documentExistsIfNoneMatch(ArangoCollection collection) { assertThat(exists).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void documentExistsIfNoneMatchFail(ArangoCollection collection) { String key = rnd(); @@ -1906,7 +1908,7 @@ void documentExistsIfNoneMatchFail(ArangoCollection collection) { assertThat(exists).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocuments(ArangoCollection collection) { final Collection values = Arrays.asList(new BaseDocument(), new BaseDocument(), @@ -1920,7 +1922,7 @@ void insertDocuments(ArangoCollection collection) { assertThat(docs.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsOverwriteModeUpdate(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 7)); @@ -1950,7 +1952,7 @@ void insertDocumentsOverwriteModeUpdate(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsJson(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -1965,7 +1967,7 @@ void insertDocumentsJson(ArangoCollection collection) { assertThat(docs.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsRawData(ArangoCollection collection) { final RawData values = RawJson.of("[{},{},{}]"); @@ -1977,7 +1979,7 @@ void insertDocumentsRawData(ArangoCollection collection) { assertThat(docs.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsRawDataReturnNew(ArangoCollection collection) { final RawData values = RawJson.of("[{\"aaa\":33},{\"aaa\":33},{\"aaa\":33}]"); @@ -2001,7 +2003,7 @@ void insertDocumentsRawDataReturnNew(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsOne(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2014,7 +2016,7 @@ void insertDocumentsOne(ArangoCollection collection) { assertThat(docs.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsEmpty(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2026,7 +2028,7 @@ void insertDocumentsEmpty(ArangoCollection collection) { assertThat(docs.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsReturnNew(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2049,7 +2051,7 @@ void insertDocumentsReturnNew(ArangoCollection collection) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertDocumentsFail(ArangoCollection collection) { String k1 = rnd(); @@ -2066,7 +2068,7 @@ void insertDocumentsFail(ArangoCollection collection) { assertThat(docs.getErrors().iterator().next().getErrorNum()).isEqualTo(1210); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocuments(ArangoCollection collection) { final Collection values = Arrays.asList(new BaseDocument(), new BaseDocument(), @@ -2082,7 +2084,7 @@ void importDocuments(ArangoCollection collection) { assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJsonList(ArangoCollection collection) { final Collection values = Arrays.asList( @@ -2101,7 +2103,7 @@ void importDocumentsJsonList(ArangoCollection collection) { assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsDuplicateDefaultError(ArangoCollection collection) { String k1 = rnd(); @@ -2120,7 +2122,7 @@ void importDocumentsDuplicateDefaultError(ArangoCollection collection) { assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsDuplicateError(ArangoCollection collection) { String k1 = rnd(); @@ -2140,7 +2142,7 @@ void importDocumentsDuplicateError(ArangoCollection collection) { assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsDuplicateIgnore(ArangoCollection collection) { String k1 = rnd(); @@ -2160,7 +2162,7 @@ void importDocumentsDuplicateIgnore(ArangoCollection collection) { assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsDuplicateReplace(ArangoCollection collection) { String k1 = rnd(); @@ -2180,7 +2182,7 @@ void importDocumentsDuplicateReplace(ArangoCollection collection) { assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsDuplicateUpdate(ArangoCollection collection) { String k1 = rnd(); @@ -2200,7 +2202,7 @@ void importDocumentsDuplicateUpdate(ArangoCollection collection) { assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsCompleteFail(ArangoCollection collection) { String k1 = rnd(); @@ -2216,7 +2218,7 @@ void importDocumentsCompleteFail(ArangoCollection collection) { assertThat(e.getErrorNum()).isEqualTo(1210); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsDetails(ArangoCollection collection) { String k1 = rnd(); @@ -2236,7 +2238,7 @@ void importDocumentsDetails(ArangoCollection collection) { assertThat(docs.getDetails().iterator().next()).contains("unique constraint violated"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsOverwriteFalse(ArangoCollection collection) { collection.insertDocument(new BaseDocument()); @@ -2249,7 +2251,7 @@ void importDocumentsOverwriteFalse(ArangoCollection collection) { assertThat(collection.count().getCount()).isEqualTo(initialCount + 2L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsOverwriteTrue(ArangoCollection collection) { collection.insertDocument(new BaseDocument()); @@ -2261,7 +2263,7 @@ void importDocumentsOverwriteTrue(ArangoCollection collection) { assertThat(collection.count().getCount()).isEqualTo(2L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void importDocumentsFromToPrefix(ArangoCollection edgeCollection) { final Collection values = new ArrayList<>(); @@ -2283,7 +2285,7 @@ void importDocumentsFromToPrefix(ArangoCollection edgeCollection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJson(ArangoCollection collection) throws JsonProcessingException { final String values = mapper.writeValueAsString(Arrays.asList(Collections.singletonMap("_key", rnd()), @@ -2299,7 +2301,7 @@ void importDocumentsJson(ArangoCollection collection) throws JsonProcessingExcep assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJsonDuplicateDefaultError(ArangoCollection collection) throws JsonProcessingException { String k1 = rnd(); @@ -2318,7 +2320,7 @@ void importDocumentsJsonDuplicateDefaultError(ArangoCollection collection) throw assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJsonDuplicateError(ArangoCollection collection) throws JsonProcessingException { String k1 = rnd(); @@ -2338,7 +2340,7 @@ void importDocumentsJsonDuplicateError(ArangoCollection collection) throws JsonP assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJsonDuplicateIgnore(ArangoCollection collection) throws JsonProcessingException { String k1 = rnd(); @@ -2357,7 +2359,7 @@ void importDocumentsJsonDuplicateIgnore(ArangoCollection collection) throws Json assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJsonDuplicateReplace(ArangoCollection collection) throws JsonProcessingException { String k1 = rnd(); @@ -2377,7 +2379,7 @@ void importDocumentsJsonDuplicateReplace(ArangoCollection collection) throws Jso assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJsonDuplicateUpdate(ArangoCollection collection) throws JsonProcessingException { String k1 = rnd(); @@ -2397,7 +2399,7 @@ void importDocumentsJsonDuplicateUpdate(ArangoCollection collection) throws Json assertThat(docs.getDetails()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJsonCompleteFail(ArangoCollection collection) { final String values = "[{\"_key\":\"1\"},{\"_key\":\"2\"},{\"_key\":\"2\"}]"; @@ -2408,7 +2410,7 @@ void importDocumentsJsonCompleteFail(ArangoCollection collection) { assertThat(e.getErrorNum()).isEqualTo(1210); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJsonDetails(ArangoCollection collection) throws JsonProcessingException { String k1 = rnd(); @@ -2429,7 +2431,7 @@ void importDocumentsJsonDetails(ArangoCollection collection) throws JsonProcessi assertThat(docs.getDetails().iterator().next()).contains("unique constraint violated"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJsonOverwriteFalse(ArangoCollection collection) throws JsonProcessingException { collection.insertDocument(new BaseDocument()); @@ -2441,7 +2443,7 @@ void importDocumentsJsonOverwriteFalse(ArangoCollection collection) throws JsonP assertThat(collection.count().getCount()).isEqualTo(initialCount + 2L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void importDocumentsJsonOverwriteTrue(ArangoCollection collection) throws JsonProcessingException { collection.insertDocument(new BaseDocument()); @@ -2452,7 +2454,7 @@ void importDocumentsJsonOverwriteTrue(ArangoCollection collection) throws JsonPr assertThat(collection.count().getCount()).isEqualTo(2L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void importDocumentsJsonFromToPrefix(ArangoCollection edgeCollection) throws JsonProcessingException { String k1 = UUID.randomUUID().toString(); @@ -2475,7 +2477,7 @@ void importDocumentsJsonFromToPrefix(ArangoCollection edgeCollection) throws Jso } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentsByKey(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2502,7 +2504,7 @@ void deleteDocumentsByKey(ArangoCollection collection) { assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentsRawDataByKeyReturnOld(ArangoCollection collection) { final RawData values = RawJson.of("[{\"_key\":\"1\"},{\"_key\":\"2\"}]"); @@ -2521,7 +2523,7 @@ void deleteDocumentsRawDataByKeyReturnOld(ArangoCollection collection) { assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentsByDocuments(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2545,7 +2547,7 @@ void deleteDocumentsByDocuments(ArangoCollection collection) { assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentsByKeyOne(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2566,7 +2568,7 @@ void deleteDocumentsByKeyOne(ArangoCollection collection) { assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentsByDocumentOne(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2585,7 +2587,7 @@ void deleteDocumentsByDocumentOne(ArangoCollection collection) { assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentsEmpty(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2597,7 +2599,7 @@ void deleteDocumentsEmpty(ArangoCollection collection) { assertThat(deleteResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentsByKeyNotExisting(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2610,7 +2612,7 @@ void deleteDocumentsByKeyNotExisting(ArangoCollection collection) { assertThat(deleteResult.getErrors()).hasSize(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void deleteDocumentsByDocumentsNotExisting(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2630,7 +2632,7 @@ void deleteDocumentsByDocumentsNotExisting(ArangoCollection collection) { assertThat(deleteResult.getErrors()).hasSize(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocuments(ArangoCollection collection) { final Collection values = Arrays.asList(new BaseDocument(rnd()), new BaseDocument(rnd())); @@ -2642,7 +2644,7 @@ void updateDocuments(ArangoCollection collection) { assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentsWithDifferentReturnType(ArangoCollection collection) { List keys = @@ -2667,7 +2669,7 @@ void updateDocumentsWithDifferentReturnType(ArangoCollection collection) { assertThat(updateResult.getDocuments().stream()).map(DocumentUpdateEntity::getNew).allMatch(it -> it.getAttribute("a").equals("test")).allMatch(it -> it.getAttribute("b").equals("test")); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentsOne(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2686,7 +2688,7 @@ void updateDocumentsOne(ArangoCollection collection) { assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentsEmpty(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2695,7 +2697,7 @@ void updateDocumentsEmpty(ArangoCollection collection) { assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentsWithoutKey(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2714,7 +2716,7 @@ void updateDocumentsWithoutKey(ArangoCollection collection) { assertThat(updateResult.getErrors()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentsJson(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2730,7 +2732,7 @@ void updateDocumentsJson(ArangoCollection collection) { assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentsRawData(ArangoCollection collection) { final RawData values = RawJson.of("[{\"_key\":\"1\"}, {\"_key\":\"2\"}]"); @@ -2743,7 +2745,7 @@ void updateDocumentsRawData(ArangoCollection collection) { assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void updateDocumentsRawDataReturnNew(ArangoCollection collection) { final RawData values = RawJson.of("[{\"_key\":\"1\"}, {\"_key\":\"2\"}]"); @@ -2767,7 +2769,7 @@ void updateDocumentsRawDataReturnNew(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocuments(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2786,7 +2788,7 @@ void replaceDocuments(ArangoCollection collection) { assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentsOne(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2805,7 +2807,7 @@ void replaceDocumentsOne(ArangoCollection collection) { assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentsEmpty(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2814,7 +2816,7 @@ void replaceDocumentsEmpty(ArangoCollection collection) { assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentsWithoutKey(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2833,7 +2835,7 @@ void replaceDocumentsWithoutKey(ArangoCollection collection) { assertThat(updateResult.getErrors()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentsJson(ArangoCollection collection) { final Collection values = new ArrayList<>(); @@ -2849,7 +2851,7 @@ void replaceDocumentsJson(ArangoCollection collection) { assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentsRawData(ArangoCollection collection) { final RawData values = RawJson.of("[{\"_key\":\"1\"}, {\"_key\":\"2\"}]"); @@ -2862,7 +2864,7 @@ void replaceDocumentsRawData(ArangoCollection collection) { assertThat(updateResult.getErrors()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void replaceDocumentsRawDataReturnNew(ArangoCollection collection) { final RawData values = RawJson.of("[{\"_key\":\"1\"}, {\"_key\":\"2\"}]"); @@ -2886,14 +2888,14 @@ void replaceDocumentsRawDataReturnNew(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getInfo(ArangoCollection collection) { final CollectionEntity result = collection.getInfo(); assertThat(result.getName()).isEqualTo(COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getPropeties(ArangoCollection collection) { final CollectionPropertiesEntity result = collection.getProperties(); @@ -2901,7 +2903,7 @@ void getPropeties(ArangoCollection collection) { assertThat(result.getCount()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void changeProperties(ArangoCollection collection) { final CollectionPropertiesEntity properties = collection.getProperties(); @@ -2936,7 +2938,7 @@ void changeProperties(ArangoCollection collection) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void rename(ArangoCollection collection) { assumeTrue(isSingleServer()); @@ -2963,7 +2965,7 @@ void rename(ArangoCollection collection) { assertThat(e.getResponseCode()).isEqualTo(404); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void responsibleShard(ArangoCollection collection) { assumeTrue(isCluster()); @@ -2973,7 +2975,7 @@ void responsibleShard(ArangoCollection collection) { assertThat(shard.getShardId()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getRevision(ArangoCollection collection) { final CollectionRevisionEntity result = collection.getRevision(); @@ -2982,7 +2984,7 @@ void getRevision(ArangoCollection collection) { assertThat(result.getRevision()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void keyWithSpecialCharacter(ArangoCollection collection) { final String key = "myKey_-:.@()+,=;$!*'%-" + UUID.randomUUID(); @@ -2992,7 +2994,7 @@ void keyWithSpecialCharacter(ArangoCollection collection) { assertThat(doc.getKey()).isEqualTo(key); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void alreadyUrlEncodedkey(ArangoCollection collection) { final String key = "http%3A%2F%2Fexample.com%2F-" + UUID.randomUUID(); @@ -3002,7 +3004,7 @@ void alreadyUrlEncodedkey(ArangoCollection collection) { assertThat(doc.getKey()).isEqualTo(key); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void grantAccessRW(ArangoCollection collection) { ArangoDB arangoDB = collection.db().arango(); @@ -3014,7 +3016,7 @@ void grantAccessRW(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void grantAccessRO(ArangoCollection collection) { ArangoDB arangoDB = collection.db().arango(); @@ -3026,7 +3028,7 @@ void grantAccessRO(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void grantAccessNONE(ArangoCollection collection) { ArangoDB arangoDB = collection.db().arango(); @@ -3038,14 +3040,14 @@ void grantAccessNONE(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void grantAccessUserNotFound(ArangoCollection collection) { Throwable thrown = catchThrowable(() -> collection.grantAccess("user1", Permissions.RW)); assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void revokeAccess(ArangoCollection collection) { ArangoDB arangoDB = collection.db().arango(); @@ -3057,14 +3059,14 @@ void revokeAccess(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void revokeAccessUserNotFound(ArangoCollection collection) { Throwable thrown = catchThrowable(() -> collection.grantAccess("user1", Permissions.NONE)); assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void resetAccess(ArangoCollection collection) { ArangoDB arangoDB = collection.db().arango(); @@ -3076,20 +3078,20 @@ void resetAccess(ArangoCollection collection) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void resetAccessUserNotFound(ArangoCollection collection) { Throwable thrown = catchThrowable(() -> collection.resetAccess("user1")); assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getPermissions(ArangoCollection collection) { assertThat(collection.getPermissions("root")).isEqualTo(Permissions.RW); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void annotationsInParamsAndMethods(ArangoCollection collection) { assumeTrue(collection.getSerde().getUserSerde() instanceof JacksonSerde, "JacksonSerde only"); diff --git a/driver/src/test/java/com/arangodb/ArangoCursorTest.java b/driver/src/test/java/com/arangodb/ArangoCursorTest.java index 12847ce92..1d542dae8 100644 --- a/driver/src/test/java/com/arangodb/ArangoCursorTest.java +++ b/driver/src/test/java/com/arangodb/ArangoCursorTest.java @@ -44,7 +44,7 @@ static void init() { initDB(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void firstStream(ArangoDatabase db) { final ArangoCursor cursor = db.query("FOR i IN 0..99 RETURN i", JsonNode.class); @@ -54,7 +54,7 @@ void firstStream(ArangoDatabase db) { assertThat(first.get().asLong()).isZero(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void next(ArangoDatabase db) { final ArangoCursor cursor = db.query("FOR i IN 0..99 RETURN i", JsonNode.class, new AqlQueryOptions().batchSize(5)); @@ -63,7 +63,7 @@ void next(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void mapFilterCountStream(ArangoDatabase db) { final ArangoCursor cursor = db.query("FOR i IN 0..99 RETURN i", JsonNode.class); @@ -71,7 +71,7 @@ void mapFilterCountStream(ArangoDatabase db) { assertThat(count).isEqualTo(50L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void mapFilterCollectIntoSetStream(ArangoDatabase db) { final ArangoCursor cursor = db.query("FOR i IN 0..99 RETURN i", JsonNode.class); @@ -81,7 +81,7 @@ void mapFilterCollectIntoSetStream(ArangoDatabase db) { .hasSize(50); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void forEach(ArangoDatabase db) { final AtomicLong i = new AtomicLong(0L); @@ -89,7 +89,7 @@ void forEach(ArangoDatabase db) { cursor.forEach(t -> assertThat(t.asLong()).isEqualTo(i.getAndIncrement())); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void mapForeachStream(ArangoDatabase db) { final AtomicLong i = new AtomicLong(0L); @@ -97,7 +97,7 @@ void mapForeachStream(ArangoDatabase db) { cursor.stream().map(JsonNode::asLong).forEach(t -> assertThat(t).isEqualTo(i.getAndIncrement())); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void mapFilterForEachStream(ArangoDatabase db) { final AtomicLong i = new AtomicLong(0L); @@ -105,7 +105,7 @@ void mapFilterForEachStream(ArangoDatabase db) { cursor.stream().map(JsonNode::asLong).filter(t -> t < 50).forEach(t -> assertThat(t).isEqualTo(i.getAndIncrement())); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void anyMatchStream(ArangoDatabase db) { final ArangoCursor cursor = db.query("FOR i IN 0..99 RETURN i", JsonNode.class); @@ -113,7 +113,7 @@ void anyMatchStream(ArangoDatabase db) { assertThat(match).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void noneMatchStream(ArangoDatabase db) { final ArangoCursor cursor = db.query("FOR i IN 0..99 RETURN i", JsonNode.class); @@ -121,7 +121,7 @@ void noneMatchStream(ArangoDatabase db) { assertThat(match).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void allMatchStream(ArangoDatabase db) { final ArangoCursor cursor = db.query("FOR i IN 0..99 RETURN i", JsonNode.class); diff --git a/driver/src/test/java/com/arangodb/ArangoDBAsyncTest.java b/driver/src/test/java/com/arangodb/ArangoDBAsyncTest.java index 162f00e3b..19f663805 100644 --- a/driver/src/test/java/com/arangodb/ArangoDBAsyncTest.java +++ b/driver/src/test/java/com/arangodb/ArangoDBAsyncTest.java @@ -27,12 +27,12 @@ import com.arangodb.model.*; import com.arangodb.model.LogOptions.SortOrder; import com.arangodb.util.RawJson; +import com.arangodb.util.SlowTest; import com.arangodb.util.UnicodeUtils; import com.fasterxml.jackson.databind.JsonNode; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; @@ -72,7 +72,7 @@ static void shutdown() { dropDB(DB2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getVersion(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { final ArangoDBVersion version = arangoDB.getVersion().get(); @@ -80,7 +80,8 @@ void getVersion(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedEx assertThat(version.getVersion()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncArangos") void createAndDeleteDatabase(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { final String dbName = rndDbName(); @@ -90,23 +91,25 @@ void createAndDeleteDatabase(ArangoDBAsync arangoDB) throws ExecutionException, assertThat(resultDelete).isTrue(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncArangos") void createWithNotNormalizedName(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(supportsExtendedDbNames()); final String dbName = "testDB-\u006E\u0303\u00f1"; String normalized = UnicodeUtils.normalize(dbName); - arangoDB.createDatabase(normalized); + arangoDB.createDatabase(normalized).get(); arangoDB.db(normalized).drop().get(); - Throwable thrown = catchThrowable(() -> arangoDB.createDatabase(dbName)); + Throwable thrown = catchThrowable(() -> arangoDB.createDatabase(dbName).get()).getCause(); assertThat(thrown) .isInstanceOf(ArangoDBException.class) .hasMessageContaining("normalized"); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncArangos") void createDatabaseWithOptions(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); @@ -131,7 +134,8 @@ void createDatabaseWithOptions(ArangoDBAsync arangoDB) throws ExecutionException assertThat(resultDelete).isTrue(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncArangos") void createDatabaseWithOptionsSatellite(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); @@ -158,7 +162,8 @@ void createDatabaseWithOptionsSatellite(ArangoDBAsync arangoDB) throws Execution assertThat(resultDelete).isTrue(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncArangos") void createDatabaseWithUsers(ArangoDBAsync arangoDB) throws InterruptedException, ExecutionException { final String dbName = rndDbName(); @@ -205,28 +210,28 @@ void createDatabaseWithUsers(ArangoDBAsync arangoDB) throws InterruptedException assertThat(resultDelete).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getDatabases(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { Collection dbs = arangoDB.getDatabases().get(); assertThat(dbs).contains("_system", DB1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getAccessibleDatabases(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { final Collection dbs = arangoDB.getAccessibleDatabases().get(); assertThat(dbs).contains("_system"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getAccessibleDatabasesFor(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { final Collection dbs = arangoDB.getAccessibleDatabasesFor("root").get(); assertThat(dbs).contains("_system"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void createUser(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { String username = "user-" + UUID.randomUUID(); @@ -234,7 +239,7 @@ void createUser(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedEx assertThat(result.getUser()).isEqualTo(username); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void deleteUser(ArangoDBAsync arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -242,14 +247,14 @@ void deleteUser(ArangoDBAsync arangoDB) { arangoDB.deleteUser(username); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getUserRoot(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { final UserEntity user = arangoDB.getUser(ROOT).get(); assertThat(user.getUser()).isEqualTo(ROOT); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getUser(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { String username = "user-" + UUID.randomUUID(); @@ -258,14 +263,14 @@ void getUser(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedExcep assertThat(user.getUser()).isEqualTo(username); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getUsersOnlyRoot(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { final Collection users = arangoDB.getUsers().get(); assertThat(users).isNotEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getUsers(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { String username = "user-" + UUID.randomUUID(); @@ -289,7 +294,7 @@ void getUsers(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedExce } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void updateUserNoOptions(ArangoDBAsync arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -297,7 +302,7 @@ void updateUserNoOptions(ArangoDBAsync arangoDB) { arangoDB.updateUser(username, null); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void updateUser(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { String username = "user-" + UUID.randomUUID(); @@ -316,7 +321,7 @@ void updateUser(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedEx assertThat(Boolean.valueOf(String.valueOf(user2.getExtra().get("hund")))).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void replaceUser(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { String username = "user-" + UUID.randomUUID(); @@ -335,7 +340,7 @@ void replaceUser(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedE assertThat(Boolean.valueOf(String.valueOf(user2.getExtra().get("mund")))).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void updateUserDefaultDatabaseAccess(ArangoDBAsync arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -343,7 +348,7 @@ void updateUserDefaultDatabaseAccess(ArangoDBAsync arangoDB) { arangoDB.grantDefaultDatabaseAccess(username, Permissions.RW); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void updateUserDefaultCollectionAccess(ArangoDBAsync arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -354,6 +359,8 @@ void updateUserDefaultCollectionAccess(ArangoDBAsync arangoDB) { @ParameterizedTest @EnumSource(Protocol.class) void authenticationFailPassword(Protocol protocol) { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + final ArangoDBAsync arangoDB = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) @@ -369,6 +376,8 @@ void authenticationFailPassword(Protocol protocol) { @ParameterizedTest @EnumSource(Protocol.class) void authenticationFailUser(Protocol protocol) { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + final ArangoDBAsync arangoDB = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) @@ -381,7 +390,7 @@ void authenticationFailUser(Protocol protocol) { assertThat(((ArangoDBException) thrown).getResponseCode()).isEqualTo(401); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void executeGetVersion(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { Request request = Request.builder() @@ -401,7 +410,7 @@ void executeGetVersion(ArangoDBAsync arangoDB) throws ExecutionException, Interr } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getLogEntries(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -410,7 +419,7 @@ void getLogEntries(ArangoDBAsync arangoDB) throws ExecutionException, Interrupte assertThat(logs.getMessages()).hasSize(logs.getTotal().intValue()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesUpto(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -420,7 +429,7 @@ void getLogEntriesUpto(ArangoDBAsync arangoDB) throws ExecutionException, Interr .doesNotContain("INFO"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -430,7 +439,7 @@ void getLogEntriesLevel(ArangoDBAsync arangoDB) throws ExecutionException, Inter .containsOnly("INFO"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesStart(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -442,7 +451,7 @@ void getLogEntriesStart(ArangoDBAsync arangoDB) throws ExecutionException, Inter .doesNotContain(firstId); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesSize(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -453,7 +462,7 @@ void getLogEntriesSize(ArangoDBAsync arangoDB) throws ExecutionException, Interr assertThat(logsSize.getMessages()).hasSize(count - 1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesOffset(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -466,16 +475,16 @@ void getLogEntriesOffset(ArangoDBAsync arangoDB) throws ExecutionException, Inte .doesNotContain(firstId); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesSearch(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null).get(); - final LogEntriesEntity logsSearch = arangoDB.getLogEntries(new LogOptions().search(TEST_DB)).get(); + final LogEntriesEntity logsSearch = arangoDB.getLogEntries(new LogOptions().search(getTestDb())).get(); assertThat(logs.getTotal()).isGreaterThan(logsSearch.getTotal()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesSortAsc(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -490,7 +499,7 @@ void getLogEntriesSortAsc(ArangoDBAsync arangoDB) throws ExecutionException, Int } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getLogEntriesSortDesc(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -505,7 +514,7 @@ void getLogEntriesSortDesc(ArangoDBAsync arangoDB) throws ExecutionException, In } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); // it fails in 3.6 active-failover (BTS-362) @@ -513,7 +522,7 @@ void getLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedE assertThat(logLevel.getAgency()).isEqualTo(LogLevelEntity.LogLevel.INFO); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void setLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); // it fails in 3.6 active-failover (BTS-362) @@ -528,7 +537,7 @@ void setLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedE } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void setAllLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 9)); @@ -546,7 +555,7 @@ void setAllLogLevel(ArangoDBAsync arangoDB) throws ExecutionException, Interrupt } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void logLevelWithServerId(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -565,7 +574,7 @@ void logLevelWithServerId(ArangoDBAsync arangoDB) throws ExecutionException, Int } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void getQueryOptimizerRules(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -584,7 +593,7 @@ void getQueryOptimizerRules(ArangoDBAsync arangoDB) throws ExecutionException, I } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void arangoDBException(ArangoDBAsync arangoDB) { Throwable thrown = catchThrowable(() -> arangoDB.db("no").getInfo().get()).getCause(); @@ -594,7 +603,7 @@ void arangoDBException(ArangoDBAsync arangoDB) { assertThat(e.getErrorNum()).isEqualTo(1228); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void fallbackHost() throws ExecutionException, InterruptedException { final ArangoDBAsync arangoDB = new ArangoDB.Builder() @@ -606,7 +615,7 @@ void fallbackHost() throws ExecutionException, InterruptedException { assertThat(version).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void loadpropertiesWithPrefix() throws ExecutionException, InterruptedException { ArangoDBAsync adb = new ArangoDB.Builder() @@ -617,7 +626,7 @@ void loadpropertiesWithPrefix() throws ExecutionException, InterruptedException adb.shutdown(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void accessMultipleDatabases(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { final ArangoDBVersion version1 = arangoDB.db(DB1).getVersion().get(); @@ -626,7 +635,7 @@ void accessMultipleDatabases(ArangoDBAsync arangoDB) throws ExecutionException, assertThat(version2).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") @Disabled("Manual execution only") void queueTime(ArangoDBAsync arangoDB) throws InterruptedException, ExecutionException { diff --git a/driver/src/test/java/com/arangodb/ArangoDBTest.java b/driver/src/test/java/com/arangodb/ArangoDBTest.java index d35bb0207..a4ffc0e13 100644 --- a/driver/src/test/java/com/arangodb/ArangoDBTest.java +++ b/driver/src/test/java/com/arangodb/ArangoDBTest.java @@ -27,6 +27,7 @@ import com.arangodb.model.*; import com.arangodb.model.LogOptions.SortOrder; import com.arangodb.util.RawJson; +import com.arangodb.util.SlowTest; import com.arangodb.util.UnicodeUtils; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; @@ -73,7 +74,7 @@ static void shutdown() { dropDB(DB2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getVersion(ArangoDB arangoDB) { final ArangoDBVersion version = arangoDB.getVersion(); @@ -81,7 +82,8 @@ void getVersion(ArangoDB arangoDB) { assertThat(version.getVersion()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("arangos") void createAndDeleteDatabase(ArangoDB arangoDB) { final String dbName = rndDbName(); @@ -92,7 +94,8 @@ void createAndDeleteDatabase(ArangoDB arangoDB) { assertThat(resultDelete).isTrue(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("arangos") void createWithNotNormalizedName(ArangoDB arangoDB) { assumeTrue(supportsExtendedDbNames()); @@ -108,7 +111,8 @@ void createWithNotNormalizedName(ArangoDB arangoDB) { .hasMessageContaining("normalized"); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("arangos") void createDatabaseWithOptions(ArangoDB arangoDB) { assumeTrue(isCluster()); @@ -133,7 +137,8 @@ void createDatabaseWithOptions(ArangoDB arangoDB) { assertThat(resultDelete).isTrue(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("arangos") void createDatabaseWithOptionsSatellite(ArangoDB arangoDB) { assumeTrue(isCluster()); @@ -160,7 +165,8 @@ void createDatabaseWithOptionsSatellite(ArangoDB arangoDB) { assertThat(resultDelete).isTrue(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("arangos") void createDatabaseWithUsers(ArangoDB arangoDB) throws InterruptedException { final String dbName = rndDbName(); @@ -206,28 +212,28 @@ void createDatabaseWithUsers(ArangoDB arangoDB) throws InterruptedException { assertThat(resultDelete).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getDatabases(ArangoDB arangoDB) { Collection dbs = arangoDB.getDatabases(); assertThat(dbs).contains("_system", DB1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getAccessibleDatabases(ArangoDB arangoDB) { final Collection dbs = arangoDB.getAccessibleDatabases(); assertThat(dbs).contains("_system"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getAccessibleDatabasesFor(ArangoDB arangoDB) { final Collection dbs = arangoDB.getAccessibleDatabasesFor("root"); assertThat(dbs).contains("_system"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void createUser(ArangoDB arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -235,7 +241,7 @@ void createUser(ArangoDB arangoDB) { assertThat(result.getUser()).isEqualTo(username); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void deleteUser(ArangoDB arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -243,14 +249,14 @@ void deleteUser(ArangoDB arangoDB) { arangoDB.deleteUser(username); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getUserRoot(ArangoDB arangoDB) { final UserEntity user = arangoDB.getUser(ROOT); assertThat(user.getUser()).isEqualTo(ROOT); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getUser(ArangoDB arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -259,14 +265,14 @@ void getUser(ArangoDB arangoDB) { assertThat(user.getUser()).isEqualTo(username); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getUsersOnlyRoot(ArangoDB arangoDB) { final Collection users = arangoDB.getUsers(); assertThat(users).isNotEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getUsers(ArangoDB arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -290,7 +296,7 @@ void getUsers(ArangoDB arangoDB) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void updateUserNoOptions(ArangoDB arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -298,7 +304,7 @@ void updateUserNoOptions(ArangoDB arangoDB) { arangoDB.updateUser(username, null); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void updateUser(ArangoDB arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -317,7 +323,7 @@ void updateUser(ArangoDB arangoDB) { assertThat(Boolean.valueOf(String.valueOf(user2.getExtra().get("hund")))).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void replaceUser(ArangoDB arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -336,7 +342,7 @@ void replaceUser(ArangoDB arangoDB) { assertThat(Boolean.valueOf(String.valueOf(user2.getExtra().get("mund")))).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void updateUserDefaultDatabaseAccess(ArangoDB arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -344,7 +350,7 @@ void updateUserDefaultDatabaseAccess(ArangoDB arangoDB) { arangoDB.grantDefaultDatabaseAccess(username, Permissions.RW); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void updateUserDefaultCollectionAccess(ArangoDB arangoDB) { String username = "user-" + UUID.randomUUID(); @@ -355,6 +361,8 @@ void updateUserDefaultCollectionAccess(ArangoDB arangoDB) { @ParameterizedTest @EnumSource(Protocol.class) void authenticationFailPassword(Protocol protocol) { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + final ArangoDB arangoDB = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) @@ -368,6 +376,8 @@ void authenticationFailPassword(Protocol protocol) { @ParameterizedTest @EnumSource(Protocol.class) void authenticationFailUser(Protocol protocol) { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + final ArangoDB arangoDB = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) @@ -378,7 +388,7 @@ void authenticationFailUser(Protocol protocol) { assertThat(((ArangoDBException) thrown).getResponseCode()).isEqualTo(401); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void executeGetVersion(ArangoDB arangoDB) { Request request = Request.builder() @@ -398,7 +408,7 @@ void executeGetVersion(ArangoDB arangoDB) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void executeJS(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 11)); @@ -412,7 +422,7 @@ void executeJS(ArangoDB arangoDB) { assertThat(response.getBody()).isEqualTo(11); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getLogEntries(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 8)); @@ -421,7 +431,7 @@ void getLogEntries(ArangoDB arangoDB) { assertThat(logs.getMessages()).hasSize(logs.getTotal().intValue()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getLogEntriesUpto(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 8)); @@ -431,7 +441,7 @@ void getLogEntriesUpto(ArangoDB arangoDB) { .doesNotContain("INFO"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getLogEntriesLevel(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 8)); @@ -441,7 +451,7 @@ void getLogEntriesLevel(ArangoDB arangoDB) { .containsOnly("INFO"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getLogEntriesStart(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 8)); @@ -453,7 +463,7 @@ void getLogEntriesStart(ArangoDB arangoDB) { .doesNotContain(firstId); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getLogEntriesSize(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 8)); @@ -464,7 +474,7 @@ void getLogEntriesSize(ArangoDB arangoDB) { assertThat(logsSize.getMessages()).hasSize(count - 1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getLogEntriesOffset(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 8)); @@ -477,16 +487,16 @@ void getLogEntriesOffset(ArangoDB arangoDB) { .doesNotContain(firstId); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getLogEntriesSearch(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 8)); final LogEntriesEntity logs = arangoDB.getLogEntries(null); - final LogEntriesEntity logsSearch = arangoDB.getLogEntries(new LogOptions().search(TEST_DB)); + final LogEntriesEntity logsSearch = arangoDB.getLogEntries(new LogOptions().search(getTestDb())); assertThat(logs.getTotal()).isGreaterThan(logsSearch.getTotal()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getLogEntriesSortAsc(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 8)); @@ -501,7 +511,7 @@ void getLogEntriesSortAsc(ArangoDB arangoDB) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getLogEntriesSortDesc(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 8)); @@ -516,7 +526,7 @@ void getLogEntriesSortDesc(ArangoDB arangoDB) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getLogLevel(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 7)); // it fails in 3.6 active-failover (BTS-362) @@ -524,7 +534,7 @@ void getLogLevel(ArangoDB arangoDB) { assertThat(logLevel.getAgency()).isEqualTo(LogLevelEntity.LogLevel.INFO); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void setLogLevel(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 7)); // it fails in 3.6 active-failover (BTS-362) @@ -539,7 +549,7 @@ void setLogLevel(ArangoDB arangoDB) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void setAllLogLevel(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 9)); @@ -557,7 +567,7 @@ void setAllLogLevel(ArangoDB arangoDB) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void logLevelWithServerId(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 10)); @@ -576,7 +586,7 @@ void logLevelWithServerId(ArangoDB arangoDB) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void getQueryOptimizerRules(ArangoDB arangoDB) { assumeTrue(isAtLeastVersion(3, 10)); @@ -595,7 +605,7 @@ void getQueryOptimizerRules(ArangoDB arangoDB) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void arangoDBException(ArangoDB arangoDB) { Throwable thrown = catchThrowable(() -> arangoDB.db("no").getInfo()); @@ -605,7 +615,7 @@ void arangoDBException(ArangoDB arangoDB) { assertThat(e.getErrorNum()).isEqualTo(1228); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void fallbackHost() { final ArangoDB arangoDB = new ArangoDB.Builder() @@ -615,7 +625,7 @@ void fallbackHost() { assertThat(version).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void loadproperties() { Throwable thrown = catchThrowable(() -> new ArangoDB.Builder() @@ -624,7 +634,7 @@ void loadproperties() { assertThat(thrown).isInstanceOf(IllegalArgumentException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void loadpropertiesWithPrefix() { ArangoDB adb = new ArangoDB.Builder() @@ -634,7 +644,7 @@ void loadpropertiesWithPrefix() { adb.shutdown(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void accessMultipleDatabases(ArangoDB arangoDB) { final ArangoDBVersion version1 = arangoDB.db(DB1).getVersion(); @@ -643,7 +653,7 @@ void accessMultipleDatabases(ArangoDB arangoDB) { assertThat(version2).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") @Disabled("Manual execution only") void queueTime(ArangoDB arangoDB) throws InterruptedException, ExecutionException { diff --git a/driver/src/test/java/com/arangodb/ArangoDatabaseAsyncTest.java b/driver/src/test/java/com/arangodb/ArangoDatabaseAsyncTest.java index 5274b496c..6f50b192d 100644 --- a/driver/src/test/java/com/arangodb/ArangoDatabaseAsyncTest.java +++ b/driver/src/test/java/com/arangodb/ArangoDatabaseAsyncTest.java @@ -27,6 +27,7 @@ import com.arangodb.util.MapBuilder; import com.arangodb.util.RawBytes; import com.arangodb.util.RawJson; +import com.arangodb.util.SlowTest; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; @@ -61,7 +62,7 @@ static void init() { BaseJunit5.initEdgeCollections(ENAMES); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getVersion(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final ArangoDBVersion version = db.getVersion().get(); @@ -70,7 +71,7 @@ void getVersion(ArangoDatabaseAsync db) throws ExecutionException, InterruptedEx assertThat(version.getVersion()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getEngine(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final ArangoDBEngine engine = db.getEngine().get(); @@ -78,21 +79,21 @@ void getEngine(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExc assertThat(engine.getName()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void exists(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { - assertThat(arangoDB.db(TEST_DB).exists().get()).isTrue(); + assertThat(arangoDB.db(getTestDb()).exists().get()).isTrue(); assertThat(arangoDB.db("no").exists().get()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getAccessibleDatabases(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final Collection dbs = db.getAccessibleDatabases().get(); assertThat(dbs).contains("_system"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollection(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { String name = rndName(); @@ -101,20 +102,20 @@ void createCollection(ArangoDatabaseAsync db) throws ExecutionException, Interru assertThat(result.getId()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithNotNormalizedName(ArangoDatabaseAsync db) { assumeTrue(supportsExtendedNames()); final String colName = "testCol-\u006E\u0303\u00f1"; - Throwable thrown = catchThrowable(() -> db.createCollection(colName)); + Throwable thrown = catchThrowable(() -> db.createCollection(colName).get()).getCause(); assertThat(thrown) .isInstanceOf(ArangoDBException.class) .hasMessageContaining("normalized") .extracting(it -> ((ArangoDBException) it).getResponseCode()).isEqualTo(400); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithReplicationFactor(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); @@ -127,7 +128,7 @@ void createCollectionWithReplicationFactor(ArangoDatabaseAsync db) throws Execut assertThat(props.getReplicationFactor().get()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithWriteConcern(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -143,7 +144,7 @@ void createCollectionWithWriteConcern(ArangoDatabaseAsync db) throws ExecutionEx assertThat(props.getWriteConcern()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createSatelliteCollection(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isEnterprise()); @@ -159,7 +160,7 @@ void createSatelliteCollection(ArangoDatabaseAsync db) throws ExecutionException assertThat(props.getReplicationFactor()).isEqualTo(ReplicationFactor.ofSatellite()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithNumberOfShards(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); @@ -173,7 +174,7 @@ void createCollectionWithNumberOfShards(ArangoDatabaseAsync db) throws Execution assertThat(props.getNumberOfShards()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithShardingStrategys(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -189,7 +190,7 @@ void createCollectionWithShardingStrategys(ArangoDatabaseAsync db) throws Execut assertThat(props.getShardingStrategy()).isEqualTo(ShardingStrategy.COMMUNITY_COMPAT.getInternalName()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithSmartJoinAttribute(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -207,7 +208,7 @@ void createCollectionWithSmartJoinAttribute(ArangoDatabaseAsync db) throws Execu assertThat(db.collection(name).getProperties().get().getSmartJoinAttribute()).isEqualTo("test123"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithSmartJoinAttributeWrong(ArangoDatabaseAsync db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -222,7 +223,7 @@ void createCollectionWithSmartJoinAttributeWrong(ArangoDatabaseAsync db) { assertThat(((ArangoDBException) thrown).getResponseCode()).isEqualTo(400); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithNumberOfShardsAndShardKey(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); @@ -237,7 +238,7 @@ void createCollectionWithNumberOfShardsAndShardKey(ArangoDatabaseAsync db) throw assertThat(properties.getShardKeys()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithNumberOfShardsAndShardKeys(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); @@ -251,7 +252,7 @@ void createCollectionWithNumberOfShardsAndShardKeys(ArangoDatabaseAsync db) thro assertThat(properties.getShardKeys()).hasSize(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithDistributeShardsLike(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isEnterprise()); @@ -279,34 +280,34 @@ private void createCollectionWithKeyType(ArangoDatabaseAsync db, KeyType keyType assertThat(db.collection(name).getProperties().get().getKeyOptions().getType()).isEqualTo(keyType); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithKeyTypeAutoincrement(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); createCollectionWithKeyType(db, KeyType.autoincrement); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithKeyTypePadded(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); createCollectionWithKeyType(db, KeyType.padded); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithKeyTypeTraditional(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { createCollectionWithKeyType(db, KeyType.traditional); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithKeyTypeUuid(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); createCollectionWithKeyType(db, KeyType.uuid); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithJsonSchema(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -354,7 +355,7 @@ void createCollectionWithJsonSchema(ArangoDatabaseAsync db) throws ExecutionExce assertThat(e.getErrorNum()).isEqualTo(1620); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCollectionWithComputedFields(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -390,7 +391,7 @@ void createCollectionWithComputedFields(ArangoDatabaseAsync db) throws Execution .contains(cv2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void deleteCollection(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { String name = rndName(); @@ -400,7 +401,7 @@ void deleteCollection(ArangoDatabaseAsync db) throws ExecutionException, Interru assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void deleteSystemCollection(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final String name = "_system_test"; @@ -413,7 +414,7 @@ void deleteSystemCollection(ArangoDatabaseAsync db) throws ExecutionException, I .isEqualTo(404); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void deleteSystemCollectionFail(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final String name = "_system_test"; @@ -430,7 +431,7 @@ void deleteSystemCollectionFail(ArangoDatabaseAsync db) throws ExecutionExceptio assertThat(collection.exists().get()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getIndex(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final Collection fields = Collections.singletonList("field-" + rnd()); @@ -440,7 +441,7 @@ void getIndex(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExce assertThat(readResult.getType()).isEqualTo(createResult.getType()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void deleteIndex(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final Collection fields = Collections.singletonList("field-" + rnd()); @@ -453,7 +454,7 @@ void deleteIndex(ArangoDatabaseAsync db) throws ExecutionException, InterruptedE assertThat(e.getResponseCode()).isEqualTo(404); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getCollections(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final Collection collections = db.getCollections(null).get(); @@ -461,7 +462,7 @@ void getCollections(ArangoDatabaseAsync db) throws ExecutionException, Interrupt assertThat(count).isEqualTo(1L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getCollectionsExcludeSystem(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final CollectionsReadOptions options = new CollectionsReadOptions().excludeSystem(true); @@ -470,39 +471,39 @@ void getCollectionsExcludeSystem(ArangoDatabaseAsync db) throws ExecutionExcepti assertThat(allCollections).hasSizeGreaterThan(nonSystemCollections.size()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void grantAccess(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null).get(); - arangoDB.db(TEST_DB).grantAccess(user).get(); + arangoDB.db(getTestDb()).grantAccess(user).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void grantAccessRW(ArangoDBAsync arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).grantAccess(user, Permissions.RW); + arangoDB.db(getTestDb()).grantAccess(user, Permissions.RW); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void grantAccessRO(ArangoDBAsync arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).grantAccess(user, Permissions.RO); + arangoDB.db(getTestDb()).grantAccess(user, Permissions.RO); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void grantAccessNONE(ArangoDBAsync arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).grantAccess(user, Permissions.NONE); + arangoDB.db(getTestDb()).grantAccess(user, Permissions.NONE); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void grantAccessUserNotFound(ArangoDatabaseAsync db) { String user = "user-" + rnd(); @@ -510,15 +511,15 @@ void grantAccessUserNotFound(ArangoDatabaseAsync db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void revokeAccess(ArangoDBAsync arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).revokeAccess(user); + arangoDB.db(getTestDb()).revokeAccess(user); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void revokeAccessUserNotFound(ArangoDatabaseAsync db) { String user = "user-" + rnd(); @@ -526,15 +527,15 @@ void revokeAccessUserNotFound(ArangoDatabaseAsync db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void resetAccess(ArangoDBAsync arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).resetAccess(user); + arangoDB.db(getTestDb()).resetAccess(user); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void resetAccessUserNotFound(ArangoDatabaseAsync db) { String user = "user-" + rnd(); @@ -542,21 +543,21 @@ void resetAccessUserNotFound(ArangoDatabaseAsync db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void grantDefaultCollectionAccess(ArangoDBAsync arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234"); - arangoDB.db(TEST_DB).grantDefaultCollectionAccess(user, Permissions.RW); + arangoDB.db(getTestDb()).grantDefaultCollectionAccess(user, Permissions.RW); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getPermissions(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assertThat(db.getPermissions("root").get()).isEqualTo(Permissions.RW); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void query(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { ArangoCursorAsync cursor = db.query("for i in 0..9 return i", Integer.class).get(); @@ -567,14 +568,14 @@ void query(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcepti } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithNullBindVar(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final ArangoCursorAsync cursor = db.query("return @foo", Object.class, Collections.singletonMap("foo", null)).get(); assertThat(cursor.getResult()).containsExactly((Object) null); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryForEach(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { for (int i = 0; i < 10; i++) { @@ -584,7 +585,7 @@ void queryForEach(ArangoDatabaseAsync db) throws ExecutionException, Interrupted assertThat(cursor.getResult()).hasSizeGreaterThanOrEqualTo(10); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithCount(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { for (int i = 0; i < 10; i++) { @@ -597,7 +598,7 @@ void queryWithCount(ArangoDatabaseAsync db) throws ExecutionException, Interrupt assertThat(cursor.getResult()).hasSize(6); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithLimitAndFullCount(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { for (int i = 0; i < 10; i++) { @@ -612,7 +613,7 @@ void queryWithLimitAndFullCount(ArangoDatabaseAsync db) throws ExecutionExceptio assertThat((cursor.getExtra().getStats().getFullCount())).isGreaterThanOrEqualTo(10); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryStats(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { for (int i = 0; i < 10; i++) { @@ -631,7 +632,7 @@ void queryStats(ArangoDatabaseAsync db) throws ExecutionException, InterruptedEx assertThat(cursor.getExtra().getStats().getPeakMemoryUsage()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithBatchSize(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final ArangoCursorAsync cursor = db @@ -645,7 +646,8 @@ void queryWithBatchSize(ArangoDatabaseAsync db) throws ExecutionException, Inter assertThat(c2.hasMore()).isFalse(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncDbs") void queryWithTTL(ArangoDatabaseAsync db) throws InterruptedException, ExecutionException { final ArangoCursorAsync cursor = db @@ -659,7 +661,7 @@ void queryWithTTL(ArangoDatabaseAsync db) throws InterruptedException, Execution assertThat(ex.getMessage()).isEqualTo("Response: 404, Error: 1600 - cursor not found"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void changeQueryCache(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { QueryCachePropertiesEntity properties = db.getQueryCacheProperties().get(); @@ -680,7 +682,7 @@ void changeQueryCache(ArangoDatabaseAsync db) throws ExecutionException, Interru db.setQueryCacheProperties(properties2).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithCache(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -711,7 +713,7 @@ void queryWithCache(ArangoDatabaseAsync db) throws ExecutionException, Interrupt db.setQueryCacheProperties(properties2).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithMemoryLimit(ArangoDatabaseAsync db) { Throwable thrown = catchThrowable(() -> db.query("RETURN 1..100000", String.class, @@ -720,7 +722,7 @@ void queryWithMemoryLimit(ArangoDatabaseAsync db) { assertThat(((ArangoDBException) thrown).getErrorNum()).isEqualTo(32); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithFailOnWarningTrue(ArangoDatabaseAsync db) { Throwable thrown = catchThrowable(() -> db.query("RETURN 1 / 0", String.class, @@ -728,7 +730,7 @@ void queryWithFailOnWarningTrue(ArangoDatabaseAsync db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithFailOnWarningFalse(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final ArangoCursorAsync cursor = db @@ -736,7 +738,8 @@ void queryWithFailOnWarningFalse(ArangoDatabaseAsync db) throws ExecutionExcepti assertThat(cursor.getResult()).containsExactly((String) null); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncDbs") void queryWithTimeout(ArangoDatabaseAsync db) { assumeTrue(isAtLeastVersion(3, 6)); @@ -746,7 +749,7 @@ void queryWithTimeout(ArangoDatabaseAsync db) { assertThat(((ArangoDBException) thrown).getResponseCode()).isEqualTo(410); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithMaxWarningCount(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final ArangoCursorAsync cursorWithWarnings = db @@ -758,7 +761,7 @@ void queryWithMaxWarningCount(ArangoDatabaseAsync db) throws ExecutionException, assertThat(warnings).isNullOrEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryCursor(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { ArangoCursorAsync c1 = db.query("for i in 1..4 return i", Integer.class, @@ -775,7 +778,7 @@ void queryCursor(ArangoDatabaseAsync db) throws ExecutionException, InterruptedE assertThat(result).containsExactly(1, 2, 3, 4); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryCursorRetry(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 11)); @@ -794,7 +797,7 @@ void queryCursorRetry(ArangoDatabaseAsync db) throws ExecutionException, Interru assertThat(result).containsExactly(1, 2, 3, 4); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void changeQueryTrackingProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { try { @@ -818,7 +821,7 @@ void changeQueryTrackingProperties(ArangoDatabaseAsync db) throws ExecutionExcep } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithBindVars(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { for (int i = 0; i < 10; i++) { @@ -836,7 +839,7 @@ void queryWithBindVars(ArangoDatabaseAsync db) throws ExecutionException, Interr assertThat(cursor.getResult()).hasSizeGreaterThanOrEqualTo(5); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithRawBindVars(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final Map bindVars = new HashMap<>(); @@ -850,7 +853,7 @@ void queryWithRawBindVars(ArangoDatabaseAsync db) throws ExecutionException, Int assertThat(res.get("bar").intValue()).isEqualTo(11); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void queryWithWarning(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { final ArangoCursorAsync cursor = arangoDB.db().query("return 1/0", String.class).get(); @@ -860,7 +863,7 @@ void queryWithWarning(ArangoDBAsync arangoDB) throws ExecutionException, Interru .allSatisfy(w -> assertThat(w.getMessage()).contains("division by zero")); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryStream(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final ArangoCursorAsync cursor = db @@ -869,7 +872,7 @@ void queryStream(ArangoDatabaseAsync db) throws ExecutionException, InterruptedE assertThat(cursor.getCount()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryForceOneShardAttributeValue(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -897,7 +900,7 @@ void queryForceOneShardAttributeValue(ArangoDatabaseAsync db) throws ExecutionEx assertThat(c2.hasNext()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void queryClose(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { final ArangoCursorAsync cursor = arangoDB.db() @@ -911,7 +914,7 @@ void queryClose(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedEx assertThat(ex.getMessage()).contains("cursor not found"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void queryCloseShouldBeIdempotent(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { ArangoCursorAsync cursor = arangoDB.db().query("for i in 1..2 return i", Integer.class, @@ -920,7 +923,7 @@ void queryCloseShouldBeIdempotent(ArangoDBAsync arangoDB) throws ExecutionExcept cursor.close().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void queryCloseOnCursorWithoutId(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { ArangoCursorAsync cursor = arangoDB.db().query("return 1", Integer.class).get(); @@ -928,20 +931,20 @@ void queryCloseOnCursorWithoutId(ArangoDBAsync arangoDB) throws ExecutionExcepti cursor.close().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryNoResults(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { db.query("FOR i IN @@col RETURN i", BaseDocument.class, new MapBuilder().put("@col", CNAME1).get()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryWithNullBindParam(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { db.query("FOR i IN @@col FILTER i.test == @test RETURN i", BaseDocument.class, new MapBuilder().put("@col", CNAME1).put("test", null).get()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void queryAllowDirtyRead(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final ArangoCursorAsync cursor = db.query("FOR i IN @@col FILTER i.test == @test RETURN i", @@ -950,7 +953,7 @@ BaseDocument.class, new MapBuilder().put("@col", CNAME1).put("test", null).get() assertThat(cursor.isPotentialDirtyRead()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void queryAllowRetry(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 11)); @@ -968,7 +971,7 @@ void queryAllowRetry(ArangoDBAsync arangoDB) throws ExecutionException, Interrup cursor.close().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void queryAllowRetryClose(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 11)); @@ -982,7 +985,7 @@ void queryAllowRetryClose(ArangoDBAsync arangoDB) throws ExecutionException, Int c2.close().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void queryAllowRetryCloseBeforeLatestBatch(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 11)); @@ -993,7 +996,7 @@ void queryAllowRetryCloseBeforeLatestBatch(ArangoDBAsync arangoDB) throws Execut cursor.close().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncArangos") void queryAllowRetryCloseSingleBatch(ArangoDBAsync arangoDB) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 11)); @@ -1004,7 +1007,7 @@ void queryAllowRetryCloseSingleBatch(ArangoDBAsync arangoDB) throws ExecutionExc cursor.close().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void explainQuery(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final AqlExecutionExplainEntity explain = db.explainQuery("for i in 1..1 return i", null, null).get(); @@ -1023,7 +1026,7 @@ void explainQuery(ArangoDatabaseAsync db) throws ExecutionException, Interrupted } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void explainQueryWithBindVars(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final AqlExecutionExplainEntity explain = db.explainQuery("for i in 1..1 return @value", @@ -1039,7 +1042,7 @@ void explainQueryWithBindVars(ArangoDatabaseAsync db) throws ExecutionException, assertThat(plan.getNodes()).isNotEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void explainQueryWithIndexNode(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { ArangoCollectionAsync character = db.collection("got_characters"); @@ -1067,7 +1070,7 @@ void explainQueryWithIndexNode(ArangoDatabaseAsync db) throws ExecutionException }); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void parseQuery(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final AqlParseEntity parse = db.parseQuery("for i in 1..1 return i").get(); @@ -1077,7 +1080,8 @@ void parseQuery(ArangoDatabaseAsync db) throws ExecutionException, InterruptedEx assertThat(parse.getAst()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncDbs") void getCurrentlyRunningQueries(ArangoDatabaseAsync db) throws InterruptedException, ExecutionException { String query = "return sleep(1)"; @@ -1101,7 +1105,8 @@ void getCurrentlyRunningQueries(ArangoDatabaseAsync db) throws InterruptedExcept q.get(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncDbs") void killQuery(ArangoDatabaseAsync db) throws InterruptedException, ExecutionException { CompletableFuture> c = db.query("return sleep(5)", Void.class); @@ -1125,7 +1130,8 @@ void killQuery(ArangoDatabaseAsync db) throws InterruptedException, ExecutionExc assertThat(e.getErrorMessage()).contains("query killed"); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("asyncDbs") void getAndClearSlowQueries(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { db.clearSlowQueries().get(); @@ -1159,7 +1165,7 @@ void getAndClearSlowQueries(ArangoDatabaseAsync db) throws ExecutionException, I db.setQueryTrackingProperties(properties).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createGetDeleteAqlFunction(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final Collection aqlFunctionsInitial = db.getAqlFunctions(null).get(); @@ -1183,7 +1189,7 @@ void createGetDeleteAqlFunction(ArangoDatabaseAsync db) throws ExecutionExceptio } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createGetDeleteAqlFunctionWithNamespace(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final Collection aqlFunctionsInitial = db.getAqlFunctions(null).get(); @@ -1208,7 +1214,7 @@ void createGetDeleteAqlFunctionWithNamespace(ArangoDatabaseAsync db) throws Exec } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { String name = "graph-" + rnd(); @@ -1216,7 +1222,7 @@ void createGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedE assertThat(result.getName()).isEqualTo(name); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createGraphSatellite(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 7)); @@ -1234,7 +1240,7 @@ void createGraphSatellite(ArangoDatabaseAsync db) throws ExecutionException, Int assertThat(graph.getReplicationFactor()).isEqualTo(ReplicationFactor.ofSatellite()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createGraphReplicationFaktor(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); @@ -1252,7 +1258,7 @@ void createGraphReplicationFaktor(ArangoDatabaseAsync db) throws ExecutionExcept } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createGraphNumberOfShards(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); @@ -1271,7 +1277,7 @@ void createGraphNumberOfShards(ArangoDatabaseAsync db) throws ExecutionException } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getGraphs(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { String name = "graph-" + rnd(); @@ -1282,7 +1288,7 @@ void getGraphs(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExc assertThat(count).isEqualTo(1L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionString(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final TransactionOptions options = new TransactionOptions().params("test"); @@ -1290,7 +1296,7 @@ void transactionString(ArangoDatabaseAsync db) throws ExecutionException, Interr assertThat(result.get()).isEqualTo("\"test\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionNumber(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final TransactionOptions options = new TransactionOptions().params(5); @@ -1298,7 +1304,7 @@ void transactionNumber(ArangoDatabaseAsync db) throws ExecutionException, Interr assertThat(result).isEqualTo(5); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionJsonNode(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final TransactionOptions options = new TransactionOptions().params(JsonNodeFactory.instance.textNode("test")); @@ -1307,7 +1313,7 @@ void transactionJsonNode(ArangoDatabaseAsync db) throws ExecutionException, Inte assertThat(result.asText()).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionJsonObject(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { ObjectNode params = JsonNodeFactory.instance.objectNode().put("foo", "hello").put("bar", "world"); @@ -1318,7 +1324,7 @@ void transactionJsonObject(ArangoDatabaseAsync db) throws ExecutionException, In assertThat(result.get()).isEqualTo("\"hello world\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionJsonArray(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { ArrayNode params = JsonNodeFactory.instance.arrayNode().add("hello").add("world"); @@ -1328,7 +1334,7 @@ void transactionJsonArray(ArangoDatabaseAsync db) throws ExecutionException, Int assertThat(result.get()).isEqualTo("\"hello world\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionMap(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final Map params = new MapBuilder().put("foo", "hello").put("bar", "world").get(); @@ -1339,7 +1345,7 @@ void transactionMap(ArangoDatabaseAsync db) throws ExecutionException, Interrupt assertThat(result.get()).isEqualTo("\"hello world\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionArray(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final String[] params = new String[]{"hello", "world"}; @@ -1349,7 +1355,7 @@ void transactionArray(ArangoDatabaseAsync db) throws ExecutionException, Interru assertThat(result.get()).isEqualTo("\"hello world\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionCollection(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final Collection params = new ArrayList<>(); @@ -1361,7 +1367,7 @@ void transactionCollection(ArangoDatabaseAsync db) throws ExecutionException, In assertThat(result.get()).isEqualTo("\"hello world\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionInsertJson(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { String key = "key-" + rnd(); @@ -1374,7 +1380,7 @@ void transactionInsertJson(ArangoDatabaseAsync db) throws ExecutionException, In assertThat(db.collection(CNAME1).getDocument(key, RawJson.class).get()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionExclusiveWrite(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -1388,13 +1394,13 @@ void transactionExclusiveWrite(ArangoDatabaseAsync db) throws ExecutionException assertThat(db.collection(CNAME1).getDocument(key, RawJson.class).get()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionEmpty(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { db.transaction("function () {}", Void.class, null).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionAllowImplicit(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final String action = "function (params) {" + "var db = require('internal').db;" @@ -1410,7 +1416,7 @@ void transactionAllowImplicit(ArangoDatabaseAsync db) throws ExecutionException, .isEqualTo(400); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionPojoReturn(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final String action = "function() { return {'value':'hello world'}; }"; @@ -1419,13 +1425,13 @@ void transactionPojoReturn(ArangoDatabaseAsync db) throws ExecutionException, In assertThat(res.value).isEqualTo("hello world"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final DatabaseEntity info = db.getInfo().get(); assertThat(info).isNotNull(); assertThat(info.getId()).isNotNull(); - assertThat(info.getName()).isEqualTo(TEST_DB); + assertThat(info.getName()).isEqualTo(getTestDb()); assertThat(info.getPath()).isNotNull(); assertThat(info.getIsSystem()).isFalse(); @@ -1436,7 +1442,7 @@ void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcep } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void shouldIncludeExceptionMessage(ArangoDatabaseAsync db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -1448,7 +1454,7 @@ void shouldIncludeExceptionMessage(ArangoDatabaseAsync db) { assertThat(((ArangoDBException) thrown).getErrorMessage()).isEqualTo(exceptionMessage); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void reloadRouting(ArangoDatabaseAsync db) { db.reloadRouting(); diff --git a/driver/src/test/java/com/arangodb/ArangoDatabaseTest.java b/driver/src/test/java/com/arangodb/ArangoDatabaseTest.java index 0958486bb..f79a70144 100644 --- a/driver/src/test/java/com/arangodb/ArangoDatabaseTest.java +++ b/driver/src/test/java/com/arangodb/ArangoDatabaseTest.java @@ -64,7 +64,7 @@ static void init() { BaseJunit5.initEdgeCollections(ENAMES); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getVersion(ArangoDatabase db) { final ArangoDBVersion version = db.getVersion(); @@ -73,7 +73,7 @@ void getVersion(ArangoDatabase db) { assertThat(version.getVersion()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getEngine(ArangoDatabase db) { final ArangoDBEngine engine = db.getEngine(); @@ -81,21 +81,21 @@ void getEngine(ArangoDatabase db) { assertThat(engine.getName()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void exists(ArangoDB arangoDB) { - assertThat(arangoDB.db(TEST_DB).exists()).isTrue(); + assertThat(arangoDB.db(getTestDb()).exists()).isTrue(); assertThat(arangoDB.db("no").exists()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getAccessibleDatabases(ArangoDatabase db) { final Collection dbs = db.getAccessibleDatabases(); assertThat(dbs).contains("_system"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollection(ArangoDatabase db) { String name = rndName(); @@ -104,7 +104,7 @@ void createCollection(ArangoDatabase db) { assertThat(result.getId()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithNotNormalizedName(ArangoDatabase db) { assumeTrue(supportsExtendedNames()); @@ -117,7 +117,7 @@ void createCollectionWithNotNormalizedName(ArangoDatabase db) { .extracting(it -> ((ArangoDBException) it).getResponseCode()).isEqualTo(400); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithReplicationFactor(ArangoDatabase db) { assumeTrue(isCluster()); @@ -130,7 +130,7 @@ void createCollectionWithReplicationFactor(ArangoDatabase db) { assertThat(props.getReplicationFactor().get()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithWriteConcern(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -146,7 +146,7 @@ void createCollectionWithWriteConcern(ArangoDatabase db) { assertThat(props.getWriteConcern()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createSatelliteCollection(ArangoDatabase db) { assumeTrue(isEnterprise()); @@ -162,7 +162,7 @@ void createSatelliteCollection(ArangoDatabase db) { assertThat(props.getReplicationFactor()).isEqualTo(ReplicationFactor.ofSatellite()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithNumberOfShards(ArangoDatabase db) { assumeTrue(isCluster()); @@ -176,7 +176,7 @@ void createCollectionWithNumberOfShards(ArangoDatabase db) { assertThat(props.getNumberOfShards()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithShardingStrategys(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -192,7 +192,7 @@ void createCollectionWithShardingStrategys(ArangoDatabase db) { assertThat(props.getShardingStrategy()).isEqualTo(ShardingStrategy.COMMUNITY_COMPAT.getInternalName()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithSmartJoinAttribute(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -210,7 +210,7 @@ void createCollectionWithSmartJoinAttribute(ArangoDatabase db) { assertThat(db.collection(name).getProperties().getSmartJoinAttribute()).isEqualTo("test123"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithSmartJoinAttributeWrong(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -227,7 +227,7 @@ void createCollectionWithSmartJoinAttributeWrong(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithNumberOfShardsAndShardKey(ArangoDatabase db) { assumeTrue(isCluster()); @@ -242,7 +242,7 @@ void createCollectionWithNumberOfShardsAndShardKey(ArangoDatabase db) { assertThat(properties.getShardKeys()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithNumberOfShardsAndShardKeys(ArangoDatabase db) { assumeTrue(isCluster()); @@ -256,7 +256,7 @@ void createCollectionWithNumberOfShardsAndShardKeys(ArangoDatabase db) { assertThat(properties.getShardKeys()).hasSize(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithDistributeShardsLike(ArangoDatabase db) { assumeTrue(isEnterprise()); @@ -284,34 +284,34 @@ private void createCollectionWithKeyType(ArangoDatabase db, KeyType keyType) { assertThat(db.collection(name).getProperties().getKeyOptions().getType()).isEqualTo(keyType); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithKeyTypeAutoincrement(ArangoDatabase db) { assumeTrue(isSingleServer()); createCollectionWithKeyType(db, KeyType.autoincrement); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithKeyTypePadded(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); createCollectionWithKeyType(db, KeyType.padded); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithKeyTypeTraditional(ArangoDatabase db) { createCollectionWithKeyType(db, KeyType.traditional); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithKeyTypeUuid(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); createCollectionWithKeyType(db, KeyType.uuid); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithJsonSchema(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 7)); @@ -359,7 +359,7 @@ void createCollectionWithJsonSchema(ArangoDatabase db) { assertThat(e.getErrorNum()).isEqualTo(1620); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCollectionWithComputedFields(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -395,7 +395,7 @@ void createCollectionWithComputedFields(ArangoDatabase db) { .contains(cv2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void deleteCollection(ArangoDatabase db) { String name = rndName(); @@ -405,7 +405,7 @@ void deleteCollection(ArangoDatabase db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void deleteSystemCollection(ArangoDatabase db) { final String name = "_system_test"; @@ -418,7 +418,7 @@ void deleteSystemCollection(ArangoDatabase db) { .isEqualTo(404); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void deleteSystemCollectionFail(ArangoDatabase db) { final String name = "_system_test"; @@ -442,7 +442,7 @@ void deleteSystemCollectionFail(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getIndex(ArangoDatabase db) { final Collection fields = Collections.singletonList("field-" + rnd()); @@ -452,7 +452,7 @@ void getIndex(ArangoDatabase db) { assertThat(readResult.getType()).isEqualTo(createResult.getType()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void deleteIndex(ArangoDatabase db) { final Collection fields = Collections.singletonList("field-" + rnd()); @@ -467,7 +467,7 @@ void deleteIndex(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getCollections(ArangoDatabase db) { final Collection collections = db.getCollections(null); @@ -475,7 +475,7 @@ void getCollections(ArangoDatabase db) { assertThat(count).isEqualTo(1L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getCollectionsExcludeSystem(ArangoDatabase db) { final CollectionsReadOptions options = new CollectionsReadOptions().excludeSystem(true); @@ -484,39 +484,39 @@ void getCollectionsExcludeSystem(ArangoDatabase db) { assertThat(allCollections).hasSizeGreaterThan(nonSystemCollections.size()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void grantAccess(ArangoDB arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).grantAccess(user); + arangoDB.db(getTestDb()).grantAccess(user); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void grantAccessRW(ArangoDB arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).grantAccess(user, Permissions.RW); + arangoDB.db(getTestDb()).grantAccess(user, Permissions.RW); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void grantAccessRO(ArangoDB arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).grantAccess(user, Permissions.RO); + arangoDB.db(getTestDb()).grantAccess(user, Permissions.RO); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void grantAccessNONE(ArangoDB arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).grantAccess(user, Permissions.NONE); + arangoDB.db(getTestDb()).grantAccess(user, Permissions.NONE); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void grantAccessUserNotFound(ArangoDatabase db) { String user = "user-" + rnd(); @@ -524,15 +524,15 @@ void grantAccessUserNotFound(ArangoDatabase db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void revokeAccess(ArangoDB arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).revokeAccess(user); + arangoDB.db(getTestDb()).revokeAccess(user); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void revokeAccessUserNotFound(ArangoDatabase db) { String user = "user-" + rnd(); @@ -540,15 +540,15 @@ void revokeAccessUserNotFound(ArangoDatabase db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void resetAccess(ArangoDB arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234", null); - arangoDB.db(TEST_DB).resetAccess(user); + arangoDB.db(getTestDb()).resetAccess(user); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void resetAccessUserNotFound(ArangoDatabase db) { String user = "user-" + rnd(); @@ -556,21 +556,21 @@ void resetAccessUserNotFound(ArangoDatabase db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void grantDefaultCollectionAccess(ArangoDB arangoDB) { String user = "user-" + rnd(); arangoDB.createUser(user, "1234"); - arangoDB.db(TEST_DB).grantDefaultCollectionAccess(user, Permissions.RW); + arangoDB.db(getTestDb()).grantDefaultCollectionAccess(user, Permissions.RW); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getPermissions(ArangoDatabase db) { assertThat(db.getPermissions("root")).isEqualTo(Permissions.RW); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void query(ArangoDatabase db) { for (int i = 0; i < 10; i++) { @@ -583,7 +583,7 @@ void query(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithNullBindVar(ArangoDatabase db) { final ArangoCursor cursor = db.query("return @foo", Object.class, Collections.singletonMap("foo", null)); @@ -591,7 +591,7 @@ void queryWithNullBindVar(ArangoDatabase db) { assertThat(cursor.next()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryForEach(ArangoDatabase db) { for (int i = 0; i < 10; i++) { @@ -608,7 +608,7 @@ void queryForEach(ArangoDatabase db) { assertThat(i).isGreaterThanOrEqualTo(10); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithCount(ArangoDatabase db) { for (int i = 0; i < 10; i++) { @@ -624,7 +624,7 @@ void queryWithCount(ArangoDatabase db) { assertThat(cursor.getCount()).isEqualTo(6); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithLimitAndFullCount(ArangoDatabase db) { for (int i = 0; i < 10; i++) { @@ -642,7 +642,7 @@ void queryWithLimitAndFullCount(ArangoDatabase db) { assertThat((cursor.getStats().getFullCount())).isGreaterThanOrEqualTo(10); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryStats(ArangoDatabase db) { for (int i = 0; i < 10; i++) { @@ -670,7 +670,7 @@ void queryStats(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithBatchSize(ArangoDatabase db) { for (int i = 0; i < 10; i++) { @@ -686,7 +686,7 @@ void queryWithBatchSize(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryIterateWithBatchSize(ArangoDatabase db) { for (int i = 0; i < 10; i++) { @@ -704,7 +704,8 @@ void queryIterateWithBatchSize(ArangoDatabase db) { assertThat(i.get()).isGreaterThanOrEqualTo(10); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("dbs") void queryWithTTL(ArangoDatabase db) throws InterruptedException { // set TTL to 1 seconds and get the second batch after 2 seconds! @@ -732,7 +733,7 @@ void queryWithTTL(ArangoDatabase db) throws InterruptedException { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void changeQueryCache(ArangoDatabase db) { QueryCachePropertiesEntity properties = db.getQueryCacheProperties(); @@ -753,7 +754,7 @@ void changeQueryCache(ArangoDatabase db) { db.setQueryCacheProperties(properties2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithCache(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -784,7 +785,7 @@ void queryWithCache(ArangoDatabase db) { db.setQueryCacheProperties(properties2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithMemoryLimit(ArangoDatabase db) { Throwable thrown = catchThrowable(() -> db.query("RETURN 1..100000", String.class, @@ -793,7 +794,7 @@ void queryWithMemoryLimit(ArangoDatabase db) { assertThat(((ArangoDBException) thrown).getErrorNum()).isEqualTo(32); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithFailOnWarningTrue(ArangoDatabase db) { Throwable thrown = catchThrowable(() -> db.query("RETURN 1 / 0", String.class, @@ -801,7 +802,7 @@ void queryWithFailOnWarningTrue(ArangoDatabase db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithFailOnWarningFalse(ArangoDatabase db) { final ArangoCursor cursor = db @@ -809,7 +810,8 @@ void queryWithFailOnWarningFalse(ArangoDatabase db) { assertThat(cursor.next()).isNull(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("dbs") void queryWithTimeout(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 6)); @@ -819,7 +821,7 @@ void queryWithTimeout(ArangoDatabase db) { assertThat(((ArangoDBException) thrown).getResponseCode()).isEqualTo(410); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithMaxWarningCount(ArangoDatabase db) { final ArangoCursor cursorWithWarnings = db @@ -831,7 +833,7 @@ void queryWithMaxWarningCount(ArangoDatabase db) { assertThat(warnings).isNullOrEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryCursor(ArangoDatabase db) { ArangoCursor cursor = db.query("for i in 1..4 return i", Integer.class, @@ -846,7 +848,7 @@ void queryCursor(ArangoDatabase db) { assertThat(result).containsExactly(1, 2, 3, 4); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryCursorRetry(ArangoDatabase db) throws IOException { assumeTrue(isAtLeastVersion(3, 11)); @@ -863,7 +865,7 @@ void queryCursorRetry(ArangoDatabase db) throws IOException { assertThat(result).containsExactly(1, 2, 3, 4); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void changeQueryTrackingProperties(ArangoDatabase db) { try { @@ -887,7 +889,7 @@ void changeQueryTrackingProperties(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithBindVars(ArangoDatabase db) { for (int i = 0; i < 10; i++) { @@ -909,7 +911,7 @@ void queryWithBindVars(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithRawBindVars(ArangoDatabase db) { final Map bindVars = new HashMap<>(); @@ -922,7 +924,7 @@ void queryWithRawBindVars(ArangoDatabase db) { assertThat(res.get("bar").intValue()).isEqualTo(11); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void queryWithWarning(ArangoDB arangoDB) { final ArangoCursor cursor = arangoDB.db().query("return 1/0", String.class); @@ -931,7 +933,7 @@ void queryWithWarning(ArangoDB arangoDB) { assertThat(cursor.getWarnings()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryStream(ArangoDatabase db) { final ArangoCursor cursor = db @@ -940,7 +942,7 @@ void queryStream(ArangoDatabase db) { assertThat(cursor.getCount()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryForceOneShardAttributeValue(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -968,7 +970,7 @@ void queryForceOneShardAttributeValue(ArangoDatabase db) { assertThat(c2.hasNext()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void queryClose(ArangoDB arangoDB) throws IOException { final ArangoCursor cursor = arangoDB.db() @@ -986,7 +988,7 @@ void queryClose(ArangoDB arangoDB) throws IOException { assertThat(count).hasValue(1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void queryCloseShouldBeIdempotent(ArangoDB arangoDB) throws IOException { ArangoCursor cursor = arangoDB.db().query("for i in 1..2 return i", Integer.class, @@ -995,7 +997,7 @@ void queryCloseShouldBeIdempotent(ArangoDB arangoDB) throws IOException { cursor.close(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void queryCloseOnCursorWithoutId(ArangoDB arangoDB) throws IOException { ArangoCursor cursor = arangoDB.db().query("return 1", Integer.class); @@ -1003,7 +1005,7 @@ void queryCloseOnCursorWithoutId(ArangoDB arangoDB) throws IOException { cursor.close(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryNoResults(ArangoDatabase db) throws IOException { final ArangoCursor cursor = db @@ -1011,7 +1013,7 @@ void queryNoResults(ArangoDatabase db) throws IOException { cursor.close(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryWithNullBindParam(ArangoDatabase db) throws IOException { final ArangoCursor cursor = db.query("FOR i IN @@col FILTER i.test == @test RETURN i", @@ -1019,7 +1021,7 @@ void queryWithNullBindParam(ArangoDatabase db) throws IOException { cursor.close(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void queryAllowDirtyRead(ArangoDatabase db) throws IOException { final ArangoCursor cursor = db.query("FOR i IN @@col FILTER i.test == @test RETURN i", @@ -1031,7 +1033,7 @@ BaseDocument.class, new MapBuilder().put("@col", CNAME1).put("test", null).get() cursor.close(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void queryAllowRetry(ArangoDB arangoDB) throws IOException { assumeTrue(isAtLeastVersion(3, 11)); @@ -1040,7 +1042,7 @@ void queryAllowRetry(ArangoDB arangoDB) throws IOException { assertThat(cursor.asListRemaining()).containsExactly("1", "2"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void queryAllowRetryClose(ArangoDB arangoDB) throws IOException { assumeTrue(isAtLeastVersion(3, 11)); @@ -1054,7 +1056,7 @@ void queryAllowRetryClose(ArangoDB arangoDB) throws IOException { cursor.close(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void queryAllowRetryCloseBeforeLatestBatch(ArangoDB arangoDB) throws IOException { assumeTrue(isAtLeastVersion(3, 11)); @@ -1066,7 +1068,7 @@ void queryAllowRetryCloseBeforeLatestBatch(ArangoDB arangoDB) throws IOException cursor.close(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("arangos") void queryAllowRetryCloseSingleBatch(ArangoDB arangoDB) throws IOException { assumeTrue(isAtLeastVersion(3, 11)); @@ -1080,7 +1082,7 @@ void queryAllowRetryCloseSingleBatch(ArangoDB arangoDB) throws IOException { cursor.close(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void explainQuery(ArangoDatabase db) { final AqlExecutionExplainEntity explain = db.explainQuery("for i in 1..1 return i", null, null); @@ -1099,7 +1101,7 @@ void explainQuery(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void explainQueryWithBindVars(ArangoDatabase db) { final AqlExecutionExplainEntity explain = db.explainQuery("for i in 1..1 return @value", @@ -1115,7 +1117,7 @@ void explainQueryWithBindVars(ArangoDatabase db) { assertThat(plan.getNodes()).isNotEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void explainQueryWithIndexNode(ArangoDatabase db) { ArangoCollection character = db.collection("got_characters"); @@ -1143,7 +1145,7 @@ void explainQueryWithIndexNode(ArangoDatabase db) { }); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void parseQuery(ArangoDatabase db) { final AqlParseEntity parse = db.parseQuery("for i in 1..1 return i"); @@ -1153,7 +1155,8 @@ void parseQuery(ArangoDatabase db) { assertThat(parse.getAst()).hasSize(1); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("dbs") void getCurrentlyRunningQueries(ArangoDatabase db) throws InterruptedException { String query = "return sleep(1)"; @@ -1178,7 +1181,8 @@ void getCurrentlyRunningQueries(ArangoDatabase db) throws InterruptedException { t.join(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("dbs") void killQuery(ArangoDatabase db) throws InterruptedException, ExecutionException { ExecutorService es = Executors.newSingleThreadExecutor(); @@ -1208,7 +1212,8 @@ void killQuery(ArangoDatabase db) throws InterruptedException, ExecutionExceptio es.shutdown(); } - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @MethodSource("dbs") void getAndClearSlowQueries(ArangoDatabase db) { db.clearSlowQueries(); @@ -1242,7 +1247,7 @@ void getAndClearSlowQueries(ArangoDatabase db) { db.setQueryTrackingProperties(properties); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createGetDeleteAqlFunction(ArangoDatabase db) { final Collection aqlFunctionsInitial = db.getAqlFunctions(null); @@ -1266,7 +1271,7 @@ void createGetDeleteAqlFunction(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createGetDeleteAqlFunctionWithNamespace(ArangoDatabase db) { final Collection aqlFunctionsInitial = db.getAqlFunctions(null); @@ -1291,7 +1296,7 @@ void createGetDeleteAqlFunctionWithNamespace(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createGraph(ArangoDatabase db) { String name = "graph-" + rnd(); @@ -1299,7 +1304,7 @@ void createGraph(ArangoDatabase db) { assertThat(result.getName()).isEqualTo(name); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createGraphSatellite(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 7)); @@ -1317,7 +1322,7 @@ void createGraphSatellite(ArangoDatabase db) { assertThat(graph.getReplicationFactor()).isEqualTo(ReplicationFactor.ofSatellite()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createGraphReplicationFaktor(ArangoDatabase db) { assumeTrue(isCluster()); @@ -1335,7 +1340,7 @@ void createGraphReplicationFaktor(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createGraphNumberOfShards(ArangoDatabase db) { assumeTrue(isCluster()); @@ -1354,7 +1359,7 @@ void createGraphNumberOfShards(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getGraphs(ArangoDatabase db) { String name = "graph-" + rnd(); @@ -1365,7 +1370,7 @@ void getGraphs(ArangoDatabase db) { assertThat(count).isEqualTo(1L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionString(ArangoDatabase db) { final TransactionOptions options = new TransactionOptions().params("test"); @@ -1373,7 +1378,7 @@ void transactionString(ArangoDatabase db) { assertThat(result.get()).isEqualTo("\"test\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionNumber(ArangoDatabase db) { final TransactionOptions options = new TransactionOptions().params(5); @@ -1381,7 +1386,7 @@ void transactionNumber(ArangoDatabase db) { assertThat(result).isEqualTo(5); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionJsonNode(ArangoDatabase db) { final TransactionOptions options = new TransactionOptions().params(JsonNodeFactory.instance.textNode("test")); @@ -1390,7 +1395,7 @@ void transactionJsonNode(ArangoDatabase db) { assertThat(result.asText()).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionJsonObject(ArangoDatabase db) { ObjectNode params = JsonNodeFactory.instance.objectNode().put("foo", "hello").put("bar", "world"); @@ -1401,7 +1406,7 @@ void transactionJsonObject(ArangoDatabase db) { assertThat(result.get()).isEqualTo("\"hello world\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionJsonArray(ArangoDatabase db) { ArrayNode params = JsonNodeFactory.instance.arrayNode().add("hello").add("world"); @@ -1411,7 +1416,7 @@ void transactionJsonArray(ArangoDatabase db) { assertThat(result.get()).isEqualTo("\"hello world\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionMap(ArangoDatabase db) { final Map params = new MapBuilder().put("foo", "hello").put("bar", "world").get(); @@ -1422,7 +1427,7 @@ void transactionMap(ArangoDatabase db) { assertThat(result.get()).isEqualTo("\"hello world\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionArray(ArangoDatabase db) { final String[] params = new String[]{"hello", "world"}; @@ -1432,7 +1437,7 @@ void transactionArray(ArangoDatabase db) { assertThat(result.get()).isEqualTo("\"hello world\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionCollection(ArangoDatabase db) { final Collection params = new ArrayList<>(); @@ -1444,7 +1449,7 @@ void transactionCollection(ArangoDatabase db) { assertThat(result.get()).isEqualTo("\"hello world\""); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionInsertJson(ArangoDatabase db) { String key = "key-" + rnd(); @@ -1457,7 +1462,7 @@ void transactionInsertJson(ArangoDatabase db) { assertThat(db.collection(CNAME1).getDocument(key, RawJson.class)).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionExclusiveWrite(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -1471,13 +1476,13 @@ void transactionExclusiveWrite(ArangoDatabase db) { assertThat(db.collection(CNAME1).getDocument(key, RawJson.class)).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionEmpty(ArangoDatabase db) { db.transaction("function () {}", Void.class, null); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionAllowImplicit(ArangoDatabase db) { final String action = "function (params) {" + "var db = require('internal').db;" @@ -1493,7 +1498,7 @@ void transactionAllowImplicit(ArangoDatabase db) { .isEqualTo(400); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionPojoReturn(ArangoDatabase db) { final String action = "function() { return {'value':'hello world'}; }"; @@ -1502,13 +1507,13 @@ void transactionPojoReturn(ArangoDatabase db) { assertThat(res.value).isEqualTo("hello world"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getInfo(ArangoDatabase db) { final DatabaseEntity info = db.getInfo(); assertThat(info).isNotNull(); assertThat(info.getId()).isNotNull(); - assertThat(info.getName()).isEqualTo(TEST_DB); + assertThat(info.getName()).isEqualTo(getTestDb()); assertThat(info.getPath()).isNotNull(); assertThat(info.getIsSystem()).isFalse(); @@ -1519,7 +1524,7 @@ void getInfo(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void shouldIncludeExceptionMessage(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -1534,7 +1539,7 @@ void shouldIncludeExceptionMessage(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void reloadRouting(ArangoDatabase db) { db.reloadRouting(); diff --git a/driver/src/test/java/com/arangodb/ArangoEdgeCollectionAsyncTest.java b/driver/src/test/java/com/arangodb/ArangoEdgeCollectionAsyncTest.java index 749082454..16b598936 100644 --- a/driver/src/test/java/com/arangodb/ArangoEdgeCollectionAsyncTest.java +++ b/driver/src/test/java/com/arangodb/ArangoEdgeCollectionAsyncTest.java @@ -23,6 +23,7 @@ import com.arangodb.entity.*; import com.arangodb.model.*; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Named; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -49,9 +50,9 @@ class ArangoEdgeCollectionAsyncTest extends BaseJunit5 { private static Stream asyncArgs() { return asyncDbsStream() - .map(db -> new Object[]{ - db.graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_NAME), - db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME) + .map(it -> new Object[]{ + Named.of(it.getName(), it.getPayload().graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_NAME)), + Named.of(it.getName(), it.getPayload().graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)) }) .map(Arguments::of); } @@ -81,7 +82,7 @@ private BaseEdgeDocument createEdgeValue(ArangoVertexCollectionAsync vertices) t return value; } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void insertEdge(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -94,7 +95,7 @@ void insertEdge(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync assertThat(document.getTo()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void insertEdgeUpdateRev(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -103,7 +104,7 @@ void insertEdgeUpdateRev(ArangoVertexCollectionAsync vertices, ArangoEdgeCollect assertThat(edge.getRev()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void insertEdgeViolatingUniqueConstraint(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { edges.graph().db().collection(EDGE_COLLECTION_NAME) @@ -119,7 +120,7 @@ void insertEdgeViolatingUniqueConstraint(ArangoVertexCollectionAsync vertices, A assertThat(e.getErrorNum()).isEqualTo(1210); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void getEdge(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -132,7 +133,7 @@ void getEdge(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edg assertThat(document.getTo()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void getEdgeIfMatch(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -144,7 +145,7 @@ void getEdgeIfMatch(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAs assertThat(document.getKey()).isEqualTo(edge.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void getEdgeIfMatchFail(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -155,7 +156,7 @@ void getEdgeIfMatchFail(ArangoVertexCollectionAsync vertices, ArangoEdgeCollecti assertThat(edge2).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void getEdgeIfNoneMatch(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -167,7 +168,7 @@ void getEdgeIfNoneMatch(ArangoVertexCollectionAsync vertices, ArangoEdgeCollecti assertThat(document.getKey()).isEqualTo(edge.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void getEdgeIfNoneMatchFail(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -178,7 +179,7 @@ void getEdgeIfNoneMatchFail(ArangoVertexCollectionAsync vertices, ArangoEdgeColl assertThat(edge2).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void replaceEdge(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -202,7 +203,7 @@ void replaceEdge(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void replaceEdgeUpdateRev(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -216,7 +217,7 @@ void replaceEdgeUpdateRev(ArangoVertexCollectionAsync vertices, ArangoEdgeCollec .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void replaceEdgeIfMatch(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -241,7 +242,7 @@ void replaceEdgeIfMatch(ArangoVertexCollectionAsync vertices, ArangoEdgeCollecti assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void replaceEdgeIfMatchFail(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -257,7 +258,7 @@ void replaceEdgeIfMatchFail(ArangoVertexCollectionAsync vertices, ArangoEdgeColl assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void updateEdge(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -285,7 +286,7 @@ void updateEdge(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void updateEdgeUpdateRev(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -299,7 +300,7 @@ void updateEdgeUpdateRev(ArangoVertexCollectionAsync vertices, ArangoEdgeCollect .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void updateEdgeIfMatch(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -328,7 +329,7 @@ void updateEdgeIfMatch(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectio assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void updateEdgeIfMatchFail(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -346,7 +347,7 @@ void updateEdgeIfMatchFail(ArangoVertexCollectionAsync vertices, ArangoEdgeColle assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void updateEdgeKeepNullTrue(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -368,7 +369,7 @@ void updateEdgeKeepNullTrue(ArangoVertexCollectionAsync vertices, ArangoEdgeColl assertThat(readResult.getProperties()).containsKey("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void updateEdgeKeepNullFalse(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -391,7 +392,7 @@ void updateEdgeKeepNullFalse(ArangoVertexCollectionAsync vertices, ArangoEdgeCol assertThat(readResult.getProperties().keySet()).doesNotContain("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void deleteEdge(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -402,7 +403,7 @@ void deleteEdge(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync assertThat(edge).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void deleteEdgeIfMatch(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -414,7 +415,7 @@ void deleteEdgeIfMatch(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectio assertThat(edge).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void deleteEdgeIfMatchFail(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -427,7 +428,7 @@ void deleteEdgeIfMatchFail(ArangoVertexCollectionAsync vertices, ArangoEdgeColle assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("asyncArgs") void edgeKeyWithSpecialChars(ArangoVertexCollectionAsync vertices, ArangoEdgeCollectionAsync edges) throws ExecutionException, InterruptedException { final BaseEdgeDocument value = createEdgeValue(vertices); diff --git a/driver/src/test/java/com/arangodb/ArangoEdgeCollectionTest.java b/driver/src/test/java/com/arangodb/ArangoEdgeCollectionTest.java index 1beb4d9ac..7f946b6f3 100644 --- a/driver/src/test/java/com/arangodb/ArangoEdgeCollectionTest.java +++ b/driver/src/test/java/com/arangodb/ArangoEdgeCollectionTest.java @@ -23,12 +23,14 @@ import com.arangodb.entity.*; import com.arangodb.model.*; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Named; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import java.util.Arrays; import java.util.Collections; +import java.util.Optional; import java.util.UUID; import java.util.stream.Stream; @@ -48,9 +50,9 @@ class ArangoEdgeCollectionTest extends BaseJunit5 { private static Stream args() { return dbsStream() - .map(db -> new Object[]{ - db.graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_NAME), - db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME) + .map(it -> new Object[]{ + Named.of(it.getName(), it.getPayload().graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_NAME)), + Named.of(it.getName(), it.getPayload().graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION_NAME)) }) .map(Arguments::of); } @@ -80,7 +82,7 @@ private BaseEdgeDocument createEdgeValue(ArangoVertexCollection vertices) { return value; } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void insertEdge(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -93,7 +95,7 @@ void insertEdge(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { assertThat(document.getTo()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void insertEdgeUpdateRev(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -102,7 +104,7 @@ void insertEdgeUpdateRev(ArangoVertexCollection vertices, ArangoEdgeCollection e assertThat(edge.getRev()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void insertEdgeViolatingUniqueConstraint(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { edges.graph().db().collection(EDGE_COLLECTION_NAME) @@ -119,7 +121,7 @@ void insertEdgeViolatingUniqueConstraint(ArangoVertexCollection vertices, Arango } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void getEdge(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -132,7 +134,7 @@ void getEdge(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { assertThat(document.getTo()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void getEdgeIfMatch(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -144,7 +146,7 @@ void getEdgeIfMatch(ArangoVertexCollection vertices, ArangoEdgeCollection edges) assertThat(document.getKey()).isEqualTo(edge.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void getEdgeIfMatchFail(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -155,7 +157,7 @@ void getEdgeIfMatchFail(ArangoVertexCollection vertices, ArangoEdgeCollection ed assertThat(edge2).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void getEdgeIfNoneMatch(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -167,7 +169,7 @@ void getEdgeIfNoneMatch(ArangoVertexCollection vertices, ArangoEdgeCollection ed assertThat(document.getKey()).isEqualTo(edge.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void getEdgeIfNoneMatchFail(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument value = createEdgeValue(vertices); @@ -178,7 +180,7 @@ void getEdgeIfNoneMatchFail(ArangoVertexCollection vertices, ArangoEdgeCollectio assertThat(edge2).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void replaceEdge(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -202,7 +204,7 @@ void replaceEdge(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void replaceEdgeUpdateRev(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -216,7 +218,7 @@ void replaceEdgeUpdateRev(ArangoVertexCollection vertices, ArangoEdgeCollection .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void replaceEdgeIfMatch(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -241,7 +243,7 @@ void replaceEdgeIfMatch(ArangoVertexCollection vertices, ArangoEdgeCollection ed assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void replaceEdgeIfMatchFail(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -257,7 +259,7 @@ void replaceEdgeIfMatchFail(ArangoVertexCollection vertices, ArangoEdgeCollectio assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void updateEdge(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -285,7 +287,7 @@ void updateEdge(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void updateEdgeUpdateRev(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -299,7 +301,7 @@ void updateEdgeUpdateRev(ArangoVertexCollection vertices, ArangoEdgeCollection e .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void updateEdgeIfMatch(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -328,7 +330,7 @@ void updateEdgeIfMatch(ArangoVertexCollection vertices, ArangoEdgeCollection edg assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void updateEdgeIfMatchFail(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -346,7 +348,7 @@ void updateEdgeIfMatchFail(ArangoVertexCollection vertices, ArangoEdgeCollection assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void updateEdgeKeepNullTrue(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -368,7 +370,7 @@ void updateEdgeKeepNullTrue(ArangoVertexCollection vertices, ArangoEdgeCollectio assertThat(readResult.getProperties()).containsKey("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void updateEdgeKeepNullFalse(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -391,7 +393,7 @@ void updateEdgeKeepNullFalse(ArangoVertexCollection vertices, ArangoEdgeCollecti assertThat(readResult.getProperties().keySet()).doesNotContain("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void deleteEdge(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -402,7 +404,7 @@ void deleteEdge(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { assertThat(edge).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void deleteEdgeIfMatch(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -414,7 +416,7 @@ void deleteEdgeIfMatch(ArangoVertexCollection vertices, ArangoEdgeCollection edg assertThat(edge).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void deleteEdgeIfMatchFail(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument doc = createEdgeValue(vertices); @@ -427,7 +429,7 @@ void deleteEdgeIfMatchFail(ArangoVertexCollection vertices, ArangoEdgeCollection assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest(name = "{1}") @MethodSource("args") void edgeKeyWithSpecialChars(ArangoVertexCollection vertices, ArangoEdgeCollection edges) { final BaseEdgeDocument value = createEdgeValue(vertices); diff --git a/driver/src/test/java/com/arangodb/ArangoGraphAsyncTest.java b/driver/src/test/java/com/arangodb/ArangoGraphAsyncTest.java index 28847e6b5..ecda8505f 100644 --- a/driver/src/test/java/com/arangodb/ArangoGraphAsyncTest.java +++ b/driver/src/test/java/com/arangodb/ArangoGraphAsyncTest.java @@ -70,7 +70,7 @@ class ArangoGraphAsyncTest extends BaseJunit5 { private static Stream asyncGraphs() { return asyncDbsStream() - .map(db -> db.graph(GRAPH_NAME)) + .map(mapNamedPayload(db -> db.graph(GRAPH_NAME))) .map(Arguments::of); } @@ -86,14 +86,14 @@ static void init() { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncGraphs") void exists(ArangoGraphAsync graph) throws ExecutionException, InterruptedException { assertThat(graph.exists().get()).isTrue(); assertThat(graph.db().graph(GRAPH_NAME + "no").exists().get()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createWithReplicationAndWriteConcern(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -109,14 +109,14 @@ void createWithReplicationAndWriteConcern(ArangoDatabaseAsync db) throws Executi db.graph(GRAPH_NAME + "_1").drop().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getGraphs(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final Collection graphs = db.getGraphs().get(); assertThat(graphs.stream().anyMatch(it -> it.getName().equals(GRAPH_NAME))).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncGraphs") void getInfo(ArangoGraphAsync graph) throws ExecutionException, InterruptedException { final GraphEntity info = graph.getInfo().get(); @@ -147,7 +147,7 @@ void getInfo(ArangoGraphAsync graph) throws ExecutionException, InterruptedExcep } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncGraphs") void getVertexCollections(ArangoGraphAsync graph) throws ExecutionException, InterruptedException { final Collection vertexCollections = graph.getVertexCollections().get(); @@ -156,7 +156,7 @@ void getVertexCollections(ArangoGraphAsync graph) throws ExecutionException, Int .contains(VERTEX_COL_1, VERTEX_COL_2, VERTEX_COL_3, VERTEX_COL_5); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncGraphs") void addVertexCollection(ArangoGraphAsync graph) throws ExecutionException, InterruptedException { final GraphEntity g = graph.addVertexCollection(VERTEX_COL_4).get(); @@ -168,7 +168,7 @@ void addVertexCollection(ArangoGraphAsync graph) throws ExecutionException, Inte graph.vertexCollection(VERTEX_COL_4).remove().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void addSatelliteVertexCollection(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isCluster() || isAtLeastVersion(3, 10)); @@ -189,7 +189,7 @@ void addSatelliteVertexCollection(ArangoDatabaseAsync db) throws ExecutionExcept g.drop().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncGraphs") void getEdgeCollections(ArangoGraphAsync graph) throws ExecutionException, InterruptedException { final Collection edgeCollections = graph.getEdgeDefinitions().get(); @@ -198,7 +198,7 @@ void getEdgeCollections(ArangoGraphAsync graph) throws ExecutionException, Inter .contains(EDGE_COL_1, EDGE_COL_2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncGraphs") void addEdgeDefinition(ArangoGraphAsync graph) throws ExecutionException, InterruptedException { EdgeDefinition ed = new EdgeDefinition().collection(EDGE_COL_3).from(VERTEX_COL_1).to(VERTEX_COL_2); @@ -229,7 +229,7 @@ void addEdgeDefinition(ArangoGraphAsync graph) throws ExecutionException, Interr graph.edgeCollection(EDGE_COL_3).remove().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void addSatelliteEdgeDefinition(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isCluster() || isAtLeastVersion(3, 10)); @@ -259,7 +259,7 @@ void addSatelliteEdgeDefinition(ArangoDatabaseAsync db) throws ExecutionExceptio g.drop().get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncGraphs") void replaceEdgeDefinition(ArangoGraphAsync graph) throws ExecutionException, InterruptedException { final GraphEntity g = graph @@ -287,7 +287,7 @@ void replaceEdgeDefinition(ArangoGraphAsync graph) throws ExecutionException, In graph.addEdgeDefinition(ed1).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncGraphs") @Disabled // FIXME: with dropCollections=true the vertex collections remain in the graph as orphan and not dropped @@ -318,7 +318,7 @@ void replaceEdgeDefinitionDropCollections(ArangoGraphAsync graph) throws Executi graph.addEdgeDefinition(ed1).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncGraphs") void removeEdgeDefinition(ArangoGraphAsync graph) throws ExecutionException, InterruptedException { graph.edgeCollection(EDGE_COL_1).remove().get(); @@ -331,7 +331,7 @@ void removeEdgeDefinition(ArangoGraphAsync graph) throws ExecutionException, Int graph.addEdgeDefinition(ed1).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncGraphs") void removeEdgeDefinitionDropCollections(ArangoGraphAsync graph) throws ExecutionException, InterruptedException { graph.edgeCollection(EDGE_COL_1).remove(new EdgeCollectionRemoveOptions() @@ -346,7 +346,7 @@ void removeEdgeDefinitionDropCollections(ArangoGraphAsync graph) throws Executio graph.addEdgeDefinition(ed1).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void smartGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isEnterprise()); @@ -365,7 +365,7 @@ void smartGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedEx assertThat(g.getNumberOfShards()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void hybridSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isEnterprise()); @@ -393,7 +393,7 @@ void hybridSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, Interru assertThat(db.collection(v2Name).getProperties().get().getReplicationFactor().get()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void disjointSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isEnterprise()); @@ -414,7 +414,7 @@ void disjointSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, Inter assertThat(g.getNumberOfShards()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void hybridDisjointSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isEnterprise()); @@ -442,7 +442,7 @@ void hybridDisjointSmartGraph(ArangoDatabaseAsync db) throws ExecutionException, assertThat(db.collection(v2Name).getProperties().get().getReplicationFactor().get()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void enterpriseGraph(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isEnterprise()); @@ -464,7 +464,7 @@ void enterpriseGraph(ArangoDatabaseAsync db) throws ExecutionException, Interrup } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void drop(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final String edgeCollection = "edge_" + rnd(); @@ -478,7 +478,7 @@ void drop(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExceptio assertThat(db.collection(vertexCollection).exists().get()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void dropPlusDropCollections(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { final String edgeCollection = "edge_dropC" + rnd(); diff --git a/driver/src/test/java/com/arangodb/ArangoGraphTest.java b/driver/src/test/java/com/arangodb/ArangoGraphTest.java index 84e8984ee..730db4e10 100644 --- a/driver/src/test/java/com/arangodb/ArangoGraphTest.java +++ b/driver/src/test/java/com/arangodb/ArangoGraphTest.java @@ -66,7 +66,7 @@ class ArangoGraphTest extends BaseJunit5 { private static Stream graphs() { return dbsStream() - .map(db -> db.graph(GRAPH_NAME)) + .map(mapNamedPayload(db -> db.graph(GRAPH_NAME))) .map(Arguments::of); } @@ -82,14 +82,14 @@ static void init() { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("graphs") void exists(ArangoGraph graph) { assertThat(graph.exists()).isTrue(); assertThat(graph.db().graph(GRAPH_NAME + "no").exists()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createWithReplicationAndWriteConcern(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -105,14 +105,14 @@ void createWithReplicationAndWriteConcern(ArangoDatabase db) { db.graph(GRAPH_NAME + "_1").drop(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getGraphs(ArangoDatabase db) { final Collection graphs = db.getGraphs(); assertThat(graphs.stream().anyMatch(it -> it.getName().equals(GRAPH_NAME))).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("graphs") void getInfo(ArangoGraph graph) { final GraphEntity info = graph.getInfo(); @@ -143,7 +143,7 @@ void getInfo(ArangoGraph graph) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("graphs") void getVertexCollections(ArangoGraph graph) { final Collection vertexCollections = graph.getVertexCollections(); @@ -152,7 +152,7 @@ void getVertexCollections(ArangoGraph graph) { .contains(VERTEX_COL_1, VERTEX_COL_2, VERTEX_COL_3, VERTEX_COL_5); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("graphs") void addVertexCollection(ArangoGraph graph) { final GraphEntity g = graph.addVertexCollection(VERTEX_COL_4); @@ -164,7 +164,7 @@ void addVertexCollection(ArangoGraph graph) { graph.vertexCollection(VERTEX_COL_4).remove(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void addSatelliteVertexCollection(ArangoDatabase db) { assumeTrue(isCluster() || isAtLeastVersion(3, 10)); @@ -185,7 +185,7 @@ void addSatelliteVertexCollection(ArangoDatabase db) { g.drop(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("graphs") void getEdgeCollections(ArangoGraph graph) { final Collection edgeCollections = graph.getEdgeDefinitions(); @@ -194,7 +194,7 @@ void getEdgeCollections(ArangoGraph graph) { .contains(EDGE_COL_1, EDGE_COL_2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("graphs") void addEdgeDefinition(ArangoGraph graph) { EdgeDefinition ed = new EdgeDefinition().collection(EDGE_COL_3).from(VERTEX_COL_1).to(VERTEX_COL_2); @@ -225,7 +225,7 @@ void addEdgeDefinition(ArangoGraph graph) { graph.edgeCollection(EDGE_COL_3).remove(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void addSatelliteEdgeDefinition(ArangoDatabase db) { assumeTrue(isCluster() || isAtLeastVersion(3, 10)); @@ -255,7 +255,7 @@ void addSatelliteEdgeDefinition(ArangoDatabase db) { g.drop(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("graphs") void replaceEdgeDefinition(ArangoGraph graph) { final GraphEntity g = graph @@ -283,7 +283,7 @@ void replaceEdgeDefinition(ArangoGraph graph) { graph.addEdgeDefinition(ed1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("graphs") @Disabled // FIXME: with dropCollections=true the vertex collections remain in the graph as orphan and not dropped @@ -314,7 +314,7 @@ void replaceEdgeDefinitionDropCollections(ArangoGraph graph) { graph.addEdgeDefinition(ed1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("graphs") void removeEdgeDefinition(ArangoGraph graph) { graph.edgeCollection(EDGE_COL_1).remove(); @@ -327,7 +327,7 @@ void removeEdgeDefinition(ArangoGraph graph) { graph.addEdgeDefinition(ed1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("graphs") void removeEdgeDefinitionDropCollections(ArangoGraph graph) { graph.edgeCollection(EDGE_COL_1).remove(new EdgeCollectionRemoveOptions() @@ -342,7 +342,7 @@ void removeEdgeDefinitionDropCollections(ArangoGraph graph) { graph.addEdgeDefinition(ed1); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void smartGraph(ArangoDatabase db) { assumeTrue(isEnterprise()); @@ -361,7 +361,7 @@ void smartGraph(ArangoDatabase db) { assertThat(g.getNumberOfShards()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void hybridSmartGraph(ArangoDatabase db) { assumeTrue(isEnterprise()); @@ -389,7 +389,7 @@ void hybridSmartGraph(ArangoDatabase db) { assertThat(db.collection(v2Name).getProperties().getReplicationFactor().get()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void disjointSmartGraph(ArangoDatabase db) { assumeTrue(isEnterprise()); @@ -410,7 +410,7 @@ void disjointSmartGraph(ArangoDatabase db) { assertThat(g.getNumberOfShards()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void hybridDisjointSmartGraph(ArangoDatabase db) { assumeTrue(isEnterprise()); @@ -438,7 +438,7 @@ void hybridDisjointSmartGraph(ArangoDatabase db) { assertThat(db.collection(v2Name).getProperties().getReplicationFactor().get()).isEqualTo(2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void enterpriseGraph(ArangoDatabase db) { assumeTrue(isEnterprise()); @@ -460,7 +460,7 @@ void enterpriseGraph(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void drop(ArangoDatabase db) { final String edgeCollection = "edge_" + rnd(); @@ -474,7 +474,7 @@ void drop(ArangoDatabase db) { assertThat(db.collection(vertexCollection).exists()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void dropPlusDropCollections(ArangoDatabase db) { final String edgeCollection = "edge_dropC" + rnd(); diff --git a/driver/src/test/java/com/arangodb/ArangoSearchAsyncTest.java b/driver/src/test/java/com/arangodb/ArangoSearchAsyncTest.java index d8a586ce3..39aa7ca2e 100644 --- a/driver/src/test/java/com/arangodb/ArangoSearchAsyncTest.java +++ b/driver/src/test/java/com/arangodb/ArangoSearchAsyncTest.java @@ -52,7 +52,7 @@ static void init() { initCollections(COLL_1, COLL_2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void exists(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -61,7 +61,7 @@ void exists(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcept assertThat(db.arangoSearch(viewName).exists().get()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createAndExistsSearchAlias(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -70,7 +70,7 @@ void createAndExistsSearchAlias(ArangoDatabaseAsync db) throws ExecutionExceptio assertThat(db.arangoSearch(viewName).exists().get()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -83,7 +83,7 @@ void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcep assertThat(info.getType()).isEqualTo(ViewType.ARANGO_SEARCH); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void drop(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -94,7 +94,7 @@ void drop(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExceptio assertThat(view.exists().get()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void rename(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -107,7 +107,7 @@ void rename(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcept assertThat(db.arangoSearch(viewName).exists().get()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createArangoSearchView(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -120,7 +120,7 @@ void createArangoSearchView(ArangoDatabaseAsync db) throws ExecutionException, I assertThat(db.arangoSearch(viewName).exists().get()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createSearchAliasView(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -133,7 +133,7 @@ void createSearchAliasView(ArangoDatabaseAsync db) throws ExecutionException, In assertThat(db.searchAlias(viewName).exists().get()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createArangoSearchViewWithOptions(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -147,7 +147,7 @@ void createArangoSearchViewWithOptions(ArangoDatabaseAsync db) throws ExecutionE assertThat(db.arangoSearch(viewName).exists().get()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createArangoSearchViewWithPrimarySort(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -183,7 +183,7 @@ void createArangoSearchViewWithPrimarySort(ArangoDatabaseAsync db) throws Execut } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createArangoSearchViewWithCommitIntervalMsec(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -204,7 +204,7 @@ void createArangoSearchViewWithCommitIntervalMsec(ArangoDatabaseAsync db) throws assertThat(properties.getCommitIntervalMsec()).isEqualTo(666666L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createSearchAliasViewWithOptions(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -218,7 +218,7 @@ void createSearchAliasViewWithOptions(ArangoDatabaseAsync db) throws ExecutionEx assertThat(db.searchAlias(viewName).exists().get()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createSearchAliasViewWithIndexesAndGetProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -257,7 +257,7 @@ void createSearchAliasViewWithIndexesAndGetProperties(ArangoDatabaseAsync db) th .anyMatch(i -> i.getCollection().equals(COLL_1) && i.getIndex().equals(idxName1)); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -277,7 +277,7 @@ void getArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionExcep assertThat(links).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void updateArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -310,7 +310,7 @@ void updateArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionEx assertThat(next.getStoreValues()).isEqualTo(StoreValuesType.ID); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void updateSearchAliasViewWithIndexesAndGetProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -350,7 +350,7 @@ void updateSearchAliasViewWithIndexesAndGetProperties(ArangoDatabaseAsync db) th .anyMatch(i -> i.getCollection().equals(COLL_2) && i.getIndex().equals(idxName2)); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void replaceArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -369,7 +369,7 @@ void replaceArangoSearchViewProperties(ArangoDatabaseAsync db) throws ExecutionE assertThat(link.getFields().iterator().next().getName()).isEqualTo("value"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void replaceSearchAliasViewWithIndexesAndGetProperties(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -440,7 +440,7 @@ private void createGetAndDeleteTypedAnalyzer(ArangoDatabaseAsync db, SearchAnaly assertThat(e.getErrorNum()).isEqualTo(1202); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void identityAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -459,7 +459,7 @@ void identityAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, In createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void delimiterAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -482,7 +482,7 @@ void delimiterAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, I createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void stemAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -505,7 +505,7 @@ void stemAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, Interr createGetAndDeleteTypedAnalyzer(db, options); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void normAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -530,7 +530,7 @@ void normAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, Interr createGetAndDeleteTypedAnalyzer(db, options); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void ngramAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -556,7 +556,7 @@ void ngramAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, Inter createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void enhancedNgramAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 6)); @@ -584,7 +584,7 @@ void enhancedNgramAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionExceptio createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void textAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 5)); @@ -611,7 +611,7 @@ void textAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, Interr createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void enhancedTextAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 6)); @@ -643,7 +643,7 @@ void enhancedTextAnalyzerTyped(ArangoDatabaseAsync db) throws ExecutionException createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void arangoSearchOptions(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 4)); @@ -723,7 +723,7 @@ void arangoSearchOptions(ArangoDatabaseAsync db) throws ExecutionException, Inte } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void pipelineAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -768,7 +768,7 @@ void pipelineAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interru createGetAndDeleteTypedAnalyzer(db, pipelineAnalyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void stopwordsAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -800,7 +800,7 @@ void stopwordsAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interr db.deleteSearchAnalyzer(name).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void aqlAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -826,7 +826,7 @@ void aqlAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedE createGetAndDeleteTypedAnalyzer(db, aqlAnalyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void geoJsonAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -854,7 +854,7 @@ void geoJsonAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interrup } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void geoS2Analyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isEnterprise()); @@ -884,7 +884,7 @@ void geoS2Analyzer(ArangoDatabaseAsync db) throws ExecutionException, Interrupte } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void geoPointAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 8)); @@ -913,7 +913,7 @@ void geoPointAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interru } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void segmentationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 9)); @@ -935,7 +935,7 @@ void segmentationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Int createGetAndDeleteTypedAnalyzer(db, segmentationAnalyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void collationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 9)); @@ -957,7 +957,7 @@ void collationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interr } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void classificationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -981,7 +981,7 @@ void classificationAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, I createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void nearestNeighborsAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -1004,7 +1004,7 @@ void nearestNeighborsAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void MinHashAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -1034,7 +1034,7 @@ void MinHashAnalyzer(ArangoDatabaseAsync db) throws ExecutionException, Interrup createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void offsetFeature(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); diff --git a/driver/src/test/java/com/arangodb/ArangoSearchTest.java b/driver/src/test/java/com/arangodb/ArangoSearchTest.java index d88afb212..a4216477b 100644 --- a/driver/src/test/java/com/arangodb/ArangoSearchTest.java +++ b/driver/src/test/java/com/arangodb/ArangoSearchTest.java @@ -51,7 +51,7 @@ static void init() { initCollections(COLL_1, COLL_2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void exists(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -60,7 +60,7 @@ void exists(ArangoDatabase db) { assertThat(db.arangoSearch(viewName).exists()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createAndExistsSearchAlias(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -69,7 +69,7 @@ void createAndExistsSearchAlias(ArangoDatabase db) { assertThat(db.arangoSearch(viewName).exists()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getInfo(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -82,7 +82,7 @@ void getInfo(ArangoDatabase db) { assertThat(info.getType()).isEqualTo(ViewType.ARANGO_SEARCH); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void drop(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -93,7 +93,7 @@ void drop(ArangoDatabase db) { assertThat(view.exists()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void rename(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -106,7 +106,7 @@ void rename(ArangoDatabase db) { assertThat(db.arangoSearch(viewName).exists()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createArangoSearchView(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -119,7 +119,7 @@ void createArangoSearchView(ArangoDatabase db) { assertThat(db.arangoSearch(viewName).exists()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createSearchAliasView(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -132,7 +132,7 @@ void createSearchAliasView(ArangoDatabase db) { assertThat(db.searchAlias(viewName).exists()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createArangoSearchViewWithOptions(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -146,7 +146,7 @@ void createArangoSearchViewWithOptions(ArangoDatabase db) { assertThat(db.arangoSearch(viewName).exists()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createArangoSearchViewWithPrimarySort(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -182,7 +182,7 @@ void createArangoSearchViewWithPrimarySort(ArangoDatabase db) { } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createArangoSearchViewWithCommitIntervalMsec(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -203,7 +203,7 @@ void createArangoSearchViewWithCommitIntervalMsec(ArangoDatabase db) { assertThat(properties.getCommitIntervalMsec()).isEqualTo(666666L); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createSearchAliasViewWithOptions(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -217,7 +217,7 @@ void createSearchAliasViewWithOptions(ArangoDatabase db) { assertThat(db.searchAlias(viewName).exists()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -256,7 +256,7 @@ void createSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) { .anyMatch(i -> i.getCollection().equals(COLL_1) && i.getIndex().equals(idxName1)); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getArangoSearchViewProperties(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -276,7 +276,7 @@ void getArangoSearchViewProperties(ArangoDatabase db) { assertThat(links).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void updateArangoSearchViewProperties(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -309,7 +309,7 @@ void updateArangoSearchViewProperties(ArangoDatabase db) { assertThat(next.getStoreValues()).isEqualTo(StoreValuesType.ID); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void updateSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -349,7 +349,7 @@ void updateSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) { .anyMatch(i -> i.getCollection().equals(COLL_2) && i.getIndex().equals(idxName2)); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void replaceArangoSearchViewProperties(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -368,7 +368,7 @@ void replaceArangoSearchViewProperties(ArangoDatabase db) { assertThat(link.getFields().iterator().next().getName()).isEqualTo("value"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void replaceSearchAliasViewWithIndexesAndGetProperties(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -439,7 +439,7 @@ private void createGetAndDeleteTypedAnalyzer(ArangoDatabase db, SearchAnalyzer a assertThat(e.getErrorNum()).isEqualTo(1202); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void identityAnalyzerTyped(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -458,7 +458,7 @@ void identityAnalyzerTyped(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void delimiterAnalyzerTyped(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -481,7 +481,7 @@ void delimiterAnalyzerTyped(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void stemAnalyzerTyped(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -504,7 +504,7 @@ void stemAnalyzerTyped(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, options); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void normAnalyzerTyped(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -529,7 +529,7 @@ void normAnalyzerTyped(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, options); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void ngramAnalyzerTyped(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -555,7 +555,7 @@ void ngramAnalyzerTyped(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void enhancedNgramAnalyzerTyped(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 6)); @@ -583,7 +583,7 @@ void enhancedNgramAnalyzerTyped(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void textAnalyzerTyped(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 5)); @@ -610,7 +610,7 @@ void textAnalyzerTyped(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void enhancedTextAnalyzerTyped(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 6)); @@ -642,7 +642,7 @@ void enhancedTextAnalyzerTyped(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void arangoSearchOptions(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 4)); @@ -722,7 +722,7 @@ void arangoSearchOptions(ArangoDatabase db) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void pipelineAnalyzer(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 8)); @@ -767,7 +767,7 @@ void pipelineAnalyzer(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, pipelineAnalyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void stopwordsAnalyzer(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 8)); @@ -799,7 +799,7 @@ void stopwordsAnalyzer(ArangoDatabase db) { db.deleteSearchAnalyzer(name); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void aqlAnalyzer(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 8)); @@ -825,7 +825,7 @@ void aqlAnalyzer(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, aqlAnalyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void geoJsonAnalyzer(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 8)); @@ -853,7 +853,7 @@ void geoJsonAnalyzer(ArangoDatabase db) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void geoS2Analyzer(ArangoDatabase db) { assumeTrue(isEnterprise()); @@ -883,7 +883,7 @@ void geoS2Analyzer(ArangoDatabase db) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void geoPointAnalyzer(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 8)); @@ -912,7 +912,7 @@ void geoPointAnalyzer(ArangoDatabase db) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void segmentationAnalyzer(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 9)); @@ -934,7 +934,7 @@ void segmentationAnalyzer(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, segmentationAnalyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void collationAnalyzer(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 9)); @@ -956,7 +956,7 @@ void collationAnalyzer(ArangoDatabase db) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void classificationAnalyzer(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -980,7 +980,7 @@ void classificationAnalyzer(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void nearestNeighborsAnalyzer(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -1003,7 +1003,7 @@ void nearestNeighborsAnalyzer(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void MinHashAnalyzer(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -1033,7 +1033,7 @@ void MinHashAnalyzer(ArangoDatabase db) { createGetAndDeleteTypedAnalyzer(db, analyzer); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void offsetFeature(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); diff --git a/driver/src/test/java/com/arangodb/ArangoVertexCollectionAsyncTest.java b/driver/src/test/java/com/arangodb/ArangoVertexCollectionAsyncTest.java index 2aa2acb2d..f7fc0bee8 100644 --- a/driver/src/test/java/com/arangodb/ArangoVertexCollectionAsyncTest.java +++ b/driver/src/test/java/com/arangodb/ArangoVertexCollectionAsyncTest.java @@ -51,7 +51,7 @@ class ArangoVertexCollectionAsyncTest extends BaseJunit5 { private static Stream asyncVertices() { return asyncDbsStream() - .map(db -> db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)) + .map(mapNamedPayload(db -> db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME))) .map(Arguments::of); } @@ -65,7 +65,7 @@ static void init() { ); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void dropVertexCollection(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { ArangoGraphAsync graph = vertices.graph(); @@ -78,7 +78,7 @@ void dropVertexCollection(ArangoVertexCollectionAsync vertices) throws Execution graph.addVertexCollection(COLLECTION_NAME).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void dropVertexCollectionDropCollectionTrue(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { ArangoGraphAsync graph = vertices.graph(); @@ -92,7 +92,7 @@ void dropVertexCollectionDropCollectionTrue(ArangoVertexCollectionAsync vertices graph.addVertexCollection(COLLECTION_NAME).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void insertVertex(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final VertexEntity vertex = vertices @@ -105,7 +105,7 @@ void insertVertex(ArangoVertexCollectionAsync vertices) throws ExecutionExceptio assertThat(document.getKey()).isEqualTo(vertex.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void insertVertexViolatingUniqueConstraint(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { ArangoCollectionAsync collection = vertices.graph().db().collection(vertices.name()); @@ -125,7 +125,7 @@ void insertVertexViolatingUniqueConstraint(ArangoVertexCollectionAsync vertices) vertices.deleteVertex(inserted.getKey()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void duplicateInsertSameObjectVertex(ArangoVertexCollectionAsync vertices) { @@ -148,7 +148,7 @@ void duplicateInsertSameObjectVertex(ArangoVertexCollectionAsync vertices) { vertices.insertVertex(bd2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void insertVertexUpdateRev(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -157,7 +157,7 @@ void insertVertexUpdateRev(ArangoVertexCollectionAsync vertices) throws Executio assertThat(vertex.getRev()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void getVertex(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final VertexEntity vertex = vertices @@ -168,7 +168,7 @@ void getVertex(ArangoVertexCollectionAsync vertices) throws ExecutionException, assertThat(document.getKey()).isEqualTo(vertex.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void getVertexIfMatch(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final VertexEntity vertex = vertices @@ -180,7 +180,7 @@ void getVertexIfMatch(ArangoVertexCollectionAsync vertices) throws ExecutionExce assertThat(document.getKey()).isEqualTo(vertex.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void getVertexIfMatchFail(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final VertexEntity vertex = vertices @@ -191,7 +191,7 @@ void getVertexIfMatchFail(ArangoVertexCollectionAsync vertices) throws Execution assertThat(vertex2).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void getVertexIfNoneMatch(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final VertexEntity vertex = vertices @@ -203,7 +203,7 @@ void getVertexIfNoneMatch(ArangoVertexCollectionAsync vertices) throws Execution assertThat(document.getKey()).isEqualTo(vertex.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void getVertexIfNoneMatchFail(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final VertexEntity vertex = vertices @@ -214,7 +214,7 @@ void getVertexIfNoneMatchFail(ArangoVertexCollectionAsync vertices) throws Execu assertThat(vertex2).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void replaceVertex(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -239,7 +239,7 @@ void replaceVertex(ArangoVertexCollectionAsync vertices) throws ExecutionExcepti assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void replaceVertexUpdateRev(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -254,7 +254,7 @@ void replaceVertexUpdateRev(ArangoVertexCollectionAsync vertices) throws Executi .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void replaceVertexIfMatch(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -280,7 +280,7 @@ void replaceVertexIfMatch(ArangoVertexCollectionAsync vertices) throws Execution assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void replaceVertexIfMatchFail(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -297,7 +297,7 @@ void replaceVertexIfMatchFail(ArangoVertexCollectionAsync vertices) throws Execu assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void updateVertex(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -326,7 +326,7 @@ void updateVertex(ArangoVertexCollectionAsync vertices) throws ExecutionExceptio assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void updateVertexUpdateRev(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -342,7 +342,7 @@ void updateVertexUpdateRev(ArangoVertexCollectionAsync vertices) throws Executio .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void updateVertexIfMatch(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -372,7 +372,7 @@ void updateVertexIfMatch(ArangoVertexCollectionAsync vertices) throws ExecutionE assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void updateVertexIfMatchFail(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -392,7 +392,7 @@ void updateVertexIfMatchFail(ArangoVertexCollectionAsync vertices) throws Execut assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void updateVertexKeepNullTrue(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -415,7 +415,7 @@ void updateVertexKeepNullTrue(ArangoVertexCollectionAsync vertices) throws Execu assertThat(readResult.getProperties()).containsKey("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void updateVertexKeepNullFalse(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -439,7 +439,7 @@ void updateVertexKeepNullFalse(ArangoVertexCollectionAsync vertices) throws Exec assertThat(readResult.getProperties().keySet()).doesNotContain("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void deleteVertex(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -451,7 +451,7 @@ void deleteVertex(ArangoVertexCollectionAsync vertices) throws ExecutionExceptio assertThat(vertex).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void deleteVertexIfMatch(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -464,7 +464,7 @@ void deleteVertexIfMatch(ArangoVertexCollectionAsync vertices) throws ExecutionE assertThat(vertex).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void deleteVertexIfMatchFail(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -478,7 +478,7 @@ void deleteVertexIfMatchFail(ArangoVertexCollectionAsync vertices) throws Execut assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void vertexKeyWithSpecialChars(ArangoVertexCollectionAsync vertices) throws ExecutionException, InterruptedException { final String key = "_-:.@()+,=;$!*'%" + UUID.randomUUID(); diff --git a/driver/src/test/java/com/arangodb/ArangoVertexCollectionTest.java b/driver/src/test/java/com/arangodb/ArangoVertexCollectionTest.java index 39a2ee209..301c6478c 100644 --- a/driver/src/test/java/com/arangodb/ArangoVertexCollectionTest.java +++ b/driver/src/test/java/com/arangodb/ArangoVertexCollectionTest.java @@ -51,7 +51,7 @@ class ArangoVertexCollectionTest extends BaseJunit5 { private static Stream vertices() { return dbsStream() - .map(db -> db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME)) + .map(mapNamedPayload(db -> db.graph(GRAPH_NAME).vertexCollection(COLLECTION_NAME))) .map(Arguments::of); } @@ -65,7 +65,7 @@ static void init() { ); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void dropVertexCollection(ArangoVertexCollection vertices) { ArangoGraph graph = vertices.graph(); @@ -78,7 +78,7 @@ void dropVertexCollection(ArangoVertexCollection vertices) { graph.addVertexCollection(COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void dropVertexCollectionDropCollectionTrue(ArangoVertexCollection vertices) { ArangoGraph graph = vertices.graph(); @@ -92,7 +92,7 @@ void dropVertexCollectionDropCollectionTrue(ArangoVertexCollection vertices) { graph.addVertexCollection(COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void insertVertex(ArangoVertexCollection vertices) { final VertexEntity vertex = vertices @@ -105,7 +105,7 @@ void insertVertex(ArangoVertexCollection vertices) { assertThat(document.getKey()).isEqualTo(vertex.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void insertVertexViolatingUniqueConstraint(ArangoVertexCollection vertices) { ArangoCollection collection = vertices.graph().db().collection(vertices.name()); @@ -126,7 +126,7 @@ void insertVertexViolatingUniqueConstraint(ArangoVertexCollection vertices) { vertices.deleteVertex(inserted.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void duplicateInsertSameObjectVertex(ArangoVertexCollection vertices) { @@ -149,7 +149,7 @@ void duplicateInsertSameObjectVertex(ArangoVertexCollection vertices) { vertices.insertVertex(bd2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void insertVertexUpdateRev(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -158,7 +158,7 @@ void insertVertexUpdateRev(ArangoVertexCollection vertices) { assertThat(vertex.getRev()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void getVertex(ArangoVertexCollection vertices) { final VertexEntity vertex = vertices @@ -169,7 +169,7 @@ void getVertex(ArangoVertexCollection vertices) { assertThat(document.getKey()).isEqualTo(vertex.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void getVertexIfMatch(ArangoVertexCollection vertices) { final VertexEntity vertex = vertices @@ -181,7 +181,7 @@ void getVertexIfMatch(ArangoVertexCollection vertices) { assertThat(document.getKey()).isEqualTo(vertex.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void getVertexIfMatchFail(ArangoVertexCollection vertices) { final VertexEntity vertex = vertices @@ -192,7 +192,7 @@ void getVertexIfMatchFail(ArangoVertexCollection vertices) { assertThat(vertex2).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void getVertexIfNoneMatch(ArangoVertexCollection vertices) { final VertexEntity vertex = vertices @@ -204,7 +204,7 @@ void getVertexIfNoneMatch(ArangoVertexCollection vertices) { assertThat(document.getKey()).isEqualTo(vertex.getKey()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void getVertexIfNoneMatchFail(ArangoVertexCollection vertices) { final VertexEntity vertex = vertices @@ -215,7 +215,7 @@ void getVertexIfNoneMatchFail(ArangoVertexCollection vertices) { assertThat(vertex2).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void replaceVertex(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -240,7 +240,7 @@ void replaceVertex(ArangoVertexCollection vertices) { assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void replaceVertexUpdateRev(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -255,7 +255,7 @@ void replaceVertexUpdateRev(ArangoVertexCollection vertices) { .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void replaceVertexIfMatch(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -281,7 +281,7 @@ void replaceVertexIfMatch(ArangoVertexCollection vertices) { assertThat(String.valueOf(readResult.getAttribute("b"))).isEqualTo("test"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void replaceVertexIfMatchFail(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -298,7 +298,7 @@ void replaceVertexIfMatchFail(ArangoVertexCollection vertices) { assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void updateVertex(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -327,7 +327,7 @@ void updateVertex(ArangoVertexCollection vertices) { assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void updateVertexUpdateRev(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -343,7 +343,7 @@ void updateVertexUpdateRev(ArangoVertexCollection vertices) { .isNotEqualTo(createResult.getRev()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void updateVertexIfMatch(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -373,7 +373,7 @@ void updateVertexIfMatch(ArangoVertexCollection vertices) { assertThat(readResult.getProperties()).containsKey("c"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void updateVertexIfMatchFail(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -393,7 +393,7 @@ void updateVertexIfMatchFail(ArangoVertexCollection vertices) { assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void updateVertexKeepNullTrue(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -416,7 +416,7 @@ void updateVertexKeepNullTrue(ArangoVertexCollection vertices) { assertThat(readResult.getProperties()).containsKey("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void updateVertexKeepNullFalse(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -440,7 +440,7 @@ void updateVertexKeepNullFalse(ArangoVertexCollection vertices) { assertThat(readResult.getProperties().keySet()).doesNotContain("a"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void deleteVertex(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -452,7 +452,7 @@ void deleteVertex(ArangoVertexCollection vertices) { assertThat(vertex).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void deleteVertexIfMatch(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -465,7 +465,7 @@ void deleteVertexIfMatch(ArangoVertexCollection vertices) { assertThat(vertex).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void deleteVertexIfMatchFail(ArangoVertexCollection vertices) { final BaseDocument doc = new BaseDocument(UUID.randomUUID().toString()); @@ -479,7 +479,7 @@ void deleteVertexIfMatchFail(ArangoVertexCollection vertices) { assertThat(e.getErrorNum()).isEqualTo(1200); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void vertexKeyWithSpecialChars(ArangoVertexCollection vertices) { final String key = "_-:.@()+,=;$!*'%" + UUID.randomUUID(); diff --git a/driver/src/test/java/com/arangodb/ArangoViewAsyncTest.java b/driver/src/test/java/com/arangodb/ArangoViewAsyncTest.java index d2d68759c..362d07447 100644 --- a/driver/src/test/java/com/arangodb/ArangoViewAsyncTest.java +++ b/driver/src/test/java/com/arangodb/ArangoViewAsyncTest.java @@ -45,7 +45,7 @@ static void init() { initDB(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void create(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { String name = rndName(); @@ -53,7 +53,7 @@ void create(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcept assertThat(db.view(name).exists().get()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createWithNotNormalizedName(ArangoDatabaseAsync db) { assumeTrue(supportsExtendedNames()); @@ -65,7 +65,7 @@ void createWithNotNormalizedName(ArangoDatabaseAsync db) { .extracting(it -> ((ArangoDBException) it).getResponseCode()).isEqualTo(400); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { String name = rndName(); @@ -77,7 +77,7 @@ void getInfo(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcep assertThat(info.getType()).isEqualTo(ViewType.ARANGO_SEARCH); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getInfoSearchAlias(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -90,7 +90,7 @@ void getInfoSearchAlias(ArangoDatabaseAsync db) throws ExecutionException, Inter assertThat(info.getType()).isEqualTo(ViewType.SEARCH_ALIAS); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getViews(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -102,7 +102,7 @@ void getViews(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExce assertThat(views).extracting(ViewEntity::getName).contains(name1, name2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void drop(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { String name = rndName(); @@ -112,7 +112,7 @@ void drop(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExceptio assertThat(view.exists().get()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void rename(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); diff --git a/driver/src/test/java/com/arangodb/ArangoViewTest.java b/driver/src/test/java/com/arangodb/ArangoViewTest.java index a4281c385..e296c54e6 100644 --- a/driver/src/test/java/com/arangodb/ArangoViewTest.java +++ b/driver/src/test/java/com/arangodb/ArangoViewTest.java @@ -45,7 +45,7 @@ static void init() { initDB(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void create(ArangoDatabase db) { String name = rndName(); @@ -53,7 +53,7 @@ void create(ArangoDatabase db) { assertThat(db.view(name).exists()).isTrue(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createWithNotNormalizedName(ArangoDatabase db) { assumeTrue(supportsExtendedNames()); @@ -65,7 +65,7 @@ void createWithNotNormalizedName(ArangoDatabase db) { .extracting(it -> ((ArangoDBException) it).getResponseCode()).isEqualTo(400); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getInfo(ArangoDatabase db) { String name = rndName(); @@ -77,7 +77,7 @@ void getInfo(ArangoDatabase db) { assertThat(info.getType()).isEqualTo(ViewType.ARANGO_SEARCH); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getInfoSearchAlias(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -90,7 +90,7 @@ void getInfoSearchAlias(ArangoDatabase db) { assertThat(info.getType()).isEqualTo(ViewType.SEARCH_ALIAS); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getViews(ArangoDatabase db) { assumeTrue(isAtLeastVersion(3, 10)); @@ -102,7 +102,7 @@ void getViews(ArangoDatabase db) { assertThat(views).extracting(ViewEntity::getName).contains(name1, name2); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void drop(ArangoDatabase db) { String name = rndName(); @@ -112,7 +112,7 @@ void drop(ArangoDatabase db) { assertThat(view.exists()).isFalse(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void rename(ArangoDatabase db) { assumeTrue(isSingleServer()); diff --git a/driver/src/test/java/com/arangodb/BaseJunit5.java b/driver/src/test/java/com/arangodb/BaseJunit5.java index a907cf2d1..800c45e55 100644 --- a/driver/src/test/java/com/arangodb/BaseJunit5.java +++ b/driver/src/test/java/com/arangodb/BaseJunit5.java @@ -8,39 +8,53 @@ import com.arangodb.util.TestUtils; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Named; import org.junit.jupiter.params.provider.Arguments; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; import java.util.stream.Stream; -class BaseJunit5 { - protected static final String TEST_DB = "java_driver_test_db"; +public class BaseJunit5 { + private static final String TEST_DB = "java_driver_test_db"; protected static final ArangoConfigProperties config = ConfigUtils.loadConfig(); - private static final List adbs = Arrays.asList( - new ArangoDB.Builder().loadProperties(config).protocol(Protocol.VST).build(), - new ArangoDB.Builder().loadProperties(config).protocol(Protocol.HTTP_VPACK).build(), - new ArangoDB.Builder().loadProperties(config).protocol(Protocol.HTTP_JSON).build(), - new ArangoDB.Builder().loadProperties(config).protocol(Protocol.HTTP2_VPACK).build(), - new ArangoDB.Builder().loadProperties(config).protocol(Protocol.HTTP2_JSON).build() - ); + private static final ArangoDB adb = new ArangoDB.Builder() + .loadProperties(config) + .protocol(Protocol.HTTP_JSON) + .build(); + + private static final ArangoDBVersion version = adb.getVersion(); + private static final ServerRole role = adb.getRole(); + + private static final List> adbs = Arrays.stream(Protocol.values()) + .filter(p -> !p.equals(Protocol.VST) || isLessThanVersion(3, 12)) + .map(p -> Named.of(p.toString(), new ArangoDB.Builder() + .loadProperties(config) + .protocol(p) + .build())) + .collect(Collectors.toList()); private static Boolean extendedDbNames; private static Boolean extendedNames; - protected static Stream adbsStream() { + protected static Stream> adbsStream() { return adbs.stream(); } - protected static Stream dbsStream() { - return adbsStream().map(adb -> adb.db(TEST_DB)); + + protected static Stream> dbsStream() { + return adbsStream().map(mapNamedPayload(p -> p.db(TEST_DB))); } - protected static Stream asyncAdbsStream() { - return adbs.stream().map(ArangoDB::async); + + protected static Stream> asyncAdbsStream() { + return adbs.stream().map(mapNamedPayload(ArangoDB::async)); } - protected static Stream asyncDbsStream() { - return asyncAdbsStream().map(adb -> adb.db(TEST_DB)); + + protected static Stream> asyncDbsStream() { + return asyncAdbsStream().map(mapNamedPayload(p -> p.db(TEST_DB))); } protected static Stream arangos() { @@ -59,8 +73,12 @@ protected static Stream asyncDbs() { return asyncDbsStream().map(Arguments::of); } + protected static Function, Named> mapNamedPayload(Function mapper) { + return named -> Named.of(named.getName(), mapper.apply(named.getPayload())); + } + static ArangoDatabase initDB(String name) { - ArangoDatabase database = adbs.get(0).db(name); + ArangoDatabase database = adb.db(name); if (!database.exists()) database.create(); return database; @@ -71,7 +89,7 @@ static ArangoDatabase initDB() { } static void dropDB(String name) { - ArangoDatabase database = adbs.get(0).db(name); + ArangoDatabase database = adb.db(name); if (database.exists()) database.drop(); } @@ -109,14 +127,18 @@ static void shutdown() { dropDB(TEST_DB); } - static String rnd() { + protected String getTestDb() { + return TEST_DB; + } + + public static String rnd() { return UUID.randomUUID().toString(); } - static synchronized boolean supportsExtendedDbNames() { + public static synchronized boolean supportsExtendedDbNames() { if (extendedDbNames == null) { try { - ArangoDatabase testDb = adbs.get(0) + ArangoDatabase testDb = adb .db("test-" + TestUtils.generateRandomName(true, 20)); testDb.create(); extendedDbNames = true; @@ -128,10 +150,10 @@ static synchronized boolean supportsExtendedDbNames() { return extendedDbNames; } - static synchronized boolean supportsExtendedNames() { + public static synchronized boolean supportsExtendedNames() { if (extendedNames == null) { try { - ArangoCollection testCol = adbs.get(0).db() + ArangoCollection testCol = adb.db() .collection("test-" + TestUtils.generateRandomName(true, 20)); testCol.create(); extendedNames = true; @@ -143,44 +165,44 @@ static synchronized boolean supportsExtendedNames() { return extendedNames; } - static String rndDbName() { + public static String rndDbName() { return "testDB-" + TestUtils.generateRandomName(supportsExtendedDbNames(), 20); } - static String rndName() { + public static String rndName() { return "dd-" + TestUtils.generateRandomName(supportsExtendedNames(), 20); } - boolean isAtLeastVersion(final int major, final int minor) { + public static boolean isAtLeastVersion(final int major, final int minor) { return isAtLeastVersion(major, minor, 0); } - boolean isAtLeastVersion(final int major, final int minor, final int patch) { - return TestUtils.isAtLeastVersion(adbs.get(0).getVersion().getVersion(), major, minor, patch); + public static boolean isAtLeastVersion(final int major, final int minor, final int patch) { + return TestUtils.isAtLeastVersion(version.getVersion(), major, minor, patch); } - boolean isLessThanVersion(final int major, final int minor) { + public static boolean isLessThanVersion(final int major, final int minor) { return isLessThanVersion(major, minor, 0); } - boolean isLessThanVersion(final int major, final int minor, final int patch) { - return TestUtils.isLessThanVersion(adbs.get(0).getVersion().getVersion(), major, minor, patch); + public static boolean isLessThanVersion(final int major, final int minor, final int patch) { + return TestUtils.isLessThanVersion(version.getVersion(), major, minor, patch); } - boolean isStorageEngine(ArangoDBEngine.StorageEngineName name) { - return name.equals(adbs.get(0).getEngine().getName()); + public static boolean isStorageEngine(ArangoDBEngine.StorageEngineName name) { + return name.equals(adb.getEngine().getName()); } - boolean isSingleServer() { - return adbs.get(0).getRole() == ServerRole.SINGLE; + public static boolean isSingleServer() { + return role == ServerRole.SINGLE; } - boolean isCluster() { - return adbs.get(0).getRole() == ServerRole.COORDINATOR; + public static boolean isCluster() { + return role == ServerRole.COORDINATOR; } - boolean isEnterprise() { - return adbs.get(0).getVersion().getLicense() == License.ENTERPRISE; + public static boolean isEnterprise() { + return version.getLicense() == License.ENTERPRISE; } } diff --git a/driver/src/test/java/com/arangodb/ConcurrencyAsyncTests.java b/driver/src/test/java/com/arangodb/ConcurrencyAsyncTests.java index 5c3988d33..c21d70a08 100644 --- a/driver/src/test/java/com/arangodb/ConcurrencyAsyncTests.java +++ b/driver/src/test/java/com/arangodb/ConcurrencyAsyncTests.java @@ -2,6 +2,7 @@ import com.arangodb.config.ConfigUtils; import com.arangodb.entity.ArangoDBVersion; +import com.arangodb.util.SlowTest; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; @@ -17,13 +18,17 @@ import java.util.stream.IntStream; import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assumptions.assumeTrue; class ConcurrencyAsyncTests { + @SlowTest @ParameterizedTest @EnumSource(Protocol.class) @Timeout(2) void executorLimit(Protocol protocol) { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ExecutorService asyncExecutor = Executors.newCachedThreadPool(); ArangoDBAsync adb = new ArangoDB.Builder() .loadProperties(ConfigUtils.loadConfig()) @@ -76,9 +81,12 @@ void outgoingRequestsParallelismTest(Protocol protocol) throws ExecutionExceptio adb.shutdown(); } + @SlowTest @ParameterizedTest @EnumSource(Protocol.class) void concurrentPendingRequests(Protocol protocol) throws ExecutionException, InterruptedException { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ArangoDBAsync adb = new ArangoDB.Builder() .loadProperties(ConfigUtils.loadConfig()) .protocol(protocol).build().async(); diff --git a/driver/src/test/java/com/arangodb/ConcurrencyTests.java b/driver/src/test/java/com/arangodb/ConcurrencyTests.java index c0a8c3125..80aaa3ff9 100644 --- a/driver/src/test/java/com/arangodb/ConcurrencyTests.java +++ b/driver/src/test/java/com/arangodb/ConcurrencyTests.java @@ -1,6 +1,7 @@ package com.arangodb; import com.arangodb.config.ConfigUtils; +import com.arangodb.util.SlowTest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; @@ -12,11 +13,16 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + class ConcurrencyTests { + @SlowTest @ParameterizedTest @EnumSource(Protocol.class) void concurrentPendingRequests(Protocol protocol) throws ExecutionException, InterruptedException { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ExecutorService es = Executors.newFixedThreadPool(10); ArangoDB adb = new ArangoDB.Builder() .loadProperties(ConfigUtils.loadConfig()) diff --git a/driver/src/test/java/com/arangodb/ConsumerThreadAsyncTest.java b/driver/src/test/java/com/arangodb/ConsumerThreadAsyncTest.java index b241f5f5c..c7c219d06 100644 --- a/driver/src/test/java/com/arangodb/ConsumerThreadAsyncTest.java +++ b/driver/src/test/java/com/arangodb/ConsumerThreadAsyncTest.java @@ -6,11 +6,15 @@ import java.util.concurrent.ExecutionException; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + public class ConsumerThreadAsyncTest extends BaseJunit5 { @ParameterizedTest @EnumSource(Protocol.class) void nestedRequests(Protocol protocol) throws ExecutionException, InterruptedException { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ArangoDBAsync adb = new ArangoDB.Builder() .loadProperties(ArangoConfigProperties.fromFile()) .protocol(protocol) diff --git a/driver/src/test/java/com/arangodb/DocumentTest.java b/driver/src/test/java/com/arangodb/DocumentTest.java index 0ce14ff53..147346d0e 100644 --- a/driver/src/test/java/com/arangodb/DocumentTest.java +++ b/driver/src/test/java/com/arangodb/DocumentTest.java @@ -45,7 +45,7 @@ class DocumentTest extends BaseJunit5 { private static Stream cols() { return dbsStream() - .map(db -> db.collection(COLLECTION_NAME)) + .map(mapNamedPayload(db -> db.collection(COLLECTION_NAME))) .map(Arguments::of); } @@ -55,7 +55,7 @@ static void init() { initCollections(COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertAsJson(ArangoCollection collection) { //@formatter:off @@ -92,7 +92,7 @@ void insertAsJson(ArangoCollection collection) { assertThat(artist.toString()).isEqualTo("PREGARDIEN/RHEINISCHE KANTOREI/DAS"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void insertAsBaseDocument(ArangoCollection collection) { final BaseDocument document = new BaseDocument(UUID.randomUUID().toString()); @@ -124,7 +124,7 @@ void insertAsBaseDocument(ArangoCollection collection) { assertThat(artist.toString()).isEqualTo("PREGARDIEN/RHEINISCHE KANTOREI/DAS"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void documentKeyWithSpecialChars(ArangoCollection collection) { final String key = "_-:.@()+,=;$!*'%" + UUID.randomUUID(); diff --git a/driver/src/test/java/com/arangodb/InvertedIndexAsyncTest.java b/driver/src/test/java/com/arangodb/InvertedIndexAsyncTest.java index 2bfb21c81..c3ecf32a8 100644 --- a/driver/src/test/java/com/arangodb/InvertedIndexAsyncTest.java +++ b/driver/src/test/java/com/arangodb/InvertedIndexAsyncTest.java @@ -23,7 +23,7 @@ public class InvertedIndexAsyncTest extends BaseJunit5 { private static final String COLLECTION_NAME = "InvertedIndexTest_collection"; private static Stream asyncCols() { - return asyncDbsStream().map(db -> db.collection(COLLECTION_NAME)).map(Arguments::of); + return asyncDbsStream().map(mapNamedPayload(db -> db.collection(COLLECTION_NAME))).map(Arguments::of); } @BeforeAll @@ -153,7 +153,7 @@ private void assertCorrectIndexEntity(InvertedIndexEntity indexResult, InvertedI } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void createAndGetInvertedIndex(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -166,7 +166,7 @@ void createAndGetInvertedIndex(ArangoCollectionAsync collection) throws Executio assertCorrectIndexEntity(loadedIndex, options); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getInvertedIndexesShouldNotReturnOtherIndexTypes(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); @@ -186,7 +186,7 @@ void getInvertedIndexesShouldNotReturnOtherIndexTypes(ArangoCollectionAsync coll .contains(created.getName()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncCols") void getIndexesShouldNotReturnInvertedIndexes(ArangoCollectionAsync collection) throws ExecutionException, InterruptedException { assumeTrue(isAtLeastVersion(3, 10)); diff --git a/driver/src/test/java/com/arangodb/InvertedIndexTest.java b/driver/src/test/java/com/arangodb/InvertedIndexTest.java index 57c94036e..e5562f299 100644 --- a/driver/src/test/java/com/arangodb/InvertedIndexTest.java +++ b/driver/src/test/java/com/arangodb/InvertedIndexTest.java @@ -22,7 +22,7 @@ public class InvertedIndexTest extends BaseJunit5 { private static final String COLLECTION_NAME = "InvertedIndexTest_collection"; private static Stream cols() { - return dbsStream().map(db -> db.collection(COLLECTION_NAME)).map(Arguments::of); + return dbsStream().map(mapNamedPayload(db -> db.collection(COLLECTION_NAME))).map(Arguments::of); } @BeforeAll @@ -152,7 +152,7 @@ private void assertCorrectIndexEntity(InvertedIndexEntity indexResult, InvertedI } } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void createAndGetInvertedIndex(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 10)); @@ -165,7 +165,7 @@ void createAndGetInvertedIndex(ArangoCollection collection) { assertCorrectIndexEntity(loadedIndex, options); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getInvertedIndexesShouldNotReturnOtherIndexTypes(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 10)); @@ -185,7 +185,7 @@ void getInvertedIndexesShouldNotReturnOtherIndexTypes(ArangoCollection collectio .contains(created.getName()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("cols") void getIndexesShouldNotReturnInvertedIndexes(ArangoCollection collection) { assumeTrue(isAtLeastVersion(3, 10)); diff --git a/driver/src/test/java/com/arangodb/JwtAuthAsyncTest.java b/driver/src/test/java/com/arangodb/JwtAuthAsyncTest.java index bff18088b..895dc8687 100644 --- a/driver/src/test/java/com/arangodb/JwtAuthAsyncTest.java +++ b/driver/src/test/java/com/arangodb/JwtAuthAsyncTest.java @@ -50,6 +50,8 @@ private static String getJwt(ArangoDB arangoDB) { @ParameterizedTest @EnumSource(Protocol.class) void notAuthenticated(Protocol protocol) { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ArangoDBAsync arangoDB = getBuilder(protocol).acquireHostList(false).build().async(); Throwable thrown = catchThrowable(() -> arangoDB.getVersion().get()).getCause(); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -61,6 +63,8 @@ void notAuthenticated(Protocol protocol) { @ParameterizedTest @EnumSource(Protocol.class) void authenticated(Protocol protocol) throws ExecutionException, InterruptedException { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ArangoDBAsync arangoDB = getBuilder(protocol) .jwt(jwt) .build() diff --git a/driver/src/test/java/com/arangodb/JwtAuthTest.java b/driver/src/test/java/com/arangodb/JwtAuthTest.java index 137488d88..1f9185430 100644 --- a/driver/src/test/java/com/arangodb/JwtAuthTest.java +++ b/driver/src/test/java/com/arangodb/JwtAuthTest.java @@ -49,6 +49,8 @@ private static String getJwt(ArangoDB arangoDB) { @ParameterizedTest @EnumSource(Protocol.class) void notAuthenticated(Protocol protocol) { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ArangoDB arangoDB = getBuilder(protocol).acquireHostList(false).build(); Throwable thrown = catchThrowable(arangoDB::getVersion); assertThat(thrown).isInstanceOf(ArangoDBException.class); @@ -60,6 +62,8 @@ void notAuthenticated(Protocol protocol) { @ParameterizedTest @EnumSource(Protocol.class) void authenticated(Protocol protocol) { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ArangoDB arangoDB = getBuilder(protocol) .jwt(jwt) .build(); diff --git a/driver/src/test/java/com/arangodb/ParallelAsyncTest.java b/driver/src/test/java/com/arangodb/ParallelAsyncTest.java index df72b33c9..5a697f7f4 100644 --- a/driver/src/test/java/com/arangodb/ParallelAsyncTest.java +++ b/driver/src/test/java/com/arangodb/ParallelAsyncTest.java @@ -1,6 +1,7 @@ package com.arangodb; import com.arangodb.config.ConfigUtils; +import com.arangodb.util.SlowTest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; @@ -13,9 +14,12 @@ class ParallelAsyncTest { - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @EnumSource(Protocol.class) void connectionParallelism(Protocol protocol) throws InterruptedException { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + // test that connections are internally async and can have multiple pending requests // BTS-1102: the server does not run pipelined HTTP/1.1 requests in parallel assumeTrue(protocol != Protocol.HTTP_JSON && protocol != Protocol.HTTP_VPACK); diff --git a/driver/src/test/java/com/arangodb/ParallelTest.java b/driver/src/test/java/com/arangodb/ParallelTest.java index 6b45c90d1..00bf1eaba 100644 --- a/driver/src/test/java/com/arangodb/ParallelTest.java +++ b/driver/src/test/java/com/arangodb/ParallelTest.java @@ -1,6 +1,7 @@ package com.arangodb; import com.arangodb.config.ConfigUtils; +import com.arangodb.util.SlowTest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; @@ -15,9 +16,12 @@ class ParallelTest { - @ParameterizedTest(name = "{index}") + @SlowTest + @ParameterizedTest @EnumSource(Protocol.class) void connectionParallelism(Protocol protocol) throws InterruptedException { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + // test that connections are internally async and can have multiple pending requests // BTS-1102: the server does not run pipelined HTTP/1.1 requests in parallel assumeTrue(protocol != Protocol.HTTP_JSON && protocol != Protocol.HTTP_VPACK); diff --git a/driver/src/test/java/com/arangodb/StreamTransactionAsyncTest.java b/driver/src/test/java/com/arangodb/StreamTransactionAsyncTest.java index 39ad36477..8bfe3bcb2 100644 --- a/driver/src/test/java/com/arangodb/StreamTransactionAsyncTest.java +++ b/driver/src/test/java/com/arangodb/StreamTransactionAsyncTest.java @@ -47,7 +47,7 @@ static void init() { initCollections(COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void beginStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -60,7 +60,7 @@ void beginStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, I db.abortStreamTransaction(tx.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void beginStreamTransactionWithNonExistingCollectionsShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); @@ -71,7 +71,7 @@ void beginStreamTransactionWithNonExistingCollectionsShouldThrow(ArangoDatabaseA assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void abortStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -86,7 +86,7 @@ void abortStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, I assertThat(abortedTx.getStatus()).isEqualTo(StreamTransactionStatus.aborted); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void abortStreamTransactionTwice(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -98,7 +98,7 @@ void abortStreamTransactionTwice(ArangoDatabaseAsync db) throws ExecutionExcepti db.abortStreamTransaction(begunTx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void abortStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); @@ -108,7 +108,7 @@ void abortStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatab assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void abortStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); @@ -118,7 +118,7 @@ void abortStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsy assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void abortCommittedStreamTransactionShouldThrow(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -131,7 +131,7 @@ void abortCommittedStreamTransactionShouldThrow(ArangoDatabaseAsync db) throws E assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -148,7 +148,7 @@ void getStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, Int db.abortStreamTransaction(createdTx.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); @@ -159,7 +159,7 @@ void getStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabas assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); @@ -170,7 +170,7 @@ void getStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void commitStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -185,7 +185,7 @@ void commitStreamTransaction(ArangoDatabaseAsync db) throws ExecutionException, assertThat(committedTx.getStatus()).isEqualTo(StreamTransactionStatus.committed); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void commitStreamTransactionTwice(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -197,7 +197,7 @@ void commitStreamTransactionTwice(ArangoDatabaseAsync db) throws ExecutionExcept db.commitStreamTransaction(createdTx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void commitStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); @@ -208,7 +208,7 @@ void commitStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoData assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void commitStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); @@ -219,7 +219,7 @@ void commitStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabaseAs assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void commitAbortedStreamTransactionShouldThrow(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -232,7 +232,7 @@ void commitAbortedStreamTransactionShouldThrow(ArangoDatabaseAsync db) throws Ex assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -254,7 +254,7 @@ void getDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedE db.abortStreamTransaction(tx.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getDocumentWithNonExistingTransactionIdShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); @@ -268,7 +268,7 @@ void getDocumentWithNonExistingTransactionIdShouldThrow(ArangoDatabaseAsync db) assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getDocumentWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync db) { assumeTrue(isSingleServer()); @@ -281,7 +281,7 @@ void getDocumentWithInvalidTransactionIdShouldThrow(ArangoDatabaseAsync db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getDocuments(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -309,7 +309,7 @@ void getDocuments(ArangoDatabaseAsync db) throws ExecutionException, Interrupted db.abortStreamTransaction(tx.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void insertDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -337,7 +337,7 @@ void insertDocument(ArangoDatabaseAsync db) throws ExecutionException, Interrupt assertThat(collection.getDocument(txDoc.getKey(), BaseDocument.class, null).get()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void insertDocuments(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -369,7 +369,7 @@ void insertDocuments(ArangoDatabaseAsync db) throws ExecutionException, Interrup assertThat(collection.getDocuments(keys, BaseDocument.class, null).get().getDocuments()).hasSize(keys.size()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void replaceDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -406,7 +406,7 @@ void replaceDocument(ArangoDatabaseAsync db) throws ExecutionException, Interrup .getProperties()).containsEntry("test", "bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void replaceDocuments(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -451,7 +451,7 @@ void replaceDocuments(ArangoDatabaseAsync db) throws ExecutionException, Interru .forEach(it -> assertThat(it).isEqualTo("bar")); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void updateDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -489,7 +489,7 @@ void updateDocument(ArangoDatabaseAsync db) throws ExecutionException, Interrupt } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void updateDocuments(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -534,7 +534,7 @@ void updateDocuments(ArangoDatabaseAsync db) throws ExecutionException, Interrup .forEach(it -> assertThat(it).isEqualTo("bar")); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void deleteDocument(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -565,7 +565,7 @@ void deleteDocument(ArangoDatabaseAsync db) throws ExecutionException, Interrupt assertThat(collection.getDocument(createdDoc.getKey(), BaseDocument.class, null).get()).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void deleteDocuments(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -598,7 +598,7 @@ void deleteDocuments(ArangoDatabaseAsync db) throws ExecutionException, Interrup assertThat(collection.getDocuments(keys, BaseDocument.class, null).get().getDocuments()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void documentExists(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -620,7 +620,7 @@ void documentExists(ArangoDatabaseAsync db) throws ExecutionException, Interrupt db.abortStreamTransaction(tx.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void count(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -643,7 +643,7 @@ void count(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExcepti db.abortStreamTransaction(tx.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void truncate(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -672,7 +672,7 @@ void truncate(ArangoDatabaseAsync db) throws ExecutionException, InterruptedExce assertThat(collection.count().get().getCount()).isZero(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void createCursor(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -701,7 +701,7 @@ void createCursor(ArangoDatabaseAsync db) throws ExecutionException, Interrupted db.abortStreamTransaction(tx.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void nextCursor(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -737,7 +737,7 @@ void nextCursor(ArangoDatabaseAsync db) throws ExecutionException, InterruptedEx db.abortStreamTransaction(tx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void getStreamTransactions(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -759,7 +759,7 @@ void getStreamTransactions(ArangoDatabaseAsync db) throws ExecutionException, In db.abortStreamTransaction(tx2.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionAllowImplicitFalse(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -786,7 +786,7 @@ void transactionAllowImplicitFalse(ArangoDatabaseAsync db) throws ExecutionExcep db.abortStreamTransaction(tx.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void transactionDirtyRead(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isCluster()); diff --git a/driver/src/test/java/com/arangodb/StreamTransactionConflictsAsyncTest.java b/driver/src/test/java/com/arangodb/StreamTransactionConflictsAsyncTest.java index 68ba9a5e7..94e3996df 100644 --- a/driver/src/test/java/com/arangodb/StreamTransactionConflictsAsyncTest.java +++ b/driver/src/test/java/com/arangodb/StreamTransactionConflictsAsyncTest.java @@ -49,7 +49,7 @@ static void init() { initCollections(COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void conflictOnInsertDocumentWithNotYetCommittedTx(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -83,7 +83,7 @@ void conflictOnInsertDocumentWithNotYetCommittedTx(ArangoDatabaseAsync db) throw db.abortStreamTransaction(tx2.getId()).get(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncDbs") void conflictOnInsertDocumentWithAlreadyCommittedTx(ArangoDatabaseAsync db) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); diff --git a/driver/src/test/java/com/arangodb/StreamTransactionConflictsTest.java b/driver/src/test/java/com/arangodb/StreamTransactionConflictsTest.java index 1e5ed62df..71b4a01ed 100644 --- a/driver/src/test/java/com/arangodb/StreamTransactionConflictsTest.java +++ b/driver/src/test/java/com/arangodb/StreamTransactionConflictsTest.java @@ -48,7 +48,7 @@ static void init() { initCollections(COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void conflictOnInsertDocumentWithNotYetCommittedTx(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -82,7 +82,7 @@ void conflictOnInsertDocumentWithNotYetCommittedTx(ArangoDatabase db) { db.abortStreamTransaction(tx2.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void conflictOnInsertDocumentWithAlreadyCommittedTx(ArangoDatabase db) { assumeTrue(isSingleServer()); diff --git a/driver/src/test/java/com/arangodb/StreamTransactionGraphAsyncTest.java b/driver/src/test/java/com/arangodb/StreamTransactionGraphAsyncTest.java index 2f15cb1a5..c61a6ad23 100644 --- a/driver/src/test/java/com/arangodb/StreamTransactionGraphAsyncTest.java +++ b/driver/src/test/java/com/arangodb/StreamTransactionGraphAsyncTest.java @@ -49,13 +49,13 @@ class StreamTransactionGraphAsyncTest extends BaseJunit5 { private static Stream asyncVertices() { return asyncDbsStream() - .map(db -> db.graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_1)) + .map(mapNamedPayload(db -> db.graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_1))) .map(Arguments::of); } private static Stream asyncEdges() { return asyncDbsStream() - .map(db -> db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION)) + .map(mapNamedPayload(db -> db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION))) .map(Arguments::of); } @@ -80,7 +80,7 @@ private BaseEdgeDocument createEdgeValue(String streamTransactionId, ArangoGraph return value; } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void getVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -104,7 +104,7 @@ void getVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionEx } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void createVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -134,7 +134,7 @@ void createVertex(ArangoVertexCollectionAsync vertexCollection1) throws Executio assertThat(vertexCollection1.getVertex(createdVertex.getKey(), BaseDocument.class, null).get()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void replaceVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -173,7 +173,7 @@ void replaceVertex(ArangoVertexCollectionAsync vertexCollection1) throws Executi .getProperties()).containsEntry("test", "bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void updateVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -212,7 +212,7 @@ void updateVertex(ArangoVertexCollectionAsync vertexCollection1) throws Executio .getProperties()).containsEntry("test", "bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncVertices") void deleteVertex(ArangoVertexCollectionAsync vertexCollection1) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -244,7 +244,7 @@ void deleteVertex(ArangoVertexCollectionAsync vertexCollection1) throws Executio } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncEdges") void getEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -268,7 +268,7 @@ void getEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncEdges") void createEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -298,7 +298,7 @@ void createEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionExcept assertThat(edgeCollection.getEdge(createdEdge.getKey(), BaseEdgeDocument.class, null).get()).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncEdges") void replaceEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -337,7 +337,7 @@ void replaceEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionExcep .getProperties()).containsEntry("test", "bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncEdges") void updateEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); @@ -375,7 +375,7 @@ void updateEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionExcept .getProperties()).containsEntry("test", "bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("asyncEdges") void deleteEdge(ArangoEdgeCollectionAsync edgeCollection) throws ExecutionException, InterruptedException { assumeTrue(isSingleServer()); diff --git a/driver/src/test/java/com/arangodb/StreamTransactionGraphTest.java b/driver/src/test/java/com/arangodb/StreamTransactionGraphTest.java index e4d73fa33..d4337788a 100644 --- a/driver/src/test/java/com/arangodb/StreamTransactionGraphTest.java +++ b/driver/src/test/java/com/arangodb/StreamTransactionGraphTest.java @@ -47,13 +47,13 @@ class StreamTransactionGraphTest extends BaseJunit5 { private static Stream vertices() { return dbsStream() - .map(db -> db.graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_1)) + .map(mapNamedPayload(db -> db.graph(GRAPH_NAME).vertexCollection(VERTEX_COLLECTION_1))) .map(Arguments::of); } private static Stream edges() { return dbsStream() - .map(db -> db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION)) + .map(mapNamedPayload(db -> db.graph(GRAPH_NAME).edgeCollection(EDGE_COLLECTION))) .map(Arguments::of); } @@ -78,7 +78,7 @@ private BaseEdgeDocument createEdgeValue(String streamTransactionId, ArangoGraph return value; } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void getVertex(ArangoVertexCollection vertexCollection1) { assumeTrue(isSingleServer()); @@ -102,7 +102,7 @@ void getVertex(ArangoVertexCollection vertexCollection1) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void createVertex(ArangoVertexCollection vertexCollection1) { assumeTrue(isSingleServer()); @@ -132,7 +132,7 @@ void createVertex(ArangoVertexCollection vertexCollection1) { assertThat(vertexCollection1.getVertex(createdVertex.getKey(), BaseDocument.class, null)).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void replaceVertex(ArangoVertexCollection vertexCollection1) { assumeTrue(isSingleServer()); @@ -171,7 +171,7 @@ void replaceVertex(ArangoVertexCollection vertexCollection1) { .getProperties()).containsEntry("test", "bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void updateVertex(ArangoVertexCollection vertexCollection1) { assumeTrue(isSingleServer()); @@ -210,7 +210,7 @@ void updateVertex(ArangoVertexCollection vertexCollection1) { .getProperties()).containsEntry("test", "bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("vertices") void deleteVertex(ArangoVertexCollection vertexCollection1) { assumeTrue(isSingleServer()); @@ -242,7 +242,7 @@ void deleteVertex(ArangoVertexCollection vertexCollection1) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void getEdge(ArangoEdgeCollection edgeCollection) { assumeTrue(isSingleServer()); @@ -266,7 +266,7 @@ void getEdge(ArangoEdgeCollection edgeCollection) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void createEdge(ArangoEdgeCollection edgeCollection) { assumeTrue(isSingleServer()); @@ -296,7 +296,7 @@ void createEdge(ArangoEdgeCollection edgeCollection) { assertThat(edgeCollection.getEdge(createdEdge.getKey(), BaseEdgeDocument.class, null)).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void replaceEdge(ArangoEdgeCollection edgeCollection) { assumeTrue(isSingleServer()); @@ -335,7 +335,7 @@ void replaceEdge(ArangoEdgeCollection edgeCollection) { .getProperties()).containsEntry("test", "bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void updateEdge(ArangoEdgeCollection edgeCollection) { assumeTrue(isSingleServer()); @@ -373,7 +373,7 @@ void updateEdge(ArangoEdgeCollection edgeCollection) { .getProperties()).containsEntry("test", "bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("edges") void deleteEdge(ArangoEdgeCollection edgeCollection) { assumeTrue(isSingleServer()); diff --git a/driver/src/test/java/com/arangodb/StreamTransactionTest.java b/driver/src/test/java/com/arangodb/StreamTransactionTest.java index bbaa306fd..3c6b24d62 100644 --- a/driver/src/test/java/com/arangodb/StreamTransactionTest.java +++ b/driver/src/test/java/com/arangodb/StreamTransactionTest.java @@ -47,7 +47,7 @@ static void init() { initCollections(COLLECTION_NAME); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void beginStreamTransaction(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -60,7 +60,7 @@ void beginStreamTransaction(ArangoDatabase db) { db.abortStreamTransaction(tx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void beginStreamTransactionWithNonExistingCollectionsShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -71,7 +71,7 @@ void beginStreamTransactionWithNonExistingCollectionsShouldThrow(ArangoDatabase assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void abortStreamTransaction(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -86,7 +86,7 @@ void abortStreamTransaction(ArangoDatabase db) { assertThat(abortedTx.getStatus()).isEqualTo(StreamTransactionStatus.aborted); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void abortStreamTransactionTwice(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -98,7 +98,7 @@ void abortStreamTransactionTwice(ArangoDatabase db) { db.abortStreamTransaction(begunTx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void abortStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -108,7 +108,7 @@ void abortStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatab assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void abortStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -118,7 +118,7 @@ void abortStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase db assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void abortCommittedStreamTransactionShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -131,7 +131,7 @@ void abortCommittedStreamTransactionShouldThrow(ArangoDatabase db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getStreamTransaction(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -148,7 +148,7 @@ void getStreamTransaction(ArangoDatabase db) { db.abortStreamTransaction(createdTx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -159,7 +159,7 @@ void getStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabas assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -170,7 +170,7 @@ void getStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase db) assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void commitStreamTransaction(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -185,7 +185,7 @@ void commitStreamTransaction(ArangoDatabase db) { assertThat(committedTx.getStatus()).isEqualTo(StreamTransactionStatus.committed); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void commitStreamTransactionTwice(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -197,7 +197,7 @@ void commitStreamTransactionTwice(ArangoDatabase db) { db.commitStreamTransaction(createdTx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void commitStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -208,7 +208,7 @@ void commitStreamTransactionWhenTransactionIdDoesNotExistsShouldThrow(ArangoData assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void commitStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -219,7 +219,7 @@ void commitStreamTransactionWithInvalidTransactionIdShouldThrow(ArangoDatabase d assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void commitAbortedStreamTransactionShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -232,7 +232,7 @@ void commitAbortedStreamTransactionShouldThrow(ArangoDatabase db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getDocument(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -254,7 +254,7 @@ void getDocument(ArangoDatabase db) { db.abortStreamTransaction(tx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getDocumentWithNonExistingTransactionIdShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -268,7 +268,7 @@ void getDocumentWithNonExistingTransactionIdShouldThrow(ArangoDatabase db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getDocumentWithInvalidTransactionIdShouldThrow(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -281,7 +281,7 @@ void getDocumentWithInvalidTransactionIdShouldThrow(ArangoDatabase db) { assertThat(thrown).isInstanceOf(ArangoDBException.class); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getDocuments(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -309,7 +309,7 @@ void getDocuments(ArangoDatabase db) { db.abortStreamTransaction(tx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void insertDocument(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -337,7 +337,7 @@ void insertDocument(ArangoDatabase db) { assertThat(collection.getDocument(txDoc.getKey(), BaseDocument.class, null)).isNotNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void insertDocuments(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -369,7 +369,7 @@ void insertDocuments(ArangoDatabase db) { assertThat(collection.getDocuments(keys, BaseDocument.class, null).getDocuments()).hasSize(keys.size()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void replaceDocument(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -406,7 +406,7 @@ void replaceDocument(ArangoDatabase db) { .getProperties()).containsEntry("test", "bar"); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void replaceDocuments(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -453,7 +453,7 @@ void replaceDocuments(ArangoDatabase db) { .forEach(it -> assertThat(it).isEqualTo("bar")); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void updateDocument(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -491,7 +491,7 @@ void updateDocument(ArangoDatabase db) { } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void updateDocuments(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -538,7 +538,7 @@ void updateDocuments(ArangoDatabase db) { .forEach(it -> assertThat(it).isEqualTo("bar")); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void deleteDocument(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -569,7 +569,7 @@ void deleteDocument(ArangoDatabase db) { assertThat(collection.getDocument(createdDoc.getKey(), BaseDocument.class, null)).isNull(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void deleteDocuments(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -602,7 +602,7 @@ void deleteDocuments(ArangoDatabase db) { assertThat(collection.getDocuments(keys, BaseDocument.class, null).getDocuments()).isEmpty(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void documentExists(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -624,7 +624,7 @@ void documentExists(ArangoDatabase db) { db.abortStreamTransaction(tx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void count(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -647,7 +647,7 @@ void count(ArangoDatabase db) { db.abortStreamTransaction(tx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void truncate(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -676,7 +676,7 @@ void truncate(ArangoDatabase db) { assertThat(collection.count().getCount()).isZero(); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void createCursor(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -705,7 +705,7 @@ void createCursor(ArangoDatabase db) { db.abortStreamTransaction(tx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void nextCursor(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -738,7 +738,7 @@ void nextCursor(ArangoDatabase db) { db.abortStreamTransaction(tx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void getStreamTransactions(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -760,7 +760,7 @@ void getStreamTransactions(ArangoDatabase db) { db.abortStreamTransaction(tx2.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionAllowImplicitFalse(ArangoDatabase db) { assumeTrue(isSingleServer()); @@ -787,7 +787,7 @@ void transactionAllowImplicitFalse(ArangoDatabase db) { db.abortStreamTransaction(tx.getId()); } - @ParameterizedTest(name = "{index}") + @ParameterizedTest @MethodSource("dbs") void transactionDirtyRead(ArangoDatabase db) throws IOException { assumeTrue(isCluster()); diff --git a/driver/src/test/java/com/arangodb/UserAgentAsyncTest.java b/driver/src/test/java/com/arangodb/UserAgentAsyncTest.java index 39e4ab0ae..0a90b35f9 100644 --- a/driver/src/test/java/com/arangodb/UserAgentAsyncTest.java +++ b/driver/src/test/java/com/arangodb/UserAgentAsyncTest.java @@ -8,6 +8,7 @@ import java.util.concurrent.ExecutionException; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assumptions.assumeTrue; class UserAgentAsyncTest extends BaseJunit5 { @@ -21,6 +22,8 @@ void packageVersion() { @ParameterizedTest @EnumSource(Protocol.class) void userAgentHeader(Protocol protocol) throws ExecutionException, InterruptedException { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ArangoDBAsync adb = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) diff --git a/driver/src/test/java/com/arangodb/UserAgentTest.java b/driver/src/test/java/com/arangodb/UserAgentTest.java index 09d09addd..4b98735ca 100644 --- a/driver/src/test/java/com/arangodb/UserAgentTest.java +++ b/driver/src/test/java/com/arangodb/UserAgentTest.java @@ -6,6 +6,7 @@ import org.junit.jupiter.params.provider.EnumSource; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assumptions.assumeTrue; class UserAgentTest extends BaseJunit5 { @@ -19,6 +20,8 @@ void packageVersion() { @ParameterizedTest @EnumSource(Protocol.class) void userAgentHeader(Protocol protocol) { + assumeTrue(!protocol.equals(Protocol.VST) || BaseJunit5.isLessThanVersion(3, 12)); + ArangoDB adb = new ArangoDB.Builder() .loadProperties(config) .protocol(protocol) diff --git a/driver/src/test/java/com/arangodb/internal/velocystream/CommunicationTest.java b/driver/src/test/java/com/arangodb/internal/velocystream/CommunicationTest.java index 8e077896c..5219179fc 100644 --- a/driver/src/test/java/com/arangodb/internal/velocystream/CommunicationTest.java +++ b/driver/src/test/java/com/arangodb/internal/velocystream/CommunicationTest.java @@ -24,6 +24,7 @@ import com.arangodb.ArangoDatabase; import com.arangodb.config.ConfigUtils; import com.arangodb.entity.ArangoDBVersion; +import com.arangodb.util.SlowTest; import org.junit.jupiter.api.Test; import java.util.Collection; @@ -49,6 +50,7 @@ void chunkSizeSmall() { assertThat(version).isNotNull(); } + @SlowTest @Test void multiThread() throws Exception { final ArangoDB arangoDB = new ArangoDB.Builder() @@ -77,6 +79,7 @@ void multiThread() throws Exception { assertThat(iterator.next()).isEqualTo(SLOW); } + @SlowTest @Test void multiThreadSameDatabases() throws Exception { final ArangoDB arangoDB = new ArangoDB.Builder() diff --git a/driver/src/test/java/com/arangodb/serde/CustomSerdeTest.java b/driver/src/test/java/com/arangodb/serde/CustomSerdeTest.java index 9958b1111..8d64d11a6 100644 --- a/driver/src/test/java/com/arangodb/serde/CustomSerdeTest.java +++ b/driver/src/test/java/com/arangodb/serde/CustomSerdeTest.java @@ -72,7 +72,7 @@ static void init() { }); arangoDB = new ArangoDB.Builder() .loadProperties(ConfigUtils.loadConfig()) - .protocol(Protocol.VST) + .protocol(Protocol.HTTP_VPACK) .serde(serde).build(); db = arangoDB.db("custom-serde-test"); diff --git a/driver/src/test/java/com/arangodb/serde/JacksonConfigurationTest.java b/driver/src/test/java/com/arangodb/serde/JacksonConfigurationTest.java index e483b4fb8..1a0f82122 100644 --- a/driver/src/test/java/com/arangodb/serde/JacksonConfigurationTest.java +++ b/driver/src/test/java/com/arangodb/serde/JacksonConfigurationTest.java @@ -3,6 +3,7 @@ import com.arangodb.ContentType; import com.arangodb.internal.serde.InternalSerdeProvider; import com.arangodb.serde.jackson.JacksonSerde; +import com.arangodb.util.SlowTest; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; @@ -12,6 +13,7 @@ public class JacksonConfigurationTest { + @SlowTest @ParameterizedTest @EnumSource(ContentType.class) void bigStringInternalSerde(ContentType type) { @@ -27,6 +29,7 @@ void bigStringInternalSerde(ContentType type) { assertThat(out).isEqualTo(in); } + @SlowTest @ParameterizedTest @EnumSource(ContentType.class) void bigStringUserSerde(ContentType type) { diff --git a/driver/src/test/java/com/arangodb/util/SlowTest.java b/driver/src/test/java/com/arangodb/util/SlowTest.java new file mode 100644 index 000000000..cc74f7f21 --- /dev/null +++ b/driver/src/test/java/com/arangodb/util/SlowTest.java @@ -0,0 +1,14 @@ +package com.arangodb.util; + +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE, ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +@EnabledIfSystemProperty(named = "enableSlowTests", matches = "true") +public @interface SlowTest { +}