aboutsummaryrefslogtreecommitdiffstats
path: root/format-common/src/test/kotlin/dev/msfjarvis/aps/util/time
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-07-15 00:53:48 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2022-07-15 01:13:47 +0530
commit549ee790d3e52bc62565ddf92e6a556e98b5195e (patch)
treed5758e5eb80093704e683c8da926838e18182588 /format-common/src/test/kotlin/dev/msfjarvis/aps/util/time
parent010c6e227c9cc27f4d01bc912311f977b2aeb3a7 (diff)
downloadHardenedPass-549ee790d3e52bc62565ddf92e6a556e98b5195e.tar.gz
HardenedPass-549ee790d3e52bc62565ddf92e6a556e98b5195e.zip
all: re-do package structure yet again
Diffstat (limited to 'format-common/src/test/kotlin/dev/msfjarvis/aps/util/time')
-rw-r--r--format-common/src/test/kotlin/dev/msfjarvis/aps/util/time/TestClocks.kt33
1 files changed, 0 insertions, 33 deletions
diff --git a/format-common/src/test/kotlin/dev/msfjarvis/aps/util/time/TestClocks.kt b/format-common/src/test/kotlin/dev/msfjarvis/aps/util/time/TestClocks.kt
deleted file mode 100644
index ee74a40d..00000000
--- a/format-common/src/test/kotlin/dev/msfjarvis/aps/util/time/TestClocks.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
- * SPDX-License-Identifier: GPL-3.0-only
- */
-
-package dev.msfjarvis.aps.util.time
-
-import java.time.Clock
-import java.time.Instant
-import java.time.ZoneId
-import java.time.ZoneOffset.UTC
-
-/**
- * Implementation of [UserClock] that is fixed to [Instant.EPOCH] for deterministic time-based tests
- */
-class TestUserClock(instant: Instant) : UserClock() {
-
- constructor() : this(Instant.EPOCH)
-
- private var clock = fixed(instant, UTC)
-
- override fun withZone(zone: ZoneId): Clock = clock.withZone(zone)
-
- override fun getZone(): ZoneId = UTC
-
- override fun instant(): Instant = clock.instant()
-
- companion object {
- fun withAddedSeconds(secondsToAdd: Long): TestUserClock {
- return TestUserClock(Instant.EPOCH.plusSeconds(secondsToAdd))
- }
- }
-}