@Test
public void shouldRetryWhenFirstAttemptIsNotSuccessful() {

  when(lock.acquire(anyList(), anyString(), anyLong()))
    .thenReturn(null)
    .thenReturn("abc");
  final var retryTemplate = new RetryTemplate();
  retryTemplate.setRetryPolicy(new SimpleRetryPolicy(2));
  final var retriableLock = new RetriableLock(lock, retryTemplate);
  final var token = retriableLock.acquire(List.of("key"), "defaultStore", 1000L);
  assertThat(token).isEqualTo("abc");
  verify(lock, times(2)).acquire(anyList(), anyString(), anyLong());
}