X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FSoneCommandTest.kt;h=53976833e8aded5cf67b3fe4b99c5df32b679105;hp=aa38f8846134ce7ade1de7d9020c6c579ecd8aab;hb=fafe0029dcbef27ce918fdf7007e78c8705ca20f;hpb=ffd92ca2374c0b2218e583d02e0bdd24b8c110ae diff --git a/src/test/kotlin/net/pterodactylus/sone/fcp/SoneCommandTest.kt b/src/test/kotlin/net/pterodactylus/sone/fcp/SoneCommandTest.kt index aa38f88..5397683 100644 --- a/src/test/kotlin/net/pterodactylus/sone/fcp/SoneCommandTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/fcp/SoneCommandTest.kt @@ -1,6 +1,5 @@ package net.pterodactylus.sone.fcp -import com.google.common.base.Optional import com.google.common.base.Optional.absent import freenet.support.SimpleFieldSet import net.pterodactylus.sone.core.Core @@ -39,9 +38,9 @@ abstract class SoneCommandTest { @Before fun setupCore() { - whenever(core.getSone(anyString())).thenReturn(absent()) + whenever(core.getSone(anyString())).thenReturn(null) whenever(core.getPost(anyString())).thenReturn(absent()) - whenever(core.getPostReply(anyString())).thenReturn(absent()) + whenever(core.getPostReply(anyString())).thenReturn(null) } protected fun createSone(id: String, name: String, firstName: String, lastName: String, time: Long) = mock().apply { @@ -92,7 +91,7 @@ abstract class SoneCommandTest { fun requestWithValidRemoteSoneParameterResultsInFcpException() { parameters += "Sone" to "RemoteSoneId" - whenever(core.getSone("RemoteSoneId")).thenReturn(Optional.of(remoteSone)) + whenever(core.getSone("RemoteSoneId")).thenReturn(remoteSone) executeCommandAndExpectFcpException() }