@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"),
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
@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)
}
}
}
}
- 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)
}
}