PurgeConfiguration conf = new PurgeConfiguration(1L, new String[0], 30);
PurgeDao purgeDao = mock(PurgeDao.class);
when(purgeDao.purge(conf)).thenThrow(new RuntimeException());
Settings settings = new Settings(new PropertyDefinitions(DbCleanerProperties.all()));
settings.setProperty(CoreProperties.PROFILING_LOG_PROPERTY, true);
PurgeProfiler profiler = mock(PurgeProfiler.class);
DefaultPurgeTask task = new DefaultPurgeTask(purgeDao, resourceDao, settings, mock(DefaultPeriodCleaner.class), profiler);
task.purge(1L);
verify(profiler).dump(anyLong(), any(Logger.class));