File tree 3 files changed +41
-0
lines changed
src/test/java/com/arangodb
3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 29
29
30
30
import java .util .Arrays ;
31
31
import java .util .Collections ;
32
+ import java .util .UUID ;
32
33
33
34
import static org .hamcrest .MatcherAssert .assertThat ;
34
35
import static org .hamcrest .Matchers .*;
@@ -437,4 +438,20 @@ public void deleteEdgeIfMatchFail() {
437
438
}
438
439
}
439
440
}
441
+
442
+ @ Test
443
+ public void edgeKeyWithSpecialChars () {
444
+ final BaseEdgeDocument value = createEdgeValue ();
445
+ final String key = "_-:.@()+,=;$!*'%" + UUID .randomUUID ().toString ();
446
+ value .setKey (key );
447
+ final EdgeEntity edge = edges .insertEdge (value , null );
448
+ assertThat (edge , is (notNullValue ()));
449
+ final BaseEdgeDocument document = edgeCollection .getDocument (edge .getKey (),
450
+ BaseEdgeDocument .class , null );
451
+ assertThat (document , is (notNullValue ()));
452
+ assertThat (document .getKey (), is (key ));
453
+ assertThat (document .getFrom (), is (notNullValue ()));
454
+ assertThat (document .getTo (), is (notNullValue ()));
455
+ }
456
+
440
457
}
Original file line number Diff line number Diff line change @@ -459,4 +459,17 @@ public void deleteVertexIfMatchFail() {
459
459
}
460
460
}
461
461
}
462
+
463
+ @ Test
464
+ public void vertexKeyWithSpecialChars () {
465
+ final String key = "_-:.@()+,=;$!*'%" + UUID .randomUUID ().toString ();
466
+ final VertexEntity vertex = vertices
467
+ .insertVertex (new BaseDocument (key ), null );
468
+ assertThat (vertex , is (notNullValue ()));
469
+ final BaseDocument document = collection
470
+ .getDocument (vertex .getKey (), BaseDocument .class , null );
471
+ assertThat (document , is (notNullValue ()));
472
+ assertThat (document .getKey (), is (key ));
473
+ }
474
+
462
475
}
Original file line number Diff line number Diff line change 28
28
import org .junit .runners .Parameterized ;
29
29
30
30
import java .util .Map ;
31
+ import java .util .UUID ;
31
32
32
33
import static org .hamcrest .MatcherAssert .assertThat ;
33
34
import static org .hamcrest .Matchers .is ;
@@ -121,4 +122,14 @@ public void insertAsBaseDocument() {
121
122
assertThat (artist .toString (), is ("PREGARDIEN/RHEINISCHE KANTOREI/DAS" ));
122
123
}
123
124
125
+ @ Test
126
+ public void documentKeyWithSpecialChars () {
127
+ final String key = "_-:.@()+,=;$!*'%" + UUID .randomUUID ().toString ();
128
+ final BaseDocument document = new BaseDocument (key );
129
+ final DocumentCreateEntity <BaseDocument > createResult = collection .insertDocument (document );
130
+ final BaseDocument doc = collection .getDocument (createResult .getKey (), BaseDocument .class );
131
+ assertThat (doc , is (notNullValue ()));
132
+ assertThat (doc .getKey (), is (key ));
133
+ }
134
+
124
135
}
You can’t perform that action at this time.
0 commit comments