@Test
public void should_reload_credentials() throws Exception {

    FileBasedUserRepository<StdUser> repo = newRepo(true);
    Files.copy(getClass().getResourceAsStream("credentials.json"), credentialsPath, StandardCopyOption.REPLACE_EXISTING);
    assertThat(repo.findCredentialByUserName("john")).isEqualTo(Optional.of("johnpwd"));
    Thread.sleep(1000); // sleep enough to make sure timestamp changes
    Files.copy(getClass().getResourceAsStream("credentials2.json"), credentialsPath, StandardCopyOption.REPLACE_EXISTING);
    assertThat(repo.findCredentialByUserName("john")).isEqualTo(Optional.of("johnpwd2"));
}