use of com.enonic.xp.core.internal.concurrent.RecurringJob in project xp by enonic.
the class UdcServiceTest method testLifecycle.
@Test
void testLifecycle() {
UdcScheduler udcSchedulerMock = mock(UdcScheduler.class);
UdcConfig config = mock(UdcConfig.class);
final RecurringJob recurringJob = mock(RecurringJob.class);
when(config.url()).thenReturn("http://localhost:8080");
when(udcSchedulerMock.scheduleWithFixedDelay(notNull())).thenReturn(recurringJob);
UdcService service = new UdcService(udcSchedulerMock, config);
service.activate();
verify(udcSchedulerMock).scheduleWithFixedDelay(notNull());
service.deactivate();
verify(recurringJob).cancel();
}
Aggregations