🔀 Merge changes from other next branch
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / fcp / CreatePostCommandTest.kt
index 2d77c6e..cfbda94 100644 (file)
@@ -20,7 +20,7 @@ class CreatePostCommandTest : SoneCommandTest() {
 
        @Test
        fun `command requires write access`() {
-               assertThat(command.requiresWriteAccess(), equalTo(true))
+               assertThat(command.requiresWriteAccess, equalTo(true))
        }
 
        @Test
@@ -56,7 +56,7 @@ class CreatePostCommandTest : SoneCommandTest() {
                parameters += "Text" to "Test"
                whenever(core.getSone("LocalSoneId")).thenReturn(localSone)
                val post = mock<Post>().apply { whenever(id).thenReturn("PostId") }
-               whenever(core.createPost(localSone, absent(), "Test")).thenReturn(post)
+               whenever(core.createPost(localSone, null, "Test")).thenReturn(post)
                val response = command.execute(parameters)
                assertThat(response.replyParameters.get("Message"), equalTo("PostCreated"))
                assertThat(response.replyParameters.get("Post"), equalTo("PostId"))
@@ -90,7 +90,7 @@ class CreatePostCommandTest : SoneCommandTest() {
                whenever(core.getSone("LocalSoneId")).thenReturn(localSone)
                whenever(core.getSone("RemoteSoneId")).thenReturn(remoteSone)
                val post = mock<Post>().apply { whenever(id).thenReturn("PostId") }
-               whenever(core.createPost(localSone, of(remoteSone), "Test")).thenReturn(post)
+               whenever(core.createPost(localSone, remoteSone, "Test")).thenReturn(post)
                val response = command.execute(parameters)
                assertThat(response.replyParameters.get("Message"), equalTo("PostCreated"))
                assertThat(response.replyParameters.get("Post"), equalTo("PostId"))