X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FCreatePostCommandTest.kt;h=cfbda94f94cec47a520a98a1922ee22e1e37bf47;hp=2d77c6e89ef51d1667cfb31e7f541b9ad97a39c5;hb=04709e23f38e9d447337682ba27201da5dc19bd9;hpb=6f1f26e3998cfef155b0cf59152827accea70d30 diff --git a/src/test/kotlin/net/pterodactylus/sone/fcp/CreatePostCommandTest.kt b/src/test/kotlin/net/pterodactylus/sone/fcp/CreatePostCommandTest.kt index 2d77c6e..cfbda94 100644 --- a/src/test/kotlin/net/pterodactylus/sone/fcp/CreatePostCommandTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/fcp/CreatePostCommandTest.kt @@ -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().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().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"))