Extracted Instant.nowExt()
This commit is contained in:
parent
bd18644c0d
commit
113b817627
|
@ -1,7 +1,7 @@
|
|||
package net.codinux.banking.fints
|
||||
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.datetime.LocalDate
|
||||
import net.codinux.log.logger
|
||||
import net.codinux.banking.fints.messages.MessageBuilder
|
||||
|
@ -231,7 +231,7 @@ open class FinTsJobExecutor(
|
|||
}
|
||||
}
|
||||
|
||||
val startTime = Clock.System.now()
|
||||
val startTime = Instant.now()
|
||||
|
||||
val response = getAndHandleResponseForMessage(context, message)
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package net.codinux.banking.fints.extensions
|
||||
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
|
||||
|
||||
// should actually be named `now()`, but that name is already shadowed by deprecated Instant.Companion.now() method
|
||||
fun Instant.Companion.nowExt(): Instant = Clock.System.now()
|
|
@ -13,5 +13,5 @@ fun LocalDateTime.Companion.nowAtEuropeBerlin(): LocalDateTime {
|
|||
}
|
||||
|
||||
fun LocalDateTime.Companion.nowAt(timeZone: TimeZone): LocalDateTime {
|
||||
return Clock.System.now().toLocalDateTime(timeZone)
|
||||
return Instant.nowExt().toLocalDateTime(timeZone)
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
package net.codinux.banking.fints.extensions
|
||||
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlin.random.Random
|
||||
|
||||
|
||||
fun randomWithSeed(): Random = Random(randomSeed())
|
||||
|
||||
fun randomSeed(): Long {
|
||||
return Clock.System.now().nanosecondsOfSecond.toLong() + Clock.System.now().toEpochMilliseconds()
|
||||
return Instant.nowExt().nanosecondsOfSecond.toLong() + Instant.nowExt().toEpochMilliseconds()
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package net.codinux.banking.fints.model
|
||||
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import net.codinux.banking.fints.extensions.nowExt
|
||||
import net.codinux.banking.fints.log.MessageContext
|
||||
import net.codinux.banking.fints.response.segments.ReceivedSegment
|
||||
|
||||
|
@ -18,7 +18,7 @@ open class MessageLogEntry(
|
|||
* Is only set if [type] is set to [MessageLogEntryType.Received] and response parsing was successful.
|
||||
*/
|
||||
open val parsedSegments: List<ReceivedSegment> = emptyList(),
|
||||
open val time: Instant = Clock.System.now()
|
||||
open val time: Instant = Instant.nowExt()
|
||||
) {
|
||||
|
||||
val messageIncludingMessageTrace: String
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package net.codinux.banking.fints.model
|
||||
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import net.codinux.banking.fints.extensions.nowExt
|
||||
import net.codinux.banking.fints.messages.datenelemente.implementierte.tan.TanMedium
|
||||
import net.codinux.banking.fints.response.BankResponse
|
||||
import net.codinux.banking.fints.response.client.FinTsClientResponse
|
||||
|
@ -15,7 +15,7 @@ open class TanChallenge(
|
|||
val tanMediaIdentifier: String?,
|
||||
val bank: BankData,
|
||||
val account: AccountData? = null,
|
||||
val timestamp: Instant = Clock.System.now()
|
||||
val timestamp: Instant = Instant.nowExt()
|
||||
) {
|
||||
|
||||
var enterTanResult: EnterTanResult? = null
|
||||
|
|
Loading…
Reference in New Issue