<@U7TJY2ZD3> I am getting fails when using mockSta...
# mockk
s
@oleksiyp I am getting fails when using mockStatic(Instant::class). Some tests in other test classes need to use it as a mock and some test classes need to use the real Instant class.
Copy code
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class Temp1 {
	@Test
	fun someTest() {
		val timestamp = Instant.now().toEpochMilli()
		println(timestamp) //123
	}

	@Test
	fun someOtherTest() {
		mockkStatic(Instant::class)
		every { Instant.now().toEpochMilli() } returns 123
		val timestamp = Instant.now().toEpochMilli()
		println(timestamp) //123
	}
}
Copy code
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class Temp2 {
	@Test
	fun someTest() {
		val timestamp = Instant.now().toEpochMilli()
		println(timestamp) //123
	}
}