Replace AbstractSoneCommand with Kotlin version
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / fcp / DeletePostCommandTest.kt
index 71e6eee..651614f 100644 (file)
@@ -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,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)
        }