import net.pterodactylus.sone.database.PostBuilder.PostCreated;
import net.pterodactylus.sone.database.PostReplyBuilder;
import net.pterodactylus.sone.database.PostReplyBuilder.PostReplyCreated;
+import net.pterodactylus.sone.freenet.wot.OwnIdentity;
import net.pterodactylus.sone.utils.IntegerRangePredicate;
import net.pterodactylus.sone.web.WebInterface;
import net.pterodactylus.sone.web.page.FreenetRequest;
private final Sone mockedSone = mock(Sone.class);
private final String id;
+ private String insertUrI;
private boolean local;
private boolean current;
private Optional<String> name = absent();
return this;
}
+ public SoneMocker insertUri(String insertUri) {
+ this.insertUrI = insertUri;
+ return this;
+ }
+
public SoneMocker current() {
current = true;
return this;
public Sone create() {
when(mockedSone.getId()).thenReturn(id);
when(mockedSone.isLocal()).thenReturn(local);
+ if (local) {
+ OwnIdentity ownIdentity = mock(OwnIdentity.class);
+ when(ownIdentity.getInsertUri()).thenReturn(insertUrI);
+ when(mockedSone.getIdentity()).thenReturn(ownIdentity);
+ }
if (current) {
currentSone = of(mockedSone);
}