@Test(expected = ConstraintViolationException.class)
public void shouldFailUniqueConstraint() {
this.g.tx().readWrite();
final Schema schema = this.g.getBaseGraph().schema();
schema.constraintFor(DynamicLabel.label("Person")).assertPropertyIsUnique("name").create();
this.g.tx().commit();
this.g.addVertex(T.label, "Person", "name", "marko");
this.g.tx().commit();
assertEquals("marko", g.V().<Vertex>has(T.label, "Person").<Vertex>has("name", "marko").next().value("name"));
this.g.addVertex(T.label, "Person", "name", "marko");