From: David ‘Bombe’ Roden Date: Fri, 7 Apr 2017 20:41:21 +0000 (+0200) Subject: Rename “loaded elements” to “linked elements” X-Git-Tag: 0.9.7^2~265 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0b033de14127df341b053fbe71ac8aebf8e318b8;p=Sone.git Rename “loaded elements” to “linked elements” --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPageTest.kt index 01c4625..1b0df13 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/ajax/GetStatusAjaxPageTest.kt @@ -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("link" to "KSK@test.png", "loading" to "false", "failed" to "false"), diff --git a/src/test/kotlin/net/pterodactylus/sone/web/ajax/JsonPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/ajax/JsonPageTest.kt index 9b19aa3..490d770 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/ajax/JsonPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/ajax/JsonPageTest.kt @@ -41,7 +41,7 @@ open class JsonPageTest { private val remoteSones = mutableMapOf() private val newPosts = mutableMapOf() private val newReplies = mutableMapOf() - private val loadedElements = mutableMapOf() + private val linkedElements = mutableMapOf() private val notifications = mutableListOf() @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) } }