@Test public void getActiveDirectoryTimestamp() { var dateTime = LocalDateTime.of(2019, 1, 1, 13, 37); var expectedTimestamp = Long.toString(131_908_234_200_000_000L); var actualTimeStamp = ldapAdapter.getActiveDirectoryTimestamp(dateTime); assertThat(actualTimeStamp).isEqualTo(expectedTimestamp); }
String getActiveDirectoryTimestamp(@NonNull LocalDateTime dateTime) { var epochSec = dateTime.toEpochSecond(ZoneOffset.UTC); var epochNanos = epochSec * 1_000L * 10_000L; return Long.toString(epochNanos + EPOCH_OFFSET); }
LdapAdapter { String getActiveDirectoryTimestamp(@NonNull LocalDateTime dateTime) { var epochSec = dateTime.toEpochSecond(ZoneOffset.UTC); var epochNanos = epochSec * 1_000L * 10_000L; return Long.toString(epochNanos + EPOCH_OFFSET); } }
LdapAdapter { String getActiveDirectoryTimestamp(@NonNull LocalDateTime dateTime) { var epochSec = dateTime.toEpochSecond(ZoneOffset.UTC); var epochNanos = epochSec * 1_000L * 10_000L; return Long.toString(epochNanos + EPOCH_OFFSET); } @Autowired  LdapAdapter(LdapTemplate ldapTemplate, LdapConfigurationProperties properties, Clock clock); }
LdapAdapter { String getActiveDirectoryTimestamp(@NonNull LocalDateTime dateTime) { var epochSec = dateTime.toEpochSecond(ZoneOffset.UTC); var epochNanos = epochSec * 1_000L * 10_000L; return Long.toString(epochNanos + EPOCH_OFFSET); } @Autowired  LdapAdapter(LdapTemplate ldapTemplate, LdapConfigurationProperties properties, Clock clock); Collection<LdapUserNode> getAllUserNodes(); Map<String, byte[]> getThumbnailPhotos(@NonNull Collection<String> userIds); }
LdapAdapter { String getActiveDirectoryTimestamp(@NonNull LocalDateTime dateTime) { var epochSec = dateTime.toEpochSecond(ZoneOffset.UTC); var epochNanos = epochSec * 1_000L * 10_000L; return Long.toString(epochNanos + EPOCH_OFFSET); } @Autowired  LdapAdapter(LdapTemplate ldapTemplate, LdapConfigurationProperties properties, Clock clock); Collection<LdapUserNode> getAllUserNodes(); Map<String, byte[]> getThumbnailPhotos(@NonNull Collection<String> userIds);  }