@Test
public void testPutWithTtlFileMeta() throws Exception {

  // arrange
  S3AFileStatus fileStatus = mock(S3AFileStatus.class);
  when(fileStatus.getPath()).thenReturn(new Path("/"));
  PathMetadata pm = new PathMetadata(fileStatus);
  MetadataStore ms = spy(MetadataStore.class);
  ITtlTimeProvider timeProvider =
      mock(ITtlTimeProvider.class);
  when(timeProvider.getNow()).thenReturn(100L);
  // act
  S3Guard.putWithTtl(ms, pm, timeProvider, null);
  // assert
  assertEquals("last update in " + pm, 100L, pm.getLastUpdated());
  verify(timeProvider, times(1)).getNow();
  verify(ms, times(1)).put(pm, null);
}