X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FUnlockSoneCommandTest.java;h=b966b19ea082237ebeb90c0eb3c53066f8c59d30;hp=05fc73c5f36381e52896f822998f697f46d227b2;hb=6f019de1d4d9742981d851ac3c9097cca8bff58e;hpb=f65328fb92d16e568b869bf5f2771dd4114d8abc diff --git a/src/test/java/net/pterodactylus/sone/fcp/UnlockSoneCommandTest.java b/src/test/java/net/pterodactylus/sone/fcp/UnlockSoneCommandTest.java index 05fc73c..b966b19 100644 --- a/src/test/java/net/pterodactylus/sone/fcp/UnlockSoneCommandTest.java +++ b/src/test/java/net/pterodactylus/sone/fcp/UnlockSoneCommandTest.java @@ -34,6 +34,7 @@ import net.pterodactylus.sone.freenet.fcp.FcpException; import freenet.support.SimpleFieldSet; +import com.google.common.base.Optional; import org.junit.Test; /** @@ -47,8 +48,9 @@ public class UnlockSoneCommandTest { public void testUnlockingALocalSone() throws FcpException { Sone localSone = mock(Sone.class); when(localSone.getId()).thenReturn("LocalSone"); + when(localSone.isLocal()).thenReturn(true); Core core = mock(Core.class); - when(core.getSone(eq("LocalSone"), anyBoolean())).thenReturn(localSone); + when(core.getSone(eq("LocalSone"))).thenReturn(Optional.of(localSone)); when(core.getLocalSone(eq("LocalSone"), anyBoolean())).thenReturn(localSone); SimpleFieldSet fields = new SimpleFieldSetBuilder().put("Sone", "LocalSone").get(); @@ -66,7 +68,7 @@ public class UnlockSoneCommandTest { public void testUnlockingARemoteSone() throws FcpException { Sone removeSone = mock(Sone.class); Core core = mock(Core.class); - when(core.getSone(eq("RemoteSone"), anyBoolean())).thenReturn(removeSone); + when(core.getSone(eq("RemoteSone"))).thenReturn(Optional.of(removeSone)); SimpleFieldSet fields = new SimpleFieldSetBuilder().put("Sone", "RemoteSone").get(); UnlockSoneCommand unlockSoneCommand = new UnlockSoneCommand(core);