From: David ‘Bombe’ Roden Date: Thu, 12 Dec 2019 18:39:20 +0000 (+0100) Subject: 🎨 Use singleton verifier X-Git-Tag: v81^2~5^2~36 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c7e1d396f81935e872d0e49339fa19baf16abada;p=Sone.git 🎨 Use singleton verifier --- diff --git a/src/test/kotlin/net/pterodactylus/sone/main/SoneModuleTest.kt b/src/test/kotlin/net/pterodactylus/sone/main/SoneModuleTest.kt index e95955c..7f6b8d0 100644 --- a/src/test/kotlin/net/pterodactylus/sone/main/SoneModuleTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/main/SoneModuleTest.kt @@ -190,9 +190,7 @@ class SoneModuleTest { @Test fun `core is created as singleton`() { - val firstCore = injector.getInstance() - val secondCore = injector.getInstance() - assertThat(secondCore, sameInstance(firstCore)) + injector.verifySingletonInstance() } @Test @@ -209,27 +207,13 @@ class SoneModuleTest { } @Test - fun `metrics registry can be created`() { - assertThat(injector.getInstance(), notNullValue()) - } - - @Test fun `metrics registry is created as singleton`() { - val firstMetricRegistry = injector.getInstance() - val secondMetricRegistry = injector.getInstance() - assertThat(firstMetricRegistry, sameInstance(secondMetricRegistry)) - } - - @Test - fun `wot connector can be created`() { - assertThat(injector.getInstance(), notNullValue()) + injector.verifySingletonInstance() } @Test fun `wot connector is created as singleton`() { - val firstWebOfTrustConnector = injector.getInstance() - val secondWebOfTrustConnector = injector.getInstance() - assertThat(firstWebOfTrustConnector, sameInstance(secondWebOfTrustConnector)) + injector.verifySingletonInstance() } }