@@ -64,36 +64,4 @@ public void testDanglingDeleteFilesShouldExecuteAfterInterval() {
6464 // 5 hours ago - should not execute
6565 Assert .assertFalse (executor .shouldExecute (now - Duration .ofHours (5 ).toMillis ()));
6666 }
67-
68- @ Test
69- public void testSnapshotsExpiringDefaultInterval () {
70- Duration interval = Duration .ofHours (1 );
71- SnapshotsExpiringExecutor executor = new SnapshotsExpiringExecutor (null , 1 , interval );
72-
73- TableRuntime tableRuntime = Mockito .mock (TableRuntime .class );
74- Assert .assertEquals (
75- Duration .ofHours (1 ).toMillis (), executor .getNextExecutingTime (tableRuntime ));
76- }
77-
78- @ Test
79- public void testSnapshotsExpiringCustomInterval () {
80- Duration interval = Duration .ofMinutes (30 );
81- SnapshotsExpiringExecutor executor = new SnapshotsExpiringExecutor (null , 1 , interval );
82-
83- TableRuntime tableRuntime = Mockito .mock (TableRuntime .class );
84- Assert .assertEquals (
85- Duration .ofMinutes (30 ).toMillis (), executor .getNextExecutingTime (tableRuntime ));
86- }
87-
88- @ Test
89- public void testSnapshotsExpiringShouldExecuteAfterInterval () {
90- Duration interval = Duration .ofHours (2 );
91- SnapshotsExpiringExecutor executor = new SnapshotsExpiringExecutor (null , 1 , interval );
92-
93- long now = System .currentTimeMillis ();
94- // 3 hours ago - should execute
95- Assert .assertTrue (executor .shouldExecute (now - Duration .ofHours (3 ).toMillis ()));
96- // 1 hour ago - should not execute
97- Assert .assertFalse (executor .shouldExecute (now - Duration .ofHours (1 ).toMillis ()));
98- }
9967}
0 commit comments