### Question:
JsonCredentialsProvider implements AWSCredentialsProvider { @Override public void refresh() { if (jsonConfigFile != null) { jsonConfigFile.refresh(); lastRefreshed = System.nanoTime(); } } JsonCredentialsProvider();  JsonCredentialsProvider(String jsonConfigFilePath);  JsonCredentialsProvider(JsonConfigFile jsonConfigFile); @Override AWSCredentials getCredentials(); @Override void refresh(); long getRefreshIntervalNanos(); void setRefreshIntervalNanos(long refreshIntervalNanos); long getRefreshForceIntervalNanos(); void setRefreshForceIntervalNanos(long refreshForceIntervalNanos); @Override String toString();  }### Answer:
@Test public void testRefresh() throws Exception { File modifiable = File.createTempFile("UpdatableCredentials", ".json"); copyFile(JsonResourceLoader.basicCredentials().asFile(), modifiable); JsonCredentialsProvider testProvider = new JsonCredentialsProvider(modifiable.getPath()); JsonCredentials credentials = (JsonCredentials) testProvider.getCredentials(); Assert.assertEquals("vaws_access_key_id", credentials.getAWSAccessKeyId()); Assert.assertEquals("vaws_secret_access_key", credentials.getAWSSecretKey()); Thread.sleep(1000); copyFile(JsonResourceLoader.basicCredentials2().asFile(), modifiable); testProvider.setRefreshIntervalNanos(1l); JsonCredentials updated = (JsonCredentials) testProvider.getCredentials(); Assert.assertEquals("vaws_access_key_id_2", updated.getAWSAccessKeyId()); Assert.assertEquals("vaws_secret_access_key_2", updated.getAWSSecretKey()); }