Skip to content

Commit

Permalink
Set JST time zone for robot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chibatching committed Aug 23, 2023
1 parent 15269d8 commit b530571
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class RobotTestRule(
return RuleChain
.outerRule(HiltAndroidAutoInjectRule(testInstance))
.around(CoroutinesTestRule())
.around(TimeZoneTestRule())
.around(object : TestWatcher() {
override fun starting(description: Description) {
// To see logs in the console
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.github.droidkaigi.confsched2023.testing

import org.junit.rules.TestWatcher
import org.junit.runner.Description
import java.util.TimeZone

class TimeZoneTestRule : TestWatcher() {
override fun starting(description: Description) {
super.starting(description)
TimeZone.setDefault(TimeZone.getTimeZone("Asia/Tokyo"))
}
}

0 comments on commit b530571

Please sign in to comment.