Skip to content

Commit

Permalink
cleanup 2
Browse files Browse the repository at this point in the history
  • Loading branch information
javsanbel2 committed Nov 20, 2024
1 parent 9bbd52d commit 1e339c9
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import com.google.common.collect.Lists;

import com.expediagroup.beekeeper.cleanup.path.PathCleaner;
import com.expediagroup.beekeeper.core.checker.IcebergTableChecker;
import com.expediagroup.beekeeper.core.model.HousekeepingPath;
import com.expediagroup.beekeeper.core.model.HousekeepingStatus;
import com.expediagroup.beekeeper.core.model.PeriodDuration;
Expand All @@ -75,10 +74,9 @@ public class PagingCleanupServiceTest {
private @Autowired HousekeepingPathRepository housekeepingPathRepository;
private @MockBean PathCleaner pathCleaner;

private @MockBean IcebergTableChecker icebergTableChecker;
@Test
public void typicalWithPaging() {
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner, icebergTableChecker);
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner);
pagingCleanupService = new PagingPathCleanupService(List.of(handler), 2, false);

List<String> paths = List.of("s3://bucket/some_foo", "s3://bucket/some_bar", "s3://bucket/some_foobar");
Expand All @@ -99,7 +97,7 @@ public void typicalWithPaging() {

@Test
public void mixOfScheduledAndFailedPaths() {
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner, icebergTableChecker);
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner);
pagingCleanupService = new PagingPathCleanupService(List.of(handler), 2, false);
List<HousekeepingPath> paths = List
.of(createEntityHousekeepingPath("s3://bucket/some_foo", SCHEDULED),
Expand All @@ -115,7 +113,7 @@ public void mixOfScheduledAndFailedPaths() {

@Test
public void mixOfAllPaths() {
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner, icebergTableChecker);
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner);
pagingCleanupService = new PagingPathCleanupService(List.of(handler), 2, false);
List<HousekeepingPath> paths = List
.of(createEntityHousekeepingPath("s3://bucket/some_foo", SCHEDULED),
Expand All @@ -132,7 +130,7 @@ public void mixOfAllPaths() {

@Test
void pathCleanerException() {
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner, icebergTableChecker);
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner);
pagingCleanupService = new PagingPathCleanupService(List.of(handler), 2, false);

doThrow(new RuntimeException("Error")).doNothing().when(pathCleaner).cleanupPath(any(HousekeepingPath.class));
Expand Down Expand Up @@ -160,7 +158,7 @@ void pathCleanerException() {
@Test
@Timeout(value = 10)
void doNotInfiniteLoopOnRepeatedFailures() {
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner, icebergTableChecker);
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner);
pagingCleanupService = new PagingPathCleanupService(List.of(handler), 1, false);
List<HousekeepingPath> paths = List
.of(createEntityHousekeepingPath("s3://bucket/some_foo", FAILED),
Expand Down Expand Up @@ -188,7 +186,7 @@ void doNotInfiniteLoopOnRepeatedFailures() {
@Test
@Timeout(value = 10)
void doNotInfiniteLoopOnDryRunCleanup() {
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner, icebergTableChecker);
UnreferencedPathHandler handler = new UnreferencedPathHandler(housekeepingPathRepository, pathCleaner);
pagingCleanupService = new PagingPathCleanupService(List.of(handler), 1, true);
List<HousekeepingPath> paths = List
.of(createEntityHousekeepingPath("s3://bucket/some_foo", SCHEDULED),
Expand Down

0 comments on commit 1e339c9

Please sign in to comment.