@Test
  public void shouldAcquireSchemaReadLockBeforeRetrievingConstraintsByLabelAndProperty()
      throws Exception {
    // given
    SchemaReadOperations delegate = mock(SchemaReadOperations.class);
    @SuppressWarnings("unchecked")
    Iterator<UniquenessConstraint> constraints = mock(Iterator.class);
    when(delegate.constraintsGetForLabelAndPropertyKey(state, 123, 456)).thenReturn(constraints);

    LockingStatementOperations context = new LockingStatementOperations(null, delegate, null, null);

    // when
    Iterator<UniquenessConstraint> result =
        context.constraintsGetForLabelAndPropertyKey(state, 123, 456);

    // then
    assertEquals(constraints, result);
    InOrder order = inOrder(lockHolder, delegate);
    order.verify(lockHolder).acquireSchemaReadLock();
    order.verify(delegate).constraintsGetForLabelAndPropertyKey(state, 123, 456);
    verifyNoMoreInteractions(lockHolder, delegate);
  }