Rename SoneImpl to DefaultSone, implement SoneProvider in MemoryDatabase.
[Sone.git] / src / test / java / net / pterodactylus / sone / fcp / LockSoneCommandTest.java
index ae1993a..01f9994 100644 (file)
 
 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 LockSoneCommandTest {
                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();
 
                LockSoneCommand lockSoneCommand = new LockSoneCommand(core);
@@ -68,7 +67,7 @@ public class LockSoneCommandTest {
        public void testLockingARemoteSone() 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();
 
                LockSoneCommand lockSoneCommand = new LockSoneCommand(core);