From c8f3010e5b72e20744d7b28ad9b282fa1fd0106b Mon Sep 17 00:00:00 2001 From: jgreenstevens Date: Mon, 25 Nov 2024 17:46:19 +0000 Subject: [PATCH] Integration tests --- .../integration/BeekeeperMetadataCleanupIntegrationTest.java | 4 +--- .../integration/BeekeeperPathCleanupIntegrationTest.java | 4 +--- ...keeperUnreferencedPathSchedulerApiaryIntegrationTest.java | 5 ++--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperMetadataCleanupIntegrationTest.java b/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperMetadataCleanupIntegrationTest.java index b2eeda28..e2c3942e 100644 --- a/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperMetadataCleanupIntegrationTest.java +++ b/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperMetadataCleanupIntegrationTest.java @@ -26,9 +26,7 @@ import static com.expediagroup.beekeeper.cleanup.monitoring.DeletedMetadataReporter.METRIC_NAME; import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.DELETED; import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.DISABLED; -import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.SCHEDULED; import static com.expediagroup.beekeeper.core.model.LifecycleEventType.EXPIRED; -import static com.expediagroup.beekeeper.core.model.LifecycleEventType.UNREFERENCED; import static com.expediagroup.beekeeper.integration.CommonTestVariables.AWS_REGION; import static com.expediagroup.beekeeper.integration.CommonTestVariables.DATABASE_NAME_VALUE; import static com.expediagroup.beekeeper.integration.CommonTestVariables.LONG_CLEANUP_DELAY_VALUE; @@ -386,7 +384,7 @@ public void testEventAddedToHistoryTable() throws TException, SQLException { assertThat(metastoreClient.tableExists(DATABASE_NAME_VALUE, TABLE_NAME_VALUE)).isFalse(); assertThat(amazonS3.doesObjectExist(BUCKET, UNPARTITIONED_OBJECT_KEY)).isFalse(); - List beekeeperHistory = getBeekeeperHistory(UNREFERENCED); + List beekeeperHistory = getBeekeeperHistory(EXPIRED); BeekeeperHistory history = beekeeperHistory.get(0); assertThat(history.getDatabaseName()).isEqualTo(DATABASE_NAME_VALUE); assertThat(history.getTableName()).isEqualTo(TABLE_NAME_VALUE); diff --git a/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperPathCleanupIntegrationTest.java b/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperPathCleanupIntegrationTest.java index af0bbd7f..8f4c4c17 100644 --- a/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperPathCleanupIntegrationTest.java +++ b/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperPathCleanupIntegrationTest.java @@ -21,8 +21,6 @@ import static com.expediagroup.beekeeper.cleanup.monitoring.BytesDeletedReporter.METRIC_NAME; import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.DELETED; -import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.SCHEDULED; -import static com.expediagroup.beekeeper.core.model.LifecycleEventType.EXPIRED; import static com.expediagroup.beekeeper.core.model.LifecycleEventType.UNREFERENCED; import static com.expediagroup.beekeeper.integration.CommonTestVariables.AWS_REGION; import static com.expediagroup.beekeeper.integration.CommonTestVariables.DATABASE_NAME_VALUE; @@ -268,7 +266,7 @@ public void testEventAddedToHistoryTable() throws SQLException { BeekeeperHistory history = beekeeperHistory.get(0); assertThat(history.getDatabaseName()).isEqualTo(DATABASE_NAME_VALUE); assertThat(history.getTableName()).isEqualTo(TABLE_NAME_VALUE); - assertThat(history.getLifecycleType()).isEqualTo(EXPIRED.toString()); + assertThat(history.getLifecycleType()).isEqualTo(UNREFERENCED.toString()); assertThat(history.getHousekeepingStatus()).isEqualTo(DELETED.name()); } diff --git a/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperUnreferencedPathSchedulerApiaryIntegrationTest.java b/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperUnreferencedPathSchedulerApiaryIntegrationTest.java index 4c311174..9d3678d1 100644 --- a/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperUnreferencedPathSchedulerApiaryIntegrationTest.java +++ b/beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/BeekeeperUnreferencedPathSchedulerApiaryIntegrationTest.java @@ -20,7 +20,6 @@ import static org.testcontainers.containers.localstack.LocalStackContainer.Service.SQS; import static com.expediagroup.beekeeper.core.model.HousekeepingStatus.SCHEDULED; -import static com.expediagroup.beekeeper.core.model.LifecycleEventType.EXPIRED; import static com.expediagroup.beekeeper.core.model.LifecycleEventType.UNREFERENCED; import static com.expediagroup.beekeeper.integration.CommonTestVariables.AWS_REGION; import static com.expediagroup.beekeeper.integration.CommonTestVariables.CLEANUP_ATTEMPTS_VALUE; @@ -159,7 +158,7 @@ public void unreferencedAlterPartitionEvent() throws SQLException, IOException, public void unreferencedMultipleAlterPartitionEvent() throws IOException, SQLException, URISyntaxException { List .of(new AlterPartitionSqsMessage("s3://bucket/table/expiredTableLocation", - "s3://bucket/table/partitionLocation", "s3://bucket/table/unreferencedPartitionLocation", true, true), + "s3://bucket/table/partitionLocation", "s3://bucket/table/unreferencedPartitionLocation", true, true), new AlterPartitionSqsMessage("s3://bucket/table/expiredTableLocation2", "s3://bucket/table/partitionLocation2", "s3://bucket/table/partitionLocation", true, true)) .forEach(msg -> amazonSQS.sendMessage(sendMessageRequest(msg.getFormattedString()))); @@ -210,7 +209,7 @@ public void testEventAddedToHistoryTable() throws IOException, URISyntaxExceptio BeekeeperHistory history = beekeeperHistory.get(0); assertThat(history.getDatabaseName()).isEqualTo(DATABASE_NAME_VALUE); assertThat(history.getTableName()).isEqualTo(TABLE_NAME_VALUE); - assertThat(history.getLifecycleType()).isEqualTo(EXPIRED.toString()); + assertThat(history.getLifecycleType()).isEqualTo(UNREFERENCED.toString()); assertThat(history.getHousekeepingStatus()).isEqualTo(SCHEDULED.name()); }