X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FCreateReplyCommandTest.kt;h=1cd53a512487dabc8a54e3f1132540ceda75ff84;hp=b30b7653d3cda5861d292aff2e891ba223afc86b;hb=5ab6ee01df9bac0c7bd5d27a6990dfdf60555d0f;hpb=914d5522692e7714ba5bdefb002fedc8e293f5fc diff --git a/src/test/kotlin/net/pterodactylus/sone/fcp/CreateReplyCommandTest.kt b/src/test/kotlin/net/pterodactylus/sone/fcp/CreateReplyCommandTest.kt index b30b765..1cd53a5 100644 --- a/src/test/kotlin/net/pterodactylus/sone/fcp/CreateReplyCommandTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/fcp/CreateReplyCommandTest.kt @@ -21,7 +21,7 @@ class CreateReplyCommandTest : SoneCommandTest() { @Test fun `command requires write access`() { - assertThat(command.requiresWriteAccess(), equalTo(true)) + assertThat(command.requiresWriteAccess, equalTo(true)) } @Test @@ -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,7 +78,7 @@ 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)