import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.withSettings;
import java.io.IOException;
import java.util.HashMap;
import net.pterodactylus.sone.core.event.SoneInsertedEvent;
import net.pterodactylus.sone.core.event.SoneInsertingEvent;
import net.pterodactylus.sone.data.Album;
+import net.pterodactylus.sone.data.LocalSone;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.main.SonePlugin;
UpdateChecker updateChecker = mock(UpdateChecker.class);
when(core.getUpdateChecker()).thenReturn(updateChecker);
when(core.getSone(anyString())).thenReturn(Optional.<Sone>absent());
+ when(core.getLocalSone(anyString())).thenReturn(Optional.<LocalSone>absent());
}
@Test
}
private Sone createSone(FreenetURI insertUri, String fingerprint) {
- Sone sone = mock(Sone.class);
+ Sone sone = mock(Sone.class, withSettings().extraInterfaces(LocalSone.class));
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.getLocalSone(anyString())).thenReturn(of((LocalSone) sone));
return sone;
}