diff --git a/beekeeper-path-cleanup/src/main/java/com/expediagroup/beekeeper/path/cleanup/context/CommonBeans.java b/beekeeper-path-cleanup/src/main/java/com/expediagroup/beekeeper/path/cleanup/context/CommonBeans.java index 0b118243..911fe3d8 100644 --- a/beekeeper-path-cleanup/src/main/java/com/expediagroup/beekeeper/path/cleanup/context/CommonBeans.java +++ b/beekeeper-path-cleanup/src/main/java/com/expediagroup/beekeeper/path/cleanup/context/CommonBeans.java @@ -40,6 +40,7 @@ import com.expediagroup.beekeeper.cleanup.service.CleanupService; import com.expediagroup.beekeeper.cleanup.service.DisableTablesService; import com.expediagroup.beekeeper.cleanup.service.RepositoryCleanupService; +import com.expediagroup.beekeeper.cleanup.validation.IcebergValidator; import com.expediagroup.beekeeper.core.repository.HousekeepingPathRepository; import com.expediagroup.beekeeper.path.cleanup.handler.GenericPathHandler; import com.expediagroup.beekeeper.path.cleanup.service.PagingPathCleanupService; @@ -85,8 +86,9 @@ public S3Client s3Client(AmazonS3 amazonS3, @Value("${properties.dry-run-enabled @Bean(name = "s3PathCleaner") PathCleaner pathCleaner( S3Client s3Client, - BytesDeletedReporter bytesDeletedReporter) { - return new S3PathCleaner(s3Client, new S3SentinelFilesCleaner(s3Client), bytesDeletedReporter); + BytesDeletedReporter bytesDeletedReporter, + IcebergValidator icebergValidator) { + return new S3PathCleaner(s3Client, new S3SentinelFilesCleaner(s3Client), bytesDeletedReporter, icebergValidator); } @Bean diff --git a/beekeeper-path-cleanup/src/test/java/com/expediagroup/beekeeper/path/cleanup/context/CommonBeansTest.java b/beekeeper-path-cleanup/src/test/java/com/expediagroup/beekeeper/path/cleanup/context/CommonBeansTest.java index a6667b73..4db85925 100644 --- a/beekeeper-path-cleanup/src/test/java/com/expediagroup/beekeeper/path/cleanup/context/CommonBeansTest.java +++ b/beekeeper-path-cleanup/src/test/java/com/expediagroup/beekeeper/path/cleanup/context/CommonBeansTest.java @@ -1,5 +1,5 @@ /** - * Copyright (C) 2019-2021 Expedia, Inc. + * Copyright (C) 2019-2024 Expedia, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ import com.expediagroup.beekeeper.cleanup.service.CleanupService; import com.expediagroup.beekeeper.cleanup.service.DisableTablesService; import com.expediagroup.beekeeper.cleanup.service.RepositoryCleanupService; +import com.expediagroup.beekeeper.cleanup.validation.IcebergValidator; import com.expediagroup.beekeeper.core.repository.HousekeepingPathRepository; import com.expediagroup.beekeeper.path.cleanup.service.PagingPathCleanupService; import com.expediagroup.beekeeper.path.cleanup.service.PathRepositoryCleanupService; @@ -59,6 +60,7 @@ class CommonBeansTest { private final CommonBeans commonBeans = new CommonBeans(); private @Mock HousekeepingPathRepository repository; private @Mock BytesDeletedReporter bytesDeletedReporter; + private @Mock IcebergValidator icebergValidator; @BeforeEach void setUp() { @@ -100,7 +102,7 @@ void verifyS3pathCleaner() { S3Client s3Client = commonBeans.s3Client(commonBeans.amazonS3(), dryRunEnabled); MeterRegistry meterRegistry = mock(GraphiteMeterRegistry.class); - PathCleaner pathCleaner = commonBeans.pathCleaner(s3Client, bytesDeletedReporter); + PathCleaner pathCleaner = commonBeans.pathCleaner(s3Client, bytesDeletedReporter, icebergValidator); assertThat(pathCleaner).isInstanceOf(S3PathCleaner.class); }