package net.pterodactylus.sone.core;
-import static com.google.common.base.Optional.of;
import static com.google.common.io.ByteStreams.toByteArray;
import static com.google.common.util.concurrent.MoreExecutors.sameThreadExecutor;
import static java.lang.System.currentTimeMillis;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
public void setupCore() {
UpdateChecker updateChecker = mock(UpdateChecker.class);
when(core.getUpdateChecker()).thenReturn(updateChecker);
- when(core.getSone(anyString())).thenReturn(Optional.<Sone>absent());
+ when(core.getSone(anyString())).thenReturn(null);
}
@Test
when(sone.getInsertUri()).thenReturn(insertUri);
when(sone.getFingerprint()).thenReturn(fingerprint);
when(sone.getRootAlbum()).thenReturn(mock(Album.class));
- when(core.getSone(anyString())).thenReturn(of(sone));
+ when(core.getSone(anyString())).thenReturn(sone);
return sone;
}
new SoneInserter(core, eventBus, freenetInterface, "SoneId",
soneModificationDetector, 1);
when(soneModificationDetector.isEligibleForInsert()).thenReturn(true);
- when(core.getSone("SoneId")).thenReturn(Optional.<Sone>absent());
+ when(core.getSone("SoneId")).thenReturn(null);
soneInserter.serviceRun();
}