Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
UBaggeler committed Mar 18, 2021
1 parent a0b4a84 commit 418012c
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
import static org.dpppt.backend.sdk.utils.EfgsDsosUtil.DSOS_SYMPTOMATIC_UNKNOWN_ONSET_ZERO_POINT;
import static org.junit.Assert.assertEquals;

import java.io.IOException;
import java.time.Clock;
import java.time.ZoneOffset;
import org.dpppt.backend.sdk.model.gaen.GaenKey;
import org.dpppt.backend.sdk.model.gaen.GaenKeyForInterops;
import org.junit.jupiter.api.Test;

public class EfgsDsosUtilTest {
@Test
void testDsosMapping(){
void testDsosMapping() {
var now = UTCInstant.now();

testWithSubmissionTime(now.atStartOfDay().plusHours(1));
Expand All @@ -28,22 +25,28 @@ void testWithSubmissionTime(UTCInstant submissionTime) {
submissionDateKey.setRollingStartNumber(
(int) submissionTime.atStartOfDay().get10MinutesSince1970());

assertEquals(DSOS_SYMPTOMATIC_UNKNOWN_ONSET_ZERO_POINT, EfgsDsosUtil.calculateDefaultDsosMapping(submissionDateKey));
assertEquals(
DSOS_SYMPTOMATIC_UNKNOWN_ONSET_ZERO_POINT,
EfgsDsosUtil.calculateDefaultDsosMapping(submissionDateKey));

GaenKeyForInterops submissionPlus3Key = new GaenKeyForInterops();
submissionPlus3Key.setGaenKey(new GaenKey());
submissionPlus3Key.setReceivedAt(submissionTime);
submissionPlus3Key.setRollingStartNumber(
(int) submissionTime.plusDays(3).atStartOfDay().get10MinutesSince1970());

assertEquals(DSOS_SYMPTOMATIC_UNKNOWN_ONSET_ZERO_POINT + 3, EfgsDsosUtil.calculateDefaultDsosMapping(submissionPlus3Key));
assertEquals(
DSOS_SYMPTOMATIC_UNKNOWN_ONSET_ZERO_POINT + 3,
EfgsDsosUtil.calculateDefaultDsosMapping(submissionPlus3Key));

GaenKeyForInterops submissionMinus10Key = new GaenKeyForInterops();
submissionMinus10Key.setGaenKey(new GaenKey());
submissionMinus10Key.setReceivedAt(submissionTime);
submissionMinus10Key.setRollingStartNumber(
(int) submissionTime.minusDays(10).atStartOfDay().get10MinutesSince1970());

assertEquals(DSOS_SYMPTOMATIC_UNKNOWN_ONSET_ZERO_POINT - 10, EfgsDsosUtil.calculateDefaultDsosMapping(submissionMinus10Key));
assertEquals(
DSOS_SYMPTOMATIC_UNKNOWN_ONSET_ZERO_POINT - 10,
EfgsDsosUtil.calculateDefaultDsosMapping(submissionMinus10Key));
}
}

0 comments on commit 418012c

Please sign in to comment.