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 92a3d0c0..af66ac2e 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 @@ -45,6 +45,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.testcontainers.containers.localstack.LocalStackContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; @@ -66,11 +67,14 @@ import com.expediagroup.beekeeper.integration.utils.ContainerTestUtils; import com.expediagroup.beekeeper.scheduler.apiary.BeekeeperSchedulerApiary; +import com.hotels.beeju.extensions.ThriftHiveMetaStoreJUnitExtension; + @Testcontainers public class BeekeeperUnreferencedPathSchedulerApiaryIntegrationTest extends BeekeeperIntegrationTestBase { private static final int TIMEOUT = 5; private static final String APIARY_QUEUE_URL_PROPERTY = "properties.apiary.queue-url"; + private static final String DRY_RUN_ENABLED_PROPERTY = "properties.dry-run-enabled"; private static final String QUEUE = "apiary-receiver-queue"; private static final String SCHEDULED_ORPHANED_METRIC = "paths-scheduled"; @@ -81,6 +85,10 @@ public class BeekeeperUnreferencedPathSchedulerApiaryIntegrationTest extends Bee private static final LocalStackContainer SQS_CONTAINER = ContainerTestUtils.awsContainer(SQS); private static AmazonSQS amazonSQS; + @RegisterExtension + public ThriftHiveMetaStoreJUnitExtension thriftHiveMetaStore = new ThriftHiveMetaStoreJUnitExtension( + DATABASE_NAME_VALUE); + @BeforeAll public static void init() { String queueUrl = ContainerTestUtils.queueUrl(SQS_CONTAINER, QUEUE); @@ -93,12 +101,17 @@ public static void init() { @AfterAll public static void teardown() { System.clearProperty(APIARY_QUEUE_URL_PROPERTY); + System.clearProperty("properties.metastore-uri"); + System.clearProperty("properties.dry-run-enabled"); amazonSQS.shutdown(); } @BeforeEach public void setup() { + System.setProperty("properties.metastore-uri", thriftHiveMetaStore.getThriftConnectionUri()); + System.setProperty("properties.dry-run-enabled", "false"); + amazonSQS.purgeQueue(new PurgeQueueRequest(ContainerTestUtils.queueUrl(SQS_CONTAINER, QUEUE))); executorService.execute(() -> BeekeeperSchedulerApiary.main(new String[] {})); await().atMost(Duration.ONE_MINUTE).until(BeekeeperSchedulerApiary::isRunning); @@ -108,6 +121,9 @@ public void setup() { public void stop() throws InterruptedException { BeekeeperSchedulerApiary.stop(); executorService.awaitTermination(5, TimeUnit.SECONDS); + + System.clearProperty("properties.metastore-uri"); + System.clearProperty("properties.dry-run-enabled"); } @Test