X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FLikePostCommandTest.kt;h=20358c69fe83aa4aff541890006fcaa7c7038444;hp=b344f51981565bbf8c666697ec9884ff8fb5e3d4;hb=03c29a3838e23ed0b9731ca4d84cf58038c30dfe;hpb=8e313509a42a8c638fcac018dd73dd975bf9cb68 diff --git a/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt b/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt index b344f51..20358c6 100644 --- a/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt @@ -17,20 +17,20 @@ import org.mockito.Mockito.verify */ class LikePostCommandTest : SoneCommandTest() { - private val post = createPost("PostId", mock(), null, 1000, "Text") + private val post = createPost("PostId", mock(), null, 1000, "Text") override fun createCommand(core: Core) = LikePostCommand(core) @Before fun setupPostAndSones() { - whenever(core.getPost("PostId")).thenReturn(post.asOptional()) + whenever(core.getPost("PostId")).thenReturn(post) whenever(core.getSone("RemoteSoneId")).thenReturn(remoteSone) whenever(core.getSone("LocalSoneId")).thenReturn(localSone) } @Test fun `command requires write access`() { - assertThat(command.requiresWriteAccess(), equalTo(true)) + assertThat(command.requiresWriteAccess, equalTo(true)) } @Test @@ -70,7 +70,7 @@ class LikePostCommandTest : SoneCommandTest() { @Test fun `request with valid parameters adds post to liked posts for sone`() { - whenever(core.getLikes(post)).thenReturn(setOf(mock(), mock(), mock())) + whenever(core.getLikes(post)).thenReturn(setOf(mock(), mock(), mock())) parameters += "Post" to "PostId" parameters += "Sone" to "LocalSoneId" val replyParameters = command.execute(parameters).replyParameters