+++ /dev/null
-package net.pterodactylus.sone.freenet.wot;
-
-import static com.google.common.base.Optional.of;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
-import net.pterodactylus.sone.freenet.plugin.PluginException;
-
-import com.google.common.eventbus.EventBus;
-import org.junit.Test;
-
-/**
- * Unit test for {@link IdentityManagerImpl}.
- */
-public class IdentityManagerTest {
-
- private final EventBus eventBus = mock(EventBus.class);
- private final WebOfTrustConnector webOfTrustConnector = mock(WebOfTrustConnector.class);
- private final IdentityManager identityManager = new IdentityManagerImpl(eventBus, webOfTrustConnector, new IdentityLoader(webOfTrustConnector, new Context("Test")));
-
- @Test
- public void identityManagerPingsWotConnector() throws PluginException {
- assertThat(identityManager.isConnected(), is(true));
- verify(webOfTrustConnector).ping();
- }
-
- @Test
- public void disconnectedWotConnectorIsRecognized() throws PluginException {
- doThrow(PluginException.class).when(webOfTrustConnector).ping();
- assertThat(identityManager.isConnected(), is(false));
- verify(webOfTrustConnector).ping();
- }
-
-}
--- /dev/null
+package net.pterodactylus.sone.freenet.wot
+
+import com.google.common.eventbus.*
+import net.pterodactylus.sone.freenet.plugin.*
+import net.pterodactylus.sone.test.*
+import org.hamcrest.MatcherAssert.*
+import org.hamcrest.Matchers.*
+import org.junit.*
+import org.mockito.Mockito.*
+
+/**
+ * Unit test for [IdentityManagerImpl].
+ */
+class IdentityManagerTest {
+
+ private val eventBus = mock<EventBus>()
+ private val webOfTrustConnector = mock<WebOfTrustConnector>()
+ private val identityManager = IdentityManagerImpl(eventBus, webOfTrustConnector, IdentityLoader(webOfTrustConnector, Context("Test")))
+
+ @Test
+ fun identityManagerPingsWotConnector() {
+ assertThat(identityManager.isConnected, equalTo(true))
+ verify(webOfTrustConnector).ping()
+ }
+
+ @Test
+ fun disconnectedWotConnectorIsRecognized() {
+ doThrow(PluginException::class.java).whenever(webOfTrustConnector).ping()
+ assertThat(identityManager.isConnected, equalTo(false))
+ verify(webOfTrustConnector).ping()
+ }
+
+}