+ whenever(core.getPost(anyString())).thenReturn(absent())
+ whenever(core.getPostReply(anyString())).thenReturn(absent())
+ }
+
+ protected fun createSone(id: String, name: String, firstName: String, lastName: String, time: Long) = mock<Sone>().apply {
+ whenever(this.id).thenReturn(id)
+ whenever(this.name).thenReturn(name)
+ whenever(profile).thenReturn(Profile(this).apply {
+ this.firstName = firstName
+ this.lastName = lastName
+ })
+ whenever(this.time).thenReturn(time)
+ }
+
+ protected fun createPost(id: String, sone: Sone, recipientId: String?, time: Long, text: String) = mock<Post>().apply {
+ whenever(this.id).thenReturn(id)
+ whenever(this.sone).thenReturn(sone)
+ whenever(this.recipientId).thenReturn(recipientId.asOptional())
+ whenever(this.time).thenReturn(time)
+ whenever(this.text).thenReturn(text)
+ }
+
+ protected fun createReply(id: String, sone: Sone, post: Post, time: Long, text: String) = mock<PostReply>().apply {
+ whenever(this.id).thenReturn(id)
+ whenever(this.sone).thenReturn(sone)
+ whenever(this.post).thenReturn(post.asOptional())
+ whenever(this.time).thenReturn(time)
+ whenever(this.text).thenReturn(text)
+ }
+
+ protected fun executeCommandAndExpectFcpException() {
+ expectedException.expect(FcpException::class.java)
+ command.execute(parameters)