X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FDeletePostCommandTest.kt;h=651614f38bf83e748baabf8e16e8d2431a665d0f;hp=a2b41983c9a7b4b791c4f6786495b90d590cc3ed;hb=5ab6ee01df9bac0c7bd5d27a6990dfdf60555d0f;hpb=914d5522692e7714ba5bdefb002fedc8e293f5fc diff --git a/src/test/kotlin/net/pterodactylus/sone/fcp/DeletePostCommandTest.kt b/src/test/kotlin/net/pterodactylus/sone/fcp/DeletePostCommandTest.kt index a2b4198..651614f 100644 --- a/src/test/kotlin/net/pterodactylus/sone/fcp/DeletePostCommandTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/fcp/DeletePostCommandTest.kt @@ -21,7 +21,7 @@ class DeletePostCommandTest : SoneCommandTest() { @Test fun `command requires write access`() { - assertThat(command.requiresWriteAccess(), equalTo(true)) + assertThat(command.requiresWriteAccess, equalTo(true)) } @Test @@ -31,14 +31,14 @@ class DeletePostCommandTest : SoneCommandTest() { @Test fun `request with invalid post parameter results in fcp exception`() { - parameters.putSingle("Post", "InvalidPostId") + parameters += "Post" to "InvalidPostId" executeCommandAndExpectFcpException() } @Test fun `request with post from remote sone returns error response`() { - parameters.putSingle("Post", "RemotePostId") - whenever(core.getPost("RemotePostId")).thenReturn(of(postFromRemoteSone)) + parameters += "Post" to "RemotePostId" + whenever(core.getPost("RemotePostId")).thenReturn(postFromRemoteSone) val response = command.execute(parameters) assertThat(response.replyParameters["Message"], equalTo("Error")) assertThat(response.replyParameters["ErrorCode"], equalTo("401")) @@ -46,8 +46,8 @@ class DeletePostCommandTest : SoneCommandTest() { @Test fun `request with post from local sone deletes posts`() { - parameters.putSingle("Post", "LocalPostId") - whenever(core.getPost("LocalPostId")).thenReturn(of(postFromLocalSone)) + parameters += "Post" to "LocalPostId" + whenever(core.getPost("LocalPostId")).thenReturn(postFromLocalSone) val response = command.execute(parameters) assertThat(response.replyParameters["Message"], equalTo("PostDeleted")) verify(core).deletePost(postFromLocalSone)