private val timeTextConverter = mock<TimeTextConverter>()
private val l10nFilter = mock<L10nFilter>()
- private val newElements = mock<NewElements>().apply {
- whenever(newPosts).then { this@GetStatusAjaxPageTest.newPosts.values }
- whenever(newReplies).then { this@GetStatusAjaxPageTest.newReplies.values }
- }
override var page: JsonPage = GetStatusAjaxPage(webInterface, elementLoader, newElements, timeTextConverter, l10nFilter, TimeZone.getTimeZone("UTC"))
@Before
import net.pterodactylus.sone.test.mock
import net.pterodactylus.sone.test.whenever
import net.pterodactylus.sone.utils.asOptional
+import net.pterodactylus.sone.web.NewElements
import net.pterodactylus.sone.web.WebInterface
import net.pterodactylus.sone.web.page.FreenetRequest
import net.pterodactylus.util.notify.Notification
val preferences = Preferences(eventBus)
val updateChecker = mock<UpdateChecker>()
val elementLoader = mock<ElementLoader>()
+ val newElements = mock<NewElements>()
val toadletContext = mock<ToadletContext>()
val freenetRequest = mock<FreenetRequest>()
linkedElements[it.getArgument(0)] ?: LinkedElement(it.getArgument(0), loading = true)
}
+ whenever(newElements.newPosts).then { newPosts.values }
+ whenever(newElements.newReplies).then { newReplies.values }
+
whenever(currentSone.options).thenReturn(DefaultSoneOptions())
currentSone.mock("soneId", "Sone_Id", true, 1000, idle)