@@ -98,7 +98,7 @@ void getAccessibleDatabases(ArangoDatabase db) {
98
98
@ ParameterizedTest (name = "{index}" )
99
99
@ MethodSource ("dbs" )
100
100
void createCollection (ArangoDatabase db ) {
101
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
101
+ String name = rndName ( );
102
102
final CollectionEntity result = db .createCollection (name , null );
103
103
assertThat (result ).isNotNull ();
104
104
assertThat (result .getId ()).isNotNull ();
@@ -121,7 +121,7 @@ void createCollectionWithNotNormalizedName(ArangoDatabase db) {
121
121
@ MethodSource ("dbs" )
122
122
void createCollectionWithReplicationFactor (ArangoDatabase db ) {
123
123
assumeTrue (isCluster ());
124
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
124
+ String name = rndName ( );
125
125
final CollectionEntity result = db
126
126
.createCollection (name , new CollectionCreateOptions ().replicationFactor (2 ));
127
127
assertThat (result ).isNotNull ();
@@ -136,7 +136,7 @@ void createCollectionWithWriteConcern(ArangoDatabase db) {
136
136
assumeTrue (isAtLeastVersion (3 , 5 ));
137
137
assumeTrue (isCluster ());
138
138
139
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
139
+ String name = rndName ( );
140
140
final CollectionEntity result = db .createCollection (name ,
141
141
new CollectionCreateOptions ().replicationFactor (2 ).writeConcern (2 ));
142
142
assertThat (result ).isNotNull ();
@@ -152,7 +152,7 @@ void createSatelliteCollection(ArangoDatabase db) {
152
152
assumeTrue (isEnterprise ());
153
153
assumeTrue (isCluster ());
154
154
155
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
155
+ String name = rndName ( );
156
156
final CollectionEntity result = db
157
157
.createCollection (name , new CollectionCreateOptions ().replicationFactor (ReplicationFactor .ofSatellite ()));
158
158
@@ -166,7 +166,7 @@ void createSatelliteCollection(ArangoDatabase db) {
166
166
@ MethodSource ("dbs" )
167
167
void createCollectionWithNumberOfShards (ArangoDatabase db ) {
168
168
assumeTrue (isCluster ());
169
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
169
+ String name = rndName ( );
170
170
final CollectionEntity result = db
171
171
.createCollection (name , new CollectionCreateOptions ().numberOfShards (2 ));
172
172
@@ -182,7 +182,7 @@ void createCollectionWithShardingStrategys(ArangoDatabase db) {
182
182
assumeTrue (isAtLeastVersion (3 , 4 ));
183
183
assumeTrue (isCluster ());
184
184
185
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
185
+ String name = rndName ( );
186
186
final CollectionEntity result = db .createCollection (name , new CollectionCreateOptions ()
187
187
.shardingStrategy (ShardingStrategy .COMMUNITY_COMPAT .getInternalName ()));
188
188
@@ -199,10 +199,10 @@ void createCollectionWithSmartJoinAttribute(ArangoDatabase db) {
199
199
assumeTrue (isEnterprise ());
200
200
assumeTrue (isCluster ());
201
201
202
- String fooName = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
202
+ String fooName = rndName ( );
203
203
db .collection (fooName ).create ();
204
204
205
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
205
+ String name = rndName ( );
206
206
final CollectionEntity result = db .createCollection (name ,
207
207
new CollectionCreateOptions ().smartJoinAttribute ("test123" ).distributeShardsLike (fooName ).shardKeys ("_key:" ));
208
208
assertThat (result ).isNotNull ();
@@ -217,7 +217,7 @@ void createCollectionWithSmartJoinAttributeWrong(ArangoDatabase db) {
217
217
assumeTrue (isEnterprise ());
218
218
assumeTrue (isCluster ());
219
219
220
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
220
+ String name = rndName ( );
221
221
222
222
try {
223
223
db .createCollection (name , new CollectionCreateOptions ().smartJoinAttribute ("test123" ));
@@ -232,7 +232,7 @@ void createCollectionWithSmartJoinAttributeWrong(ArangoDatabase db) {
232
232
void createCollectionWithNumberOfShardsAndShardKey (ArangoDatabase db ) {
233
233
assumeTrue (isCluster ());
234
234
235
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
235
+ String name = rndName ( );
236
236
final CollectionEntity result = db
237
237
.createCollection (name , new CollectionCreateOptions ().numberOfShards (2 ).shardKeys ("a" ));
238
238
assertThat (result ).isNotNull ();
@@ -246,7 +246,7 @@ void createCollectionWithNumberOfShardsAndShardKey(ArangoDatabase db) {
246
246
@ MethodSource ("dbs" )
247
247
void createCollectionWithNumberOfShardsAndShardKeys (ArangoDatabase db ) {
248
248
assumeTrue (isCluster ());
249
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
249
+ String name = rndName ( );
250
250
final CollectionEntity result = db .createCollection (name ,
251
251
new CollectionCreateOptions ().numberOfShards (2 ).shardKeys ("a" , "b" ));
252
252
assertThat (result ).isNotNull ();
@@ -264,8 +264,8 @@ void createCollectionWithDistributeShardsLike(ArangoDatabase db) {
264
264
265
265
final Integer numberOfShards = 3 ;
266
266
267
- String name1 = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
268
- String name2 = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
267
+ String name1 = rndName ( );
268
+ String name2 = rndName ( );
269
269
db .createCollection (name1 , new CollectionCreateOptions ().numberOfShards (numberOfShards ));
270
270
db .createCollection (name2 , new CollectionCreateOptions ().distributeShardsLike (name1 ));
271
271
@@ -274,7 +274,7 @@ void createCollectionWithDistributeShardsLike(ArangoDatabase db) {
274
274
}
275
275
276
276
private void createCollectionWithKeyType (ArangoDatabase db , KeyType keyType ) {
277
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
277
+ String name = rndName ( );
278
278
db .createCollection (name , new CollectionCreateOptions ().keyOptions (
279
279
false ,
280
280
keyType ,
@@ -315,7 +315,7 @@ void createCollectionWithKeyTypeUuid(ArangoDatabase db) {
315
315
@ MethodSource ("dbs" )
316
316
void createCollectionWithJsonSchema (ArangoDatabase db ) {
317
317
assumeTrue (isAtLeastVersion (3 , 7 ));
318
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
318
+ String name = rndName ( );
319
319
String rule = ("{ " +
320
320
" \" properties\" : {" +
321
321
" \" number\" : {" +
@@ -363,7 +363,7 @@ void createCollectionWithJsonSchema(ArangoDatabase db) {
363
363
@ MethodSource ("dbs" )
364
364
void createCollectionWithComputedFields (ArangoDatabase db ) {
365
365
assumeTrue (isAtLeastVersion (3 , 10 ));
366
- String cName = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
366
+ String cName = rndName ( );
367
367
ComputedValue cv = new ComputedValue ()
368
368
.name ("foo" )
369
369
.expression ("RETURN 11" )
@@ -398,7 +398,7 @@ void createCollectionWithComputedFields(ArangoDatabase db) {
398
398
@ ParameterizedTest (name = "{index}" )
399
399
@ MethodSource ("dbs" )
400
400
void deleteCollection (ArangoDatabase db ) {
401
- String name = "collection-" + TestUtils . generateRandomName ( supportsExtendedNames () );
401
+ String name = rndName ( );
402
402
db .createCollection (name , null );
403
403
db .collection (name ).drop ();
404
404
Throwable thrown = catchThrowable (() -> db .collection (name ).getInfo ());
@@ -1222,9 +1222,9 @@ void createGraphSatellite(ArangoDatabase db) {
1222
1222
void createGraphReplicationFaktor (ArangoDatabase db ) {
1223
1223
assumeTrue (isCluster ());
1224
1224
String name = "graph-" + rnd ();
1225
- final String edgeCollection = "edge-" + TestUtils . generateRandomName ( supportsExtendedNames () );
1226
- final String fromCollection = "from-" + TestUtils . generateRandomName ( supportsExtendedNames () );
1227
- final String toCollection = "to-" + TestUtils . generateRandomName ( supportsExtendedNames () );
1225
+ final String edgeCollection = rndName ( );
1226
+ final String fromCollection = rndName ( );
1227
+ final String toCollection = rndName ( );
1228
1228
final Collection <EdgeDefinition > edgeDefinitions =
1229
1229
Collections .singletonList (new EdgeDefinition ().collection (edgeCollection ).from (fromCollection ).to (toCollection ));
1230
1230
final GraphEntity result = db .createGraph (name , edgeDefinitions , new GraphCreateOptions ().replicationFactor (2 ));
@@ -1240,9 +1240,9 @@ void createGraphReplicationFaktor(ArangoDatabase db) {
1240
1240
void createGraphNumberOfShards (ArangoDatabase db ) {
1241
1241
assumeTrue (isCluster ());
1242
1242
String name = "graph-" + rnd ();
1243
- final String edgeCollection = "edge-" + TestUtils . generateRandomName ( supportsExtendedNames () );
1244
- final String fromCollection = "from-" + TestUtils . generateRandomName ( supportsExtendedNames () );
1245
- final String toCollection = "to-" + TestUtils . generateRandomName ( supportsExtendedNames () );
1243
+ final String edgeCollection = rndName ( );
1244
+ final String fromCollection = rndName ( );
1245
+ final String toCollection = rndName ( );
1246
1246
final Collection <EdgeDefinition > edgeDefinitions =
1247
1247
Collections .singletonList (new EdgeDefinition ().collection (edgeCollection ).from (fromCollection ).to (toCollection ));
1248
1248
final GraphEntity result = db
0 commit comments