samir
06/25/2018, 10:54 AM@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
}
}
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class Temp2 {
@Test
fun someTest() {
val timestamp = Instant.now().toEpochMilli()
println(timestamp) //123
}
}