val reply = mock<PostReply>()
val sone = mock<Sone>()
whenever(reply.sone).thenReturn(sone)
- addReply("reply-id", reply)
+ addReply(reply, "reply-id")
addRequestParameter("reply", "reply-id")
assertThat(json.isSuccess, equalTo(false))
assertThat(json.error, equalTo("not-authorized"))
val sone = mock<Sone>()
whenever(sone.isLocal).thenReturn(true)
whenever(reply.sone).thenReturn(sone)
- addReply("reply-id", reply)
+ addReply(reply, "reply-id")
addRequestParameter("reply", "reply-id")
assertThat(json.isSuccess, equalTo(true))
verify(core).deleteReply(reply)
whenever(this.recipientId).thenReturn(recipientId.asOptional())
}.also { newPosts[id] = it }
- protected fun addReply(id: String, reply: PostReply) {
- replies[id] = reply
+ protected fun addReply(reply: PostReply, id: String? = null) {
+ replies[id ?: reply.id] = reply
}
protected fun addNewReply(id: String, soneId: String, postId: String, postSoneId: String) {