🎨 Replace profile test with Kotlin version
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 19 Mar 2019 17:07:22 +0000 (18:07 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 19 Mar 2019 17:07:22 +0000 (18:07 +0100)
src/test/java/net/pterodactylus/sone/data/ProfileTest.java [deleted file]
src/test/kotlin/net/pterodactylus/sone/data/ProfileTest.kt [new file with mode: 0644]

diff --git a/src/test/java/net/pterodactylus/sone/data/ProfileTest.java b/src/test/java/net/pterodactylus/sone/data/ProfileTest.java
deleted file mode 100644 (file)
index c0cb9de..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package net.pterodactylus.sone.data;
-
-import net.pterodactylus.sone.data.Profile.Field;
-
-import org.hamcrest.MatcherAssert;
-import org.hamcrest.Matchers;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-/**
- * Unit test for {@link Profile}.
- */
-public class ProfileTest {
-
-       private final Sone sone = Mockito.mock(Sone.class);
-       private final Profile profile = new Profile(sone);
-
-       @Test
-       public void newFieldsAreInitializedWithAnEmptyString() {
-               Field newField = profile.addField("testField");
-               MatcherAssert.assertThat(newField.getValue(), Matchers.is(""));
-       }
-
-}
diff --git a/src/test/kotlin/net/pterodactylus/sone/data/ProfileTest.kt b/src/test/kotlin/net/pterodactylus/sone/data/ProfileTest.kt
new file mode 100644 (file)
index 0000000..5c82574
--- /dev/null
@@ -0,0 +1,22 @@
+package net.pterodactylus.sone.data
+
+import net.pterodactylus.sone.test.*
+import org.hamcrest.MatcherAssert.*
+import org.hamcrest.Matchers.*
+import org.junit.*
+
+/**
+ * Unit test for [Profile].
+ */
+class ProfileTest {
+
+       private val sone = mock<Sone>()
+       private val profile = Profile(sone)
+
+       @Test
+       fun `new fields are initialized with an empty string`() {
+               val newField = profile.addField("testField")
+               assertThat(newField.value, equalTo(""))
+       }
+
+}