### Question:
ServiceLevelBasedVideoTtlResolver implements VideoTtlResolver { @Override public long resolveTtlInSeconds(UUID placeId, boolean isStream) { if(isStream) { return defaultStreamTtl; }else{ return getTtlInSecondsByPlace(placeId); } } @Inject  ServiceLevelBasedVideoTtlResolver(PlaceServiceLevelCache placeServiceLevelCache, VideoDaoConfig config); @Override long resolveTtlInSeconds(UUID placeId, boolean isStream);  }### Answer:
@Test public void testResolveTtlInSeconds() { UUID placeId = UUID.randomUUID(); if(!stream) { EasyMock.expect(mockPlaceDao.getServiceLevelById(placeId)).andReturn(serviceLevel); } replay(); long ttl = ttlResolver.resolveTtlInSeconds(placeId, stream); assertEquals(TimeUnit.DAYS.toSeconds(expectedExpirationInDays)+TimeUnit.MILLISECONDS.toSeconds(config.getPurgeDelay()), ttl); verify(); }