- protected fun addRequestParameter(key: String, value: String) {
- requestParameters += key to value
- }
-
- protected fun addRequestPart(key: String, value: String) {
- requestParts += key to value
- }
-
- protected fun addNotification(vararg notifications: Notification) {
- this.notifications += notifications
- }
-
- protected fun addSone(sone: Sone) {
- remoteSones += sone.id to sone
- }
-
- protected fun addNewPost(id: String, soneId: String, time: Long, recipientId: String? = null) =
- mock<Post>().apply {
- whenever(this.id).thenReturn(id)
- val sone = mock<Sone>().apply { whenever(this.id).thenReturn(soneId) }
- whenever(this.sone).thenReturn(sone)
- whenever(this.time).thenReturn(time)
- whenever(this.recipientId).thenReturn(recipientId.asOptional())
- }.also { newPosts[id] = it }
-
- protected fun addNewReply(id: String, soneId: String, postId: String, postSoneId: String) {
- newReplies[id] = mock<PostReply>().apply {
- whenever(this.id).thenReturn(id)
- val sone = mock<Sone>().apply { whenever(this.id).thenReturn(soneId) }
- whenever(this.sone).thenReturn(sone)
- val postSone = mock<Sone>().apply { whenever(this.id).thenReturn(postSoneId) }
- val post = mock<Post>().apply {
- whenever(this.sone).thenReturn(postSone)
- }
- whenever(this.post).thenReturn(post.asOptional())
- whenever(this.postId).thenReturn(postId)
- }