use of org.neo4j.internal.schema.constraints.UniquenessConstraintDescriptor in project neo4j by neo4j.
the class TxStateTest method shouldDifferentiateBetweenUniquenessConstraintsForDifferentLabels.
@Test
void shouldDifferentiateBetweenUniquenessConstraintsForDifferentLabels() {
// when
LabelSchemaDescriptor schema1 = forLabel(1, 17);
UniquenessConstraintDescriptor constraint1 = ConstraintDescriptorFactory.uniqueForSchema(schema1);
state.constraintDoAdd(constraint1, IndexPrototype.uniqueForSchema(schema1).withName("constraint_7").materialise(7));
LabelSchemaDescriptor schema2 = forLabel(2, 17);
UniquenessConstraintDescriptor constraint2 = ConstraintDescriptorFactory.uniqueForSchema(schema2);
state.constraintDoAdd(constraint2, IndexPrototype.uniqueForSchema(schema2).withName("constraint_19").materialise(19));
// then
assertEquals(singleton(constraint1), state.constraintsChangesForLabel(1).getAdded());
assertEquals(singleton(constraint2), state.constraintsChangesForLabel(2).getAdded());
}
Aggregations