Skip to content

Commit

Permalink
fix leninet
Browse files Browse the repository at this point in the history
  • Loading branch information
javsanbel2 committed Nov 27, 2024
1 parent 07174b2 commit 58c6e65
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
Expand All @@ -39,6 +37,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;

import com.expedia.apiary.extensions.receiver.common.messaging.MessageEvent;
Expand Down Expand Up @@ -88,7 +87,6 @@ public void typicalTableSchedule() {
Optional<BeekeeperEvent> event = Optional.of(newHousekeepingEvent(table, EXPIRED));
when(beekeeperEventReader.read()).thenReturn(event);
scheduler.scheduleBeekeeperEvent();

verify(tableSchedulerService).scheduleForHousekeeping(table);
verifyNoInteractions(pathSchedulerService);
verify(beekeeperEventReader).delete(event.get());
Expand All @@ -98,7 +96,6 @@ public void typicalTableSchedule() {
public void typicalNoSchedule() {
when(beekeeperEventReader.read()).thenReturn(Optional.empty());
scheduler.scheduleBeekeeperEvent();

verifyNoInteractions(pathSchedulerService);
verifyNoInteractions(tableSchedulerService);
verify(beekeeperEventReader, times(0)).delete(any());
Expand Down Expand Up @@ -152,9 +149,7 @@ public void typicalClose() throws Exception {

private BeekeeperEvent newHousekeepingEvent(HousekeepingEntity housekeepingEntity,
LifecycleEventType lifecycleEventType) {
lenient().when(housekeepingEntity.getLifecycleType()).thenReturn(lifecycleEventType.name());
when(housekeepingEntity.getDatabaseName()).thenReturn("database");
when(housekeepingEntity.getTableName()).thenReturn("table");
return new BeekeeperEvent(List.of(housekeepingEntity), mock(MessageEvent.class));
when(housekeepingEntity.getLifecycleType()).thenReturn(lifecycleEventType.name());
return new BeekeeperEvent(List.of(housekeepingEntity), Mockito.mock(MessageEvent.class));
}
}

0 comments on commit 58c6e65

Please sign in to comment.