kotlin mock time
import io.mockk.every
import io.mockk.mockkObject
import java.time.LocalDateTime
fun main() {
// Mocking the current time using MockK
mockkObject(LocalDateTime::class)
val mockedTime = LocalDateTime.of(2023, 1, 1, 12, 0, 0)
every { LocalDateTime.now() } returns mockedTime
// Your code that uses the current time
val currentTime = LocalDateTime.now()
println("Current Time: $currentTime")
// Restoring the original behavior of LocalDateTime.now()
mockkObject(LocalDateTime::class).unmock()
}