X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FCreateReplyCommandTest.kt;h=a6e69cddaf54e969c4c5c50f264856d376c6e3b7;hb=ea7ad5e87074576d17b7df74365a726bd95d7665;hp=126927235e8adfa14b1dc1d8149d40f0049f197c;hpb=6cdcdf75cbc0b5341705f55f7b6a33073405732b;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/fcp/CreateReplyCommandTest.kt b/src/test/kotlin/net/pterodactylus/sone/fcp/CreateReplyCommandTest.kt index 1269272..a6e69cd 100644 --- a/src/test/kotlin/net/pterodactylus/sone/fcp/CreateReplyCommandTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/fcp/CreateReplyCommandTest.kt @@ -45,8 +45,8 @@ class CreateReplyCommandTest : SoneCommandTest() { } private fun addValidLocalSoneParameter() { - parameters.putSingle("Sone", "LocalSoneId") - whenever(core.getSone("LocalSoneId")).thenReturn(of(localSone)) + parameters += "Sone" to "LocalSoneId" + whenever(core.getSone("LocalSoneId")).thenReturn(localSone) } @Test @@ -58,13 +58,13 @@ class CreateReplyCommandTest : SoneCommandTest() { @Test fun `request with invalid post parameter results in fcp exception`() { addValidLocalSoneParameter() - parameters.putSingle("Post", "InvalidPostId") + parameters += "Post" to "InvalidPostId" executeCommandAndExpectFcpException() } private fun addValidPostParameter() { - parameters.putSingle("Post", "ValidPostId") - whenever(core.getPost("ValidPostId")).thenReturn(of(post)) + parameters += "Post" to "ValidPostId" + whenever(core.getPost("ValidPostId")).thenReturn(post) } @Test @@ -78,10 +78,10 @@ class CreateReplyCommandTest : SoneCommandTest() { fun `complete request creates reply`() { addValidLocalSoneParameter() addValidPostParameter() - parameters.putSingle("Text", "Test") + parameters += "Text" to "Test" val postReply = mock().apply { whenever(id).thenReturn("ReplyId") } whenever(core.createReply(localSone, post, "Test")).thenReturn(postReply) - val response = command.execute(parameters, null, null) + val response = command.execute(parameters) assertThat(response.replyParameters["Message"], equalTo("ReplyCreated")) assertThat(response.replyParameters["Reply"], equalTo("ReplyId")) }