X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FUnlockSoneCommandTest.java;h=245cdb5c5da65cd05a5354fd3fa012f8d71a1fd5;hp=b966b19ea082237ebeb90c0eb3c53066f8c59d30;hb=2f995a29d8731dc3b3d20e78fd9382be542292ff;hpb=19632b7bb999f888668bdb6d8bdfe0572002b8e4 diff --git a/src/test/java/net/pterodactylus/sone/fcp/UnlockSoneCommandTest.java b/src/test/java/net/pterodactylus/sone/fcp/UnlockSoneCommandTest.java index b966b19..245cdb5 100644 --- a/src/test/java/net/pterodactylus/sone/fcp/UnlockSoneCommandTest.java +++ b/src/test/java/net/pterodactylus/sone/fcp/UnlockSoneCommandTest.java @@ -17,10 +17,10 @@ package net.pterodactylus.sone.fcp; +import static com.google.common.base.Optional.of; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Matchers.anyBoolean; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -34,7 +34,6 @@ import net.pterodactylus.sone.freenet.fcp.FcpException; import freenet.support.SimpleFieldSet; -import com.google.common.base.Optional; import org.junit.Test; /** @@ -50,8 +49,8 @@ public class UnlockSoneCommandTest { when(localSone.getId()).thenReturn("LocalSone"); when(localSone.isLocal()).thenReturn(true); Core core = mock(Core.class); - when(core.getSone(eq("LocalSone"))).thenReturn(Optional.of(localSone)); - when(core.getLocalSone(eq("LocalSone"), anyBoolean())).thenReturn(localSone); + when(core.getSone(eq("LocalSone"))).thenReturn(of(localSone)); + when(core.getLocalSone(eq("LocalSone"))).thenReturn(of(localSone)); SimpleFieldSet fields = new SimpleFieldSetBuilder().put("Sone", "LocalSone").get(); UnlockSoneCommand unlockSoneCommand = new UnlockSoneCommand(core); @@ -68,7 +67,7 @@ public class UnlockSoneCommandTest { public void testUnlockingARemoteSone() throws FcpException { Sone removeSone = mock(Sone.class); Core core = mock(Core.class); - when(core.getSone(eq("RemoteSone"))).thenReturn(Optional.of(removeSone)); + when(core.getSone(eq("RemoteSone"))).thenReturn(of(removeSone)); SimpleFieldSet fields = new SimpleFieldSetBuilder().put("Sone", "RemoteSone").get(); UnlockSoneCommand unlockSoneCommand = new UnlockSoneCommand(core);