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=54f784f6747b80f1167f69d1a267791c96c6a873;hb=03c29a3838e23ed0b9731ca4d84cf58038c30dfe;hpb=5a54ea664e862c910b1766d8ba0dd5efb6ea0151 diff --git a/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt b/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt index 54f784f..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.getSone("RemoteSoneId")).thenReturn(remoteSone.asOptional()) - whenever(core.getSone("LocalSoneId")).thenReturn(localSone.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