kotest-extensions / io.kotest.extensions.locale / TimeZoneTestListener

TimeZoneTestListener

class TimeZoneTestListener : TimeZoneListener, TestListener

Replaces the default TimeZone

This function replaces the current default timezone with timeZone, then executes the test and finally returns the original default timezone to it's place.

Attention: This code is subject to race conditions. The System can only have one default timezone, and if you change the timezone while it was already changed, the result may be inconsistent.

Constructors

<init>

Replaces the default TimeZone

TimeZoneTestListener(timeZone: TimeZone)

Functions

afterTest

suspend fun afterTest(testCase: TestCase, result: TestResult): Unit

beforeTest

suspend fun beforeTest(testCase: TestCase): Unit