File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
src/test/java/com/arangodb Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 2929
3030import java .util .Arrays ;
3131import java .util .Collections ;
32+ import java .util .UUID ;
3233
3334import static org .hamcrest .MatcherAssert .assertThat ;
3435import static org .hamcrest .Matchers .*;
@@ -437,4 +438,20 @@ public void deleteEdgeIfMatchFail() {
437438 }
438439 }
439440 }
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+
440457}
Original file line number Diff line number Diff line change @@ -459,4 +459,17 @@ public void deleteVertexIfMatchFail() {
459459 }
460460 }
461461 }
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+
462475}
Original file line number Diff line number Diff line change 2828import org .junit .runners .Parameterized ;
2929
3030import java .util .Map ;
31+ import java .util .UUID ;
3132
3233import static org .hamcrest .MatcherAssert .assertThat ;
3334import static org .hamcrest .Matchers .is ;
@@ -121,4 +122,14 @@ public void insertAsBaseDocument() {
121122 assertThat (artist .toString (), is ("PREGARDIEN/RHEINISCHE KANTOREI/DAS" ));
122123 }
123124
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+
124135}
You can’t perform that action at this time.
0 commit comments