package io.cameleer.server.app.license;

import org.junit.jupiter.api.Test;

import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

class LicenseRevalidationJobTest {

    @Test
    void daily_callsService() {
        LicenseService svc = mock(LicenseService.class);
        new LicenseRevalidationJob(svc).daily();
        verify(svc).revalidate();
    }

    @Test
    void daily_swallowsServiceException() {
        LicenseService svc = mock(LicenseService.class);
        doThrow(new RuntimeException("revalidate failed")).when(svc).revalidate();
        // No exception escapes
        new LicenseRevalidationJob(svc).daily();
        verify(svc).revalidate();
    }
}
