X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FKnownSonesPageTest.kt;fp=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FKnownSonesPageTest.kt;h=23987b64b3a4c3f28fcce46b6d70765ef97f8dd0;hp=14cae74bbe613332d7ef10a3ce6a0c9eadf4e1d8;hb=5c5bee980f9cab5792e34d1c9840f73b8b191830;hpb=faf66247a34f64946990a985d2ea3003465969cb diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt index 14cae74..23987b6 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt @@ -1,6 +1,7 @@ package net.pterodactylus.sone.web.pages import net.pterodactylus.sone.data.* +import net.pterodactylus.sone.data.impl.* import net.pterodactylus.sone.freenet.wot.* import net.pterodactylus.sone.test.* import net.pterodactylus.sone.utils.* @@ -37,11 +38,12 @@ class KnownSonesPageTest : WebPageTest(::KnownSonesPage) { whenever(this.time).thenReturn(time) whenever(this.posts).thenReturn((0..(posts - 1)).map { mock() }) whenever(this.replies).thenReturn((0..(replies - 1)).map { mock() }.toSet()) - val album = mock() - whenever(album.images).thenReturn(((0..(images - 1)).map { mock() })) - val rootAlbum = mock().apply { - whenever(albums).thenReturn(listOf(album)) + val album = AlbumImpl(this) + repeat(images) { + ImageImpl().modify().setSone(this).update() + .also(album::addImage) } + val rootAlbum = AlbumImpl(this).also { it.addAlbum(album) } whenever(this.rootAlbum).thenReturn(rootAlbum) whenever(this.profile).thenReturn(mock()) whenever(id).thenReturn(name.toLowerCase())