Rename “loaded elements” to “linked elements”
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 7 Apr 2017 20:41:21 +0000 (22:41 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 8 Apr 2017 13:22:56 +0000 (15:22 +0200)
src/test/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPageTest.kt
src/test/kotlin/net/pterodactylus/sone/web/ajax/JsonPageTest.kt

index 01c4625..1b0df13 100644 (file)
@@ -137,9 +137,9 @@ class GetStatusAjaxPageTest: JsonPageTest() {
 
        @Test
        fun `page returns information about loaded elements`() {
-           addLoadedElement("KSK@test.png", loading = false, failed = false)
-               addLoadedElement("KSK@test.html", loading = true, failed = false)
-               addLoadedElement("KSK@test.jpeg", loading = false, failed = true)
+               addLinkedElement("KSK@test.png", loading = false, failed = false)
+               addLinkedElement("KSK@test.html", loading = true, failed = false)
+               addLinkedElement("KSK@test.jpeg", loading = false, failed = true)
                addRequestParameter("elements", jsonArray("KSK@test.png", "KSK@test.html", "KSK@test.jpeg").toString())
                assertThat(json.get("linkedElements").elements().asSequence().map { it.toMap() }.toList(), containsInAnyOrder(
                                mapOf<String, String?>("link" to "KSK@test.png", "loading" to "false", "failed" to "false"),
index 9b19aa3..490d770 100644 (file)
@@ -41,7 +41,7 @@ open class JsonPageTest {
        private val remoteSones = mutableMapOf<String, Sone>()
        private val newPosts = mutableMapOf<String, Post>()
        private val newReplies = mutableMapOf<String, PostReply>()
-       private val loadedElements = mutableMapOf<String, LinkedElement>()
+       private val linkedElements = mutableMapOf<String, LinkedElement>()
        private val notifications = mutableListOf<Notification>()
 
        @Before
@@ -62,7 +62,7 @@ open class JsonPageTest {
        @Before
        fun setupElementLoader() {
                whenever(elementLoader.loadElement(anyString())).thenAnswer {
-                       loadedElements[it.getArgument(0)] ?: LinkedElement(it.getArgument(0), loading = true)
+                       linkedElements[it.getArgument(0)] ?: LinkedElement(it.getArgument(0), loading = true)
                }
        }
 
@@ -132,8 +132,8 @@ open class JsonPageTest {
                }
        }
 
-       protected fun addLoadedElement(link: String, loading: Boolean, failed: Boolean) {
-               loadedElements[link] = LinkedElement(link, failed, loading)
+       protected fun addLinkedElement(link: String, loading: Boolean, failed: Boolean) {
+               linkedElements[link] = LinkedElement(link, failed, loading)
        }
 
 }