@Test
public void testConstructLocks() throws IOException {

  ThemisLock expectLock = getPrimaryLock();
  List<KeyValue> kvs = new ArrayList<KeyValue>();
  kvs.add(getLockKv(KEYVALUE, ThemisLock.toByte(expectLock)));
  String rawClientLockTTL = conf.get(TransactionConstant.CLIENT_LOCK_TTL_KEY);
  int clientLockTTL = 10;
  Threads.sleep(clientLockTTL);
  Assert.assertTrue(System.currentTimeMillis() - expectLock.getTimestamp() > clientLockTTL);
  List<ThemisLock> locks = LockCleaner.constructLocks(TABLENAME, kvs, cpClient, clientLockTTL);
  Assert.assertEquals(1, locks.size());
  Assert.assertTrue(expectLock.equals(locks.get(0)));
  Assert.assertTrue(COLUMN.equals(locks.get(0).getColumn()));
  Assert.assertTrue(locks.get(0).isLockExpired());
  conf.set(TransactionConstant.CLIENT_LOCK_TTL_KEY, rawClientLockTTL != null ? rawClientLockTTL
      : "0");
  
  // with no-lock column, should throw exception
  kvs.add(KEYVALUE);
  try {
    LockCleaner.constructLocks(TABLENAME, kvs, cpClient, 0);
    Assert.fail();
  } catch (ThemisFatalException e) {}
}