EmptySystemUserProvider implements SystemUserProvider { @Override public Optional<UUID> getContextSystemUserId() { logger.error("Could not fetch system user. system-users-library not available in the classpath"); return empty(); }  @Override Optional<UUID> getContextSystemUserId();  }
@Test public void shouldReturnEmptyOptional() throws Exception { assertThat(provider.getContextSystemUserId(), is(Optional.empty())); }
@Test public void shouldLogError() { provider.getContextSystemUserId(); verify(logger).error("Could not fetch system user. system-users-library not available in the classpath"); }