X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FLikePostCommandTest.kt;h=b344f51981565bbf8c666697ec9884ff8fb5e3d4;hp=792c1b707f4be9fcd32a19d7e9221fcd914d1ab2;hb=8e313509a42a8c638fcac018dd73dd975bf9cb68;hpb=ae078c3b54fce575270aae9ec645a286641aea71 diff --git a/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt b/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt index 792c1b7..b344f51 100644 --- a/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/fcp/LikePostCommandTest.kt @@ -3,9 +3,9 @@ package net.pterodactylus.sone.fcp import net.pterodactylus.sone.core.Core import net.pterodactylus.sone.data.Sone import net.pterodactylus.sone.freenet.fcp.FcpException -import net.pterodactylus.sone.test.asOptional import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.whenever +import net.pterodactylus.sone.utils.asOptional import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo import org.junit.Before @@ -17,15 +17,15 @@ 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.getSone("RemoteSoneId")).thenReturn(remoteSone) + whenever(core.getSone("LocalSoneId")).thenReturn(localSone) } @Test @@ -35,7 +35,7 @@ class LikePostCommandTest : SoneCommandTest() { @Test fun `request without parameters results in FCP exception`() { - requestWithoutAnyParameterResultsInFcpException() + requestWithoutAnyParameterResultsInFcpException() } @Test @@ -47,7 +47,7 @@ class LikePostCommandTest : SoneCommandTest() { @Test fun `request with missing local sone results in FCP exception`() { - parameters += "Post" to "PostId" + parameters += "Post" to "PostId" expectedException.expect(FcpException::class.java) command.execute(parameters) }