Commit d1699aa2 authored by avocatier tac's avatar avocatier tac
Browse files

Unit test

parent 1905feda
Pipeline #238187 passed with stages
in 6 minutes and 55 seconds
......@@ -12,6 +12,7 @@ import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import fr.inria.clea.lsp.exception.CleaCryptoException;
import fr.inria.clea.lsp.exception.CleaEncryptionException;
// @ExtendWith(MockitoJUnitRunner.class)
public class LocationTest {
......@@ -81,6 +82,24 @@ public class LocationTest {
assertThat(lsp.getQrCodeValidityStartTime()).isNotEqualTo(newQrCodeValidityStartTime);
}
@Test
public void testWhenSettingQrCodeValidityStartTimeWithNoQrCodeRenewalIntervalThenQrValidityStartTimeUpdatedWhenNewPeriod() throws CleaEncryptionException {
int qrCodeRenewalIntervalExponentCompact = 0x1F;
int periodDuration = 3;
lsp = newLocationSpecificPart(qrCodeRenewalIntervalExponentCompact, periodDuration);
location = newLocation(locationContact, lsp);
location.setQrCodeValidityStartTime(periodStartTime, periodStartTime);
assertThat(lsp.getQrCodeValidityStartTime()).isEqualTo(periodStartTime);
periodStartTime = periodStartTime.plus(3, ChronoUnit.HOURS);
location.setPeriodStartTime(periodStartTime);
location.setQrCodeValidityStartTime(periodStartTime, periodStartTime);
assertThat(lsp.getQrCodeValidityStartTime()).isEqualTo(periodStartTime);
}
@Test
public void testNewDeepLink() throws CleaCryptoException {
int qrCodeRenewalIntervalExponentCompact = 2;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment