From 4c45de2e5b37daef3fd90c1c9ff2fd31524a6fb6 Mon Sep 17 00:00:00 2001 From: Hamza Jugon Date: Thu, 21 Nov 2024 10:09:50 +0000 Subject: [PATCH] Remove extra deletion --- .../beekeeper/scheduler/apiary/service/SchedulerApiary.java | 4 +--- .../scheduler/apiary/service/SchedulerApiaryTest.java | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/beekeeper-scheduler-apiary/src/main/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiary.java b/beekeeper-scheduler-apiary/src/main/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiary.java index f6bbc707..5ddc31ab 100644 --- a/beekeeper-scheduler-apiary/src/main/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiary.java +++ b/beekeeper-scheduler-apiary/src/main/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiary.java @@ -72,12 +72,10 @@ public void scheduleBeekeeperEvent() { scheduler.scheduleForHousekeeping(entity); } catch (BeekeeperIcebergException e) { log.warn("Iceberg table are not supported in Beekeeper. Deleting message from queue", e); - beekeeperEventReader.delete(beekeeperEvent); } catch (Exception e) { throw new BeekeeperException(format( "Unable to schedule %s deletion for entity, this message will go back on the queue", - entity.getLifecycleType()), - e); + entity.getLifecycleType()), e); } } beekeeperEventReader.delete(beekeeperEvent); diff --git a/beekeeper-scheduler-apiary/src/test/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiaryTest.java b/beekeeper-scheduler-apiary/src/test/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiaryTest.java index 045d1827..6e2d1264 100644 --- a/beekeeper-scheduler-apiary/src/test/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiaryTest.java +++ b/beekeeper-scheduler-apiary/src/test/java/com/expediagroup/beekeeper/scheduler/apiary/service/SchedulerApiaryTest.java @@ -171,7 +171,7 @@ public void icebergValidatorThrowsException() { verify(icebergValidator).throwExceptionIfIceberg(databaseName, tableName); verifyNoInteractions(pathSchedulerService); verifyNoInteractions(tableSchedulerService); - verify(beekeeperEventReader, times(2)).delete(event.get()); // We need to fix this, we are deleting twice, not sure why + verify(beekeeperEventReader).delete(event.get()); } @Test