@Override
  public boolean tryLock(String name) {
    return tryLock(name, DEFAULT_LOCK_DURATION_SECONDS);
  }
@Test
  @UseDataProvider("randomValidDuration")
  public void tryLock_with_duration_delegates_to_InternalPropertiesDao_and_commits(int randomValidDuration) {
    String lockName = "foo";
    boolean expected = new Random().nextBoolean();
    when(internalPropertiesDao.tryLock(dbSession, lockName, randomValidDuration))
      .thenReturn(expected);

    assertThat(underTest.tryLock(lockName, randomValidDuration)).isEqualTo(expected);

    verify(dbClient).openSession(false);
    verify(internalPropertiesDao).tryLock(dbSession, lockName, randomValidDuration);
    verify(dbSession).commit();
    verifyNoMoreInteractions(internalPropertiesDao);
  }