DefaultRetriableLockFactory implements RetriableLockFactory { @Override public RetriableLock generate(final Lock lock, final Locked locked) { return new RetriableLock(lock, retryTemplateConverter.construct(locked)); }  @Override RetriableLock generate(final Lock lock, final Locked locked);  }
@Test public void shouldGenerateRetriableLock() { when(retryTemplateConverter.construct(eq(locked))).thenReturn(retryTemplate); final var factory = new DefaultRetriableLockFactory(retryTemplateConverter); final var retriableLock = factory.generate(lock, locked); assertThat(retriableLock.getLock()).isEqualTo(lock); assertThat(retriableLock.getRetryTemplate()).isEqualTo(retryTemplate); }