From fc2922b836c9f23242135c752653507a573917ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 12 Dec 2019 19:55:19 +0100 Subject: [PATCH] =?utf8?q?=E2=9C=85=20Replace=20test=20for=20scheduling=20?= =?utf8?q?with=20better=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../net/pterodactylus/sone/web/notification/StartupHandlerTest.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/kotlin/net/pterodactylus/sone/web/notification/StartupHandlerTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/notification/StartupHandlerTest.kt index 38e7f1b..bc2c8e6 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/notification/StartupHandlerTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/notification/StartupHandlerTest.kt @@ -24,6 +24,7 @@ import net.pterodactylus.util.notify.* import net.pterodactylus.util.template.* import org.hamcrest.MatcherAssert.* import org.hamcrest.Matchers.* +import java.util.concurrent.TimeUnit.* import kotlin.test.* /** @@ -50,9 +51,9 @@ class StartupHandlerTest { } @Test - fun `handler registers command on startup`() { + fun `handler registers command on with 2-minute delay`() { eventBus.post(Startup()) - assertThat(executor.scheduleds, hasSize(1)) + assertThat(with(executor.scheduleds.single()) { timeUnit.toNanos(delay) }, equalTo(MINUTES.toNanos(2))) } @Test -- 2.7.4