@Test public void ifGetFreshTimestampThrowsReturnsEmpty() { when(timelockRpcClient.getFreshTimestamps(any(), eq(CLIENT), any())).thenThrow(new RuntimeException()); assertThat(timeLockActivityChecker.getFreshTimestampFromNodeForClient(CLIENT)).isEmpty(); }
public OptionalLong getFreshTimestampFromNodeForClient(String client) { try { return OptionalLong.of(conjureTimelockService.getFreshTimestamps( AUTH_HEADER, client, ConjureGetFreshTimestampsRequest.of(1)).getInclusiveLower()); } catch (Exception e) { log.info("Suppressed exception when checking TimeLock activity for client {}", SafeArg.of("client", client), e); return OptionalLong.empty(); } }
TimeLockActivityChecker { public OptionalLong getFreshTimestampFromNodeForClient(String client) { try { return OptionalLong.of(conjureTimelockService.getFreshTimestamps( AUTH_HEADER, client, ConjureGetFreshTimestampsRequest.of(1)).getInclusiveLower()); } catch (Exception e) { log.info("Suppressed exception when checking TimeLock activity for client {}", SafeArg.of("client", client), e); return OptionalLong.empty(); } } }
TimeLockActivityChecker { public OptionalLong getFreshTimestampFromNodeForClient(String client) { try { return OptionalLong.of(conjureTimelockService.getFreshTimestamps( AUTH_HEADER, client, ConjureGetFreshTimestampsRequest.of(1)).getInclusiveLower()); } catch (Exception e) { log.info("Suppressed exception when checking TimeLock activity for client {}", SafeArg.of("client", client), e); return OptionalLong.empty(); } } TimeLockActivityChecker(ConjureTimelockService conjureTimelockService); }
TimeLockActivityChecker { public OptionalLong getFreshTimestampFromNodeForClient(String client) { try { return OptionalLong.of(conjureTimelockService.getFreshTimestamps( AUTH_HEADER, client, ConjureGetFreshTimestampsRequest.of(1)).getInclusiveLower()); } catch (Exception e) { log.info("Suppressed exception when checking TimeLock activity for client {}", SafeArg.of("client", client), e); return OptionalLong.empty(); } } TimeLockActivityChecker(ConjureTimelockService conjureTimelockService); OptionalLong getFreshTimestampFromNodeForClient(String client); }
TimeLockActivityChecker { public OptionalLong getFreshTimestampFromNodeForClient(String client) { try { return OptionalLong.of(conjureTimelockService.getFreshTimestamps( AUTH_HEADER, client, ConjureGetFreshTimestampsRequest.of(1)).getInclusiveLower()); } catch (Exception e) { log.info("Suppressed exception when checking TimeLock activity for client {}", SafeArg.of("client", client), e); return OptionalLong.empty(); } } TimeLockActivityChecker(ConjureTimelockService conjureTimelockService); OptionalLong getFreshTimestampFromNodeForClient(String client);  }