@VisibleForTesting
  void notifyTokenExpiration() {
    try {
      // Avoid notification multiple times in case of data center edition
      if (!lockManager.tryLock(LOCK_NAME, LOCK_DURATION)) {
        return;
      }
      notificationSender.sendNotifications();
    } catch (RuntimeException e) {
      LOG.error("Error in sending token expiration notification", e);
    }
  }
@Test
  public void log_error_if_exception_in_sending_notification() {
    when(lockManager.tryLock(anyString(), anyInt())).thenReturn(true);
    doThrow(new IllegalStateException()).when(notificationSender).sendNotifications();
    underTest.notifyTokenExpiration();
    assertThat(logTester.getLogs(LoggerLevel.ERROR))
      .extracting(LogAndArguments::getFormattedMsg)
      .containsExactly("Error in sending token expiration notification");
  }