Skip to content

Commit

Permalink
Update CommonBeans
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamza Jugon committed Nov 20, 2024
1 parent efca2c9 commit d16bc0a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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;
Expand All @@ -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() {
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit d16bc0a

Please sign in to comment.