X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FDeletePostCommandTest.kt;h=30fc4cb1b4ef7a9da32e072591561c96129d56f9;hb=fd32e307db87c617a4c455f592b6e649ec50ae8a;hp=71e6eeea9e614b3e1104a81ff7bcb08ceededad4;hpb=6cdcdf75cbc0b5341705f55f7b6a33073405732b;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/fcp/DeletePostCommandTest.kt b/src/test/kotlin/net/pterodactylus/sone/fcp/DeletePostCommandTest.kt index 71e6eee..30fc4cb 100644 --- a/src/test/kotlin/net/pterodactylus/sone/fcp/DeletePostCommandTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/fcp/DeletePostCommandTest.kt @@ -31,24 +31,24 @@ 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)) - val response = command.execute(parameters, null, null) + 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")) } @Test fun `request with post from local sone deletes posts`() { - parameters.putSingle("Post", "LocalPostId") - whenever(core.getPost("LocalPostId")).thenReturn(of(postFromLocalSone)) - val response = command.execute(parameters, null, null) + 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) }